码迷,mamicode.com
首页 > 其他好文 > 详细

支付宝转账到支付宝 验证真实姓名

时间:2019-10-29 11:18:43      阅读:515      评论:0      收藏:0      [点我收藏+]

标签:业务   pos   exec   static   publickey   网关   ant   replace   code   

public static function aliPayApply($data){
require ‘alipay/config.php‘;
$out_biz_no = $data["apply_no"]; //提现单号
$payee_account = $data["alipay_account"]; //支付宝账号
$amount = $data["apply_amount"]; //提现金额
$remark = ‘提现到支付宝‘;
$payer_show_name = ‘壹企帮业务提现转账‘;
$payee_real_name = $data[‘alipay_realname‘];
//实例化支付接口
$aop = new \AopClient();
$aop->gatewayUrl = $config[‘gatewayUrl‘]; //支付宝网关
$aop->appId = $config[‘app_id‘];
$aop->rsaPrivateKey = $config[‘merchant_private_key‘];
$aop->alipayrsaPublicKey = $config[‘alipay_public_key‘];
$aop->apiVersion = ‘1.0‘;
$aop->signType = $config[‘sign_type‘];
$aop->postCharset = $config[‘charset‘];
$aop->format = "json";
$request = new \AlipayFundTransToaccountTransferRequest();
//
$request->setBizContent("{" .
"\"out_biz_no\":\"$out_biz_no\"," .
"\"payee_type\":\"ALIPAY_LOGONID\"," .
"\"payee_account\":\"$payee_account\"," .
"\"amount\":\"$amount\"," .
"\"remark\":\"$remark\"," .
"\"payer_show_name\":\"$payer_show_name\"," .
"\"payee_real_name\":\"$payee_real_name\"" .
"}");

    $result = $aop->execute($request);//返回的是object

    $responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response";
    $resultCode = $result->$responseNode->code;
    return $resultCode;
}

支付宝转账到支付宝 验证真实姓名

标签:业务   pos   exec   static   publickey   网关   ant   replace   code   

原文地址:https://blog.51cto.com/xihan/2446156

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!