支付宝网页支付
1.支付宝开放平台添加应用,获得appid,并签约。
2.在支付宝开放品台设置如下:
3.配置支付宝的应用公钥。(根据支付宝的文档)
4.在开放平台下载官方sdk demo。
5.代码:
//支付宝
include_once VENDOR_PATH . 'Alipay/aop/AopClient.php';
include_once VENDOR_PATH . 'Alipay/aop/request/AlipayTradeAppPayRequest.php';
$notify_url='https://www.www.com/app/pay/AlipayStep3Notify';
$config = array(
'appid' =>$this->appid,//
'rsaPrivateKey' =>$this->rsaPrivateKey,//开发者私钥私钥
'alipayrsaPublicKey'=>$this->alipayrsaPublicKey,//支付宝公钥
'charset'=>strtolower('utf-8'),//编码
'notify_url' =>$notify_url,//回调地址(支付宝支付成功后回调修改订单状态的地址)
'payment_type' =>1,//(固定值)
'seller_id' =>'',//收款商家账号
'charset' => 'utf-8',//编码
'sign_type' => 'RSA2',//签名方式
'timestamp' =>date("Y-m-d H:i:s"),
'version' =>"1.0",//固定值
'url' => 'https://openapi.alipay.com/gateway.do',//固定值
'method' =