跳转到内容

Hosted Checkout

查看 .md
服务地址
https://checkout.psp.example.com
Example host; obtain the actual Checkout host from PSP
认证
无需凭证
版本
1.0.0

Consumer checkout for an existing Gateway PaymentIntent. Use the psp_checkout_url returned by the Invoice API. Checkout access requires a token bound to the payment and tenant in X-Checkout-Session-Token or ?t=. Merchant Gateway credentials do not apply.

Read hosted payment and saved instructions

Section titled “Read hosted payment and saved instructions”
GET/checkout/hosted/payments/{payment_id}

路径参数

名称 类型 必填 说明
payment_id string<uuid> 必填 —

查询参数

名称 类型 必填 说明
t string 可选 Checkout token; provide this parameter or X-Checkout-Session-Token.

请求头

名称 类型 必填 说明
X-Checkout-Session-Token string 可选 Checkout token; provide this header or t.

请求示例

cURL
curl -X GET 'https://checkout.psp.example.com/checkout/hosted/payments/{payment_id}'

响应

Hosted payment detail and instructions

GET/checkout/hosted/payments/{payment_id}/status

路径参数

名称 类型 必填 说明
payment_id string<uuid> 必填 —

查询参数

名称 类型 必填 说明
t string 可选 Checkout token; provide this parameter or X-Checkout-Session-Token.

请求头

名称 类型 必填 说明
X-Checkout-Session-Token string 可选 Checkout token; provide this header or t.

请求示例

cURL
curl -X GET 'https://checkout.psp.example.com/checkout/hosted/payments/{payment_id}/status'

响应

Payment status

GET/checkout/hosted/payments/{payment_id}/success-redirect

路径参数

名称 类型 必填 说明
payment_id string<uuid> 必填 —

查询参数

名称 类型 必填 说明
t string 可选 Checkout token; provide this parameter or X-Checkout-Session-Token.

请求头

名称 类型 必填 说明
X-Checkout-Session-Token string 可选 Checkout token; provide this header or t.

请求示例

cURL
curl -X GET 'https://checkout.psp.example.com/checkout/hosted/payments/{payment_id}/success-redirect'

响应

Redirect decision

POST/checkout/creditcard/payment-intents/{payment_id}/pay

路径参数

名称 类型 必填 说明
payment_id string<uuid> 必填 —

查询参数

名称 类型 必填 说明
t string 可选 Checkout token; provide this parameter or X-Checkout-Session-Token.

请求头

名称 类型 必填 说明
X-Checkout-Session-Token string 可选 Checkout token; provide this header or t.

请求体 application/json · 必填

字段 类型 必填 说明
card_token string 可选 —
card_cvv string 可选 —
card_info object 可选 —
card_info.card_number string 必填 —
card_info.cvv string 必填 —
card_info.expiry_month integer 必填 ≥ 1 · ≤ 12
card_info.expiry_year integer 必填 —
card_info.cardholder_name string 必填 —
billing_address object 可选 —
payer_info object 可选 —
payer_info.name string 可选 —
payer_info.email string<email> 可选 —
payer_info.phone string 可选 —
require_3ds boolean 可选 —

请求示例

cURL
curl -X POST 'https://checkout.psp.example.com/checkout/creditcard/payment-intents/{payment_id}/pay' \
-H 'Content-Type: application/json' \
-d '{
"card_token": "string",
"card_cvv": "string",
"card_info": {
"card_number": "string",
"cvv": "string",
"expiry_month": 1,
"expiry_year": 0,
"cardholder_name": "string"
},
"billing_address": {},
"payer_info": {
"name": "string",
"email": "[email protected]",
"phone": "string"
},
"require_3ds": false
}'

响应

Payment submitted

POST/checkout/creditcard/payment-intents/{payment_id}/complete-3ds

路径参数

名称 类型 必填 说明
payment_id string<uuid> 必填 —

查询参数

名称 类型 必填 说明
t string 可选 Checkout token; provide this parameter or X-Checkout-Session-Token.

请求头

名称 类型 必填 说明
X-Checkout-Session-Token string 可选 Checkout token; provide this header or t.

请求体 application/json · 必填

字段 类型 必填 说明
authorization_id string<uuid> 必填 —
transaction_id string 必填 —
auth_value string 必填 —
eci string 必填 —
cres_nonce string 必填 —

请求示例

cURL
curl -X POST 'https://checkout.psp.example.com/checkout/creditcard/payment-intents/{payment_id}/complete-3ds' \
-H 'Content-Type: application/json' \
-d '{
"authorization_id": "00000000-0000-7000-8000-000000000000",
"transaction_id": "string",
"auth_value": "string",
"eci": "string",
"cres_nonce": "string"
}'

响应

3DS completed