集成跳转支付

发起请求

$data参数 查看
$data = array(
'body' => array(
'billingAddress' => array(
'address' => 'address',
'city' => 'BR',
'country' => 'country',
'email' => '[email protected]',
'firstName' => 'firstName',
'lastName' => 'lastName',
'phone' => '13800138000',
'state' => 'CE',
'postalCode' => '666666'
),
'callbackUrl' => $callbackUrl,
'customerId' => '', // asiabill创建的客户id,非网站用户id
'deliveryAddress' => array(
'shipAddress' => 'mfdgohmqkpocemkqwtks',
'shipCity' => 'MQOHUPOX',
'shipCountry' => 'BR',
'shipFirstName' => 'SFDMPG',
'shipLastName' => 'USJAXT',
'shipPhone' => '62519594707',
'shipState' => 'WEWBZ',
'shipZip' => '512008'
),
'goodsDetails' => array(
array(
'goodsCount' => '1',
'goodsPrice' => '6.00',
'goodsTitle' => 'goods_1'
),
array(
'goodsCount' => '1',
'goodsPrice' => '8.00',
'goodsTitle' => 'goods_2'
)
),
'isMobile' => $asiabill->isMobile(), // 0:web, 1:h5, 2:app_SDK
'orderAmount' => '7.00',
'orderCurrency' => 'USD',
'orderNo' => getOrderNo(),
'paymentMethod' => 'Credit Card', // 其它支付方式请参考文档
'platform' => 'php_SDK',
'remark' => '',
'returnUrl' => $returnUrl
'webSite' => $_SERVER['HTTP_HOST']
)
);
$result = $asiabill->request('checkoutPayment',$data);

重定向到支付页面

if($result['code'] == '0000'){
$url = $result['data']['redirectUrl']
header("location: $url");
exit;
}