# 集成跳转支付

{% content-ref url="/pages/mED3EtrN8RuYbpKBD3xU" %}
[托管支付](/docs/zhi-fu/zai-xian-zhi-fu/tuo-guan-zhi-fu.md)
{% endcontent-ref %}

### 发起请求

$data参数 [查看](https://asiabill.gitbook.io/api-explorer/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;
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://asiabill.gitbook.io/docs/ji-cheng-sdk/php-sdk/ji-cheng-tiao-zhuan-zhi-fu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
