Quickstart: Crossborder payment
This quickstart uses an API calls sample to demonstrate how a mobile Xamarin Forms application can initiate Crossborder payment with DE HUB API.
Prerequisites
- User is logged in and you have an access token for the APIs
Step 1.
Check input variables from navigation like Order, Transaction, Transfer, Draft, Template or Account From, Amount, and Currency data.
If there is invalid input return the message to the caller
Step 2.
Check user has activity permisons with "v1/entitlements/me/activity-permissions". Return message if user has no execute permision for service "Payment.CrossBorderTransfers.Initiate";
Step 3.
Check user has bank accounts for Crossborder payments, get from the session or from APIs
- Get active user arrangements "v1/arrangement/arrangements"
- Get accounts based on arrangements "v1/account-data/accounts"
- For each account download image bytes from the server "v1/content/{ config.FactoryConfig_Get_Content_Folder }/documents/{ account.Image }"
- Get authorized arrangements for cross-border-transfer "v1/entitlements/me/authorized-arrangements/{service-code}"
- Get authorized accounts for cross-border-transfer "v1/entitlements/me/authorized-accounts/{service-code}"
Then create UI Model from these responses for displayed account picker with the account number, image, nick-name, balance etc. and available currency list for the cross border payment.
If there no accounts or currencies return the message to the caller.
Note
For cards you need to donwload background image too, first resolve product "v1/product/products/{product-code}" then download image bytes from the server "{ product.ImageUrl }"
Step 4.
Load and prepare necessary data in parallel based on input and previus steps
- Put party data from session or API "v1/parties/{party-number}" to the UI Model like full name, address ...
- Get default account and select in the picker "v1/dialog/fxweb/settings/"
- Get Country list "v1/reference/countries"
Get Residental codes "v1/payment/classifications/cross-border-transfer-residence-code"
Get Purpose codes for the cross-border transfer "v1/payment/purpose-codes"
Important
GET v1/payment/purpose-codes?page-size=2147483647&direction=pay-out&payout-currency=foreign-currency&clearing=False&cross-border=True&sort-order=asc&sort-by=code And then make union with standard payments code GET v1/payment/purpose-codes?page-size=2147483647&direction=pay-out&payout-currency=foreign-currency&clearing=False&cross-border=False&sort-order=asc&sort-by=code
Render UI
Step 5.
Get bank list with swift code from UI after a user enters the first three letters of swift code "v1/reference/banks"
Render UI
Step 5.5 Optional
If the user clicks on the template the load from the server, filter by type cross-border. "v1/payment/draft"
After selection of template "v1/payment/draft/{draft-id}"] update UI and model.
Render UI
Step 5.8 Required
Attach files depends on the selected purpose code. The purpose code defines which document needed to be uploaded.
Send files to the server "v1/content/{ FactoryConfig_Get_Content_Folder }/folders/{ App.Session.FolderId }"
Render UI - Dynamic UI is present here depends on user interaction with purpose codes.
Step 6.
Frist execute client validation then call server validation "v1/payment/transfers/cross-border-transfers/validate"
Render UI
Step 7.
If everything fine display information to the user
- Calculate Transfer Fee "v1/offer/calculations/transaction-fee"
- Display transfer data and fee to the user
Render UI
Step 8.
If the user clicks on Confirm then Initiate payment
- Send "v1/payment/transfers/cross-border-transfers"
- If you get Exception then raise dialog with supported authorization for example sxs-mac. RenderUI
- Then send again with header values calculated mac and post "v1/payment/transfers/cross-border-transfers"
Step 9.
After successfully payment
- Check if exists beneficiary GET "v1/payment/personal-beneficiaries"
- Insert beneficiary if there is no one POST "v1/payment/personal-beneficiaries"
- Refresh balances "v1/account-data/accounts"
Step 10.
Prepare user actions for example: Insert or modify template based on the previous user input
If the user select repeat payment you then return on Step 1 with transfer or draft in navigation params
Render UI
Next Steps
TODO