使用此模型,付款屬于您的關聯(lián)帳戶,而不是您作為平臺。關聯(lián)賬戶負責支付費用、退款和拒付。資金將從關聯(lián)賬戶拆分為平臺賬戶。推薦用于連接賬戶直接與終端客戶交互并管理日常交易的情況,而平臺對每筆交易的參與度有限。典型案例包括SaaS平臺。
在這種模式下,平臺將代表關聯(lián)賬戶向Airwallex提交所有付款。為了表明這種關系,您需要使用x-on-behalf-of標題指定連接帳戶的帳戶ID。
下圖說明了此模型中標準一次性100英鎊付款的流程。
筆記:
在托管支付頁面/嵌入字段/Drop-in/移動集成的情況下,平臺可以繞過步驟2和3,但需要FundsSplit在收到成功捕獲支付的通知后創(chuàng)建請求。
平臺payment_intent代表具有id的連接帳戶創(chuàng)建100 GBP"acct_ad1KMcnQM2Wmo2PFSuvR2g"
$ curl --request POST \
> 'https://pci-api-demo.airwallex.com/api/v1/pa/payment_intents/create' \
> -H 'Content-Type: application/json' \
> -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0b20iLCJyb2xlcyI6WyJ1c2VyIl0sImlhdCI6MTQ4ODQxNT I1NywiZXhwIjoxNDg4NDE1MjY3fQ.UHqau03y5kEk5lFbTp7J4a-U6LXsfxIVNEsux85hj-Q' \
> -H 'x-on-behalf-of: acct_ad1KMcnQM2Wmo2PFSuvR2g \
> -d'{
"request_id": "ee939540-3203-4a2c-9172-89a566485dd9",
"merchant_order_id": "cc9bfc13-ba30-483b-a62c-ee925fc9bfea",
"amount": 100,
"currency": "GBP"
}'
平臺payment_intent代表關聯(lián)賬戶確認
$ curl --request POST \
> 'https://pci-api-demo.airwallex.com/api/v1/pa/payment_intents/int_e65tkXCSzJrsMpTrzoFrjaa u53/confirm' \
> -H 'Content-Type: application/json' \
> -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0b20iLCJyb2xlcyI6WyJ1c2VyIl0sImlhdCI6MTQ4ODQxNT I1NywiZXhwIjoxNDg4NDE1MjY3fQ.UHqau03y5kEk5lFbTp7J4a-U6LXsfxIVNEsux85hj-Q' \
> -H 'x-on-behalf-of: acct_ad1KMcnQM2Wmo2PFSuvR2g \
> -d'{
"request_id": "ee939540-3203-4a2c-9172-89a566485dd9",
"payment_method": {
"card": {
"expiry_month": "12",
"expiry_year": "2030",
"number": "4111111111111111"
}
}
}'
payment_intent代表已連接帳戶使用100 GBP的平臺捕獲(您也可以通過選擇自動捕獲跳過此過程)
$ curl --request POST \
> 'https://pci-api-demo.airwallex.com/api/v1/pa/payment_intents/int_e65tkXCSzJrsMpTrzoFrjaa u53/capture’ \
> -H 'Content-Type: application/json' \
> -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0b20iLCJyb2xlcyI6WyJ1c2VyIl0sImlhdCI6MTQ4ODQxNT I1NywiZXhwIjoxNDg4NDE1MjY3fQ.UHqau03y5kEk5lFbTp7J4a-U6LXsfxIVNEsux85hj-Q' \
> -H 'x-on-behalf-of: acct_ad1KMcnQM2Wmo2PFSuvR2g \
> -d'{
"request_id": "ee939540-3203-4a2c-9172-89a566485dd9",
"amount": 100
}'
平臺FundsSplit代表關聯(lián)賬戶創(chuàng)建10英鎊,其中source_id等于payment_intent_id,destination等于平臺賬戶自己的account_id。平臺可用于metadata記錄有助于更好地識別每個拆分的值
$ curl --request POST \
> 'https://pci-api-demo.airwallex.com/api/v1/pa/funds_splits/create' \
> -H 'Content-Type: application/json' \
> -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0b20iLCJyb2xlcyI6WyJ1c2VyIl0sImlhdCI6MTQ4ODQxNT I1NywiZXhwIjoxNDg4NDE1MjY3fQ.UHqau03y5kEk5lFbTp7J4a-U6LXsfxIVNEsux85hj-Q' \
> -H 'x-on-behalf-of: acct_ad1KMcnQM2Wmo2PFSuvR2g \
> -d'{
"request_id": "ee939540-3203-4a2c-9172-89a566485dd9",
"source_id": "int_e65tkXCSzJrsMpTrzoFrjaau53",
"source_type":"PAYMENT_INTENT",
"amount": 10,
"destination":"acct_ITNg64dHNgihu9rPpWeiMg",
"metadata": {
"reason": "commission agreed with seller A"
}
}'
資金將根據(jù)拆分部分結算到雙方的錢包,其中平臺收取10英鎊作為傭金,關聯(lián)賬戶收取85英鎊(扣除5英鎊Airwallex費用)
筆記:
如果您想在此模型中創(chuàng)建定期付款,您還需要PaymentConsent代表已連接的帳戶創(chuàng)建和驗證。
$ curl --request POST \
> 'https://pci-api-demo.airwallex.com/api/v1/pa/payment_consents/create' \
> -H 'Content-Type: application/json' \
> -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0b20iLCJyb2xlcyI6WyJ1c2VyIl0sImlhdCI6MTQ4ODQxNT I1NywiZXhwIjoxNDg4NDE1MjY3fQ.UHqau03y5kEk5lFbTp7J4a-U6LXsfxIVNEsux85hj-Q' \
> -H 'x-on-behalf-of: acct_ad1KMcnQM2Wmo2PFSuvR2g \
> -d'{
"customer_id": "cus_aag4MsYdcgHc9UTjVUS15WPvmoX",
"request_id": "88bf9327-0c10-4e87-b050-7c74ef11e1c6",
"next_triggered_by": "merchant",
"payment_method": {
"id": "mtd_0eUIICYocwY8prvHWgWoODiGxPP",
"type": "card"
},
"requires_cvc": false
}'
$ curl --request POST \
> 'https://pci-api-demo.airwallex.com/api/v1/pa/payment_consents/cst_u79lnfufjxxfdc0/verify' \
> -H 'Content-Type: application/json' \
> -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0b20iLCJyb2xlcyI6WyJ1c2VyIl0sImlhdCI6MTQ4ODQxNT I1NywiZXhwIjoxNDg4NDE1MjY3fQ.UHqau03y5kEk5lFbTp7J4a-U6LXsfxIVNEsux85hj-Q' \
> -H 'x-on-behalf-of: acct_ad1KMcnQM2Wmo2PFSuvR2g \
> -d'{
"request_id": "88bf9327-0c10-4e87-b050-7c74ef11e1c6",
"verification_options": {
"card": { \
"amount": 0,
"currency": "GBP",
"cvc": "string"
}
}
}'