集成直连支付

page直连支付

发起扣款

$data = array(
    'body' => array(
        'callbackUrl' => $callbackUrl,
        'customerId' => '', // asiabill创建的客户id,非网站用户id
        'customerPaymentMethod' => array(
            'billingDetail' => array(
                'address' => [
                    'line1' => 'line1',
                    'line2' => 'line2',
                    'city' => 'BR',
                    'country' => 'country',
                    'state' => 'CE',
                    'postalCode' => '666666'
                ],
                'email' => '123451234@email.com',
                'firstName' => 'firstName',
                'lastName' => 'lastName',
                'phone' => '13800138000',
            ),
            'card' => array(
                'cardNo' => '4111111111111111',
                'cardExpireMonth' => '05',
                'cardExpireYear' => '2055',
                'cardSecurityCode' => '123'
            )
        ),
        'shipping' => array(
            'address' => array(
                'line1' => 'line1',
                'line2' => 'line2',
                'city' => 'BR',
                'country' => 'country',
                'state' => 'CE',
                'postalCode' => '666666'
            ),
            'email' => '123451234@email.com',
            'firstName' => 'firstName',
            'lastName' => 'lastName',
            'phone' => '13800138000',
        ),
        'goodsDetails' => array(
            array(
                'goodsCount' => '1',
                'goodsPrice' => '6.00',
                'goodsTitle' => 'goods_1'
            )
        ),
        'isMobile' => $asiabill->isMobile(), // 0:web, 1:h5, 2:app_SDK
        'orderAmount' => '7.00',
        'orderCurrency' => 'USD',
        'orderNo' => getOrderNo(),
        'platform' => 'php_SDK',
        'remark' => '', 
        'returnUrl' => $returnUrl,
        'webSite' => $_SERVER['HTTP_HOST'],
        'tokenType' => ''
    )
);
$result = $asiabill->request('confirmCharge',$data);
if($result['code'] == '0000'){
    /* Your business code */
}

最后更新于