支付宝提现(单笔转账到支付宝账户)
require_once "./Public/alipaySdk/AopSdk.php";
$aop = new AopClient();
$aop->gatewayUrl = "https://openapi.alipay.com/gateway.do";
$aop->appId = "2017060207403679";
$aop->rsaPrivateKey = '请填写开发者私钥去头去尾去回车,一行字符串';
$aop->alipayrsaPublicKey='请填写支付宝公钥,一行字符串';
$aop->apiVersion = '1.0';
$aop->signType = "RSA2";
$aop->postCharset='utf-8';
$aop->format = "json";
$request = new AlipayFundTransToaccountTransferRequest ();
$out_biz_no = $data['out_biz_no'];
$payee_account = $data['payee_account'];
$amount = $data['amount'];
$request->setBizContent("{" .
""out_biz_no":"$out_biz_no"," .
""payee_type":"ALIPAY_LOGONID"," .
""payee_account":"$payee_account"," .
""amount":"$amount"," .
""remark":"提现"" .
"}");
$result = $aop->execute ( $request);
$responseNode = str_replace(".", "_", $request->getApiMethodName()) . "_response";
$resultCode = $result->$responseNode->code;
if(!empty($resultCode)&&$resultCode == 10000){
echo '成功!';
} else {
echo '失败!';
}