这里是支付宝官方的demo下载地址如下:https://docs.open.alipay.com/270/106291/,这里仅供参考.
下面就写具体怎样实现
1:配置AlipayConfig
public class AlipayConfig{
// 商户appid
public static String APPID = "";
// 私钥 pkcs8格式的
public static String RSA_PRIVATE_KEY = "";
// 服务器异步通知页面路径 需http://或者https://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问
public static String notify_url = "/12/html/order/notify_url.jsp";
// 页面跳转同步通知页面路径 需http://或者https://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问 商户可以自定义同步跳转地址
public static String return_url="/12/payOrder/2.0/notifyZfbPay.do";
public static String app_pay_return_url="/12/appPay/2.0/notifyAppZfbPay.do";
// 请求网关地址
public static String URL = "https://openapi.alipay.com/gateway.do";
// 编码
public static Strin