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

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'] . "\"," .
"\"outStoreCode\":\"" . $order['out_store_code'] . "\"," .
"\"auth_no\":\"" . $order['auth_no'] . "\"," .
"\"body\":\"零押宝授权转支付\"" .
"\"auth_confirm_mode\":\"COMPLETE\"" .
"}");
$result = $aop->execute($request);
print_r($result);
}
posted @ 2020-05-12 18:05  鲨鱼大王  阅读(236)  评论(0编辑  收藏  举报