在這種模式下,付款僅屬于平臺帳戶。平臺賬戶負(fù)責(zé)支付費(fèi)用、退款和拒付。資金將從平臺賬戶拆分為一個(gè)或多個(gè)關(guān)聯(lián)賬戶。推薦用于平臺直接與終端客戶交互并管理日常交易的情況。典型案例包括市場或按需服務(wù)平臺。
您可以使用該connected_account_id屬性指定要與給定交易關(guān)聯(lián)的連接帳戶。下圖說明了此模型中標(biāo)準(zhǔn)一次性100英鎊付款的過程。
筆記:
在托管支付頁面/嵌入字段/Drop-in/移動(dòng)集成的情況下,平臺可以繞過步驟2和3,但需要FundsSplit在收到成功捕獲支付的通知后創(chuàng)建請求。
平臺創(chuàng)建payment_intent100 GBP并連接帳戶ID
$ 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' \
> -d'{
"request_id": "ee939540-3203-4a2c-9172-89a566485dd9",
"amount": 100,
"currency": "GBP",
"merchant_order_id": "cc9bfc13-ba30-483b-a62c-ee925fc9bfea",
"connected_account_id": "acct_ad1KMcnQM2Wmo2PFSuvR2g"
}'
平臺確認(rèn)payment_intent正常請求正文
$ 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' \
> -d'{
"request_id": "ee939540-3203-4a2c-9172-89a566485dd9",
"payment_method": {
"card": {
"expiry_month": "12",
"expiry_year": "2030",
"number": "4111111111111111"
},
}
}'
平臺捕獲payment_intent100 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' \
> -d'{
"request_id": "ee939540-3203-4a2c-9172-89a566485dd9",
"amount": 100
}'
平臺創(chuàng)建FundsSplit90英鎊,其中source_id等于payment_intent_id,destination等于已連接的account_id
$ 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' \
> -d'{
"request_id": "ee939540-3203-4a2c-9172-89a566485dd9",
"source_id": "int_e65tkXCSzJrsMpTrzoFrjaau53",
"source_type":"PAYMENT_INTENT",
"amount": 90,
"destination":"acct_ad1KMcnQM2Wmo2PFSuvR2g",
"metadata": {
"reason": "disbursement to seller A"
}
}'
在資金需要拆分到多個(gè)關(guān)聯(lián)賬戶的情況下,平臺需要?jiǎng)?chuàng)建多個(gè)FundsSplit以每個(gè)關(guān)聯(lián)賬戶為目的地。
$ 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' \
> -d'{
"request_id": "ee939540-3203-4a2c-9172-89a566485dd9",
"source_id": "int_e65tkXCSzJrsMpTrzoFrjaau53",
"source_type":"PAYMENT_INTENT",
"amount": 40,
"destination":"acct_ij2YyjhFNv-BGPsjqHuI3w",
"metadata": {
"reason": "disbursement to seller A"
}
}'
$ 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' \
> -d'{
"request_id": "ee939540-3203-4a2c-9172-89a566485dd9",
"source_id": "int_e65tkXCSzJrsMpTrzoFrjaau53",
"source_type":"PAYMENT_INTENT",
"amount": 35,
"destination":"acct_aD5rChdqMoCkSn3WseuKLw",
"metadata": {
"reason": "disbursement to seller B"
}
}'
資金將根據(jù)拆分部分結(jié)算到各方的錢包,其中平臺收到5英鎊(扣除Airwallex費(fèi)用5英鎊),關(guān)聯(lián)賬戶收到90英鎊作為支付
筆記:
如果您想在此模型中創(chuàng)建定期付款,您還需要?jiǎng)?chuàng)建一個(gè)PaymentConsent關(guān)聯(lián)帳戶ID。