首页 > 其他 > 详细

TP支付宝线上资金冻结转支付

时间:2020-05-12 19:51:17      阅读:76      评论:0      收藏:0      [点我收藏+]
public function doFreezeToPay($config, $order){
$sysconfig = Db::name("setting")->find();
vendor(‘alipays.AopSdk‘);
$aop = new \AopClient ();
$aop->appId = $config[‘appId‘];
$aop->rsaPrivateKey = $config[‘appSecret‘];
$aop->alipayrsaPublicKey = $config[‘aliSecret‘];
$aop->gatewayUrl = ‘https://openapi.alipay.com/gateway.do‘;
$aop->apiVersion = ‘1.0‘;
$aop->signType = ‘RSA2‘;
$aop->postCharset=‘utf-8‘;
$aop->format=‘json‘;
$request = new \AlipayTradePayRequest ();
$request->setNotifyUrl($sysconfig[‘notifyUrl‘]);
$request->setBizContent("{" .
"\"out_trade_no\":\"".$order[‘ordersn‘]."\"," .
"\"product_code\":\"PRE_AUTH_ONLINE\"," .
"\"subject\":\"零押宝授权转支付\"," .
"\"buyer_id\":\"".$order[‘payer_user_id‘]."\"," .
"\"seller_id\":\"".$config[‘pid‘]."\"," .
"\"total_amount\":\"".$order[‘money‘]."\"," .
"\"auth_no\":\"".$order[‘authno‘]."\"," .
"\"body\":\"零押宝授权转支付\"" .
"\"auth_confirm_mode\":\"COMPLETE\"" .
"}");
$result = $aop->execute( $request);
var_dump($result) ;
}

TP支付宝线上资金冻结转支付

原文:https://www.cnblogs.com/catyxiao/p/12877764.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!