# 集成跳转支付

{% content-ref url="../../zhi-fu/zai-xian-zhi-fu/tuo-guan-zhi-fu" %}
[tuo-guan-zhi-fu](https://asiabill.gitbook.io/docs/zhi-fu/zai-xian-zhi-fu/tuo-guan-zhi-fu)
{% endcontent-ref %}

### 发起请求

$data参数 [查看](https://app.gitbook.com/s/Mb9UzyxGUyxHylm4UJSJ/api-reference/jiao-yi/checkout-payment)

```php
$data = array(
    'body' => array(
        'billingAddress' => array(
            'address' => 'address',
            'city' => 'BR',
            'country' => 'country',
            'email' => '123451234@email.com',
            '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);
```

### 重定向到支付页面

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