How to integrate with redirection ?
Following the payment getting started rule you have first to initialize the transaction with backend server request. The request send should like this one :
Header : AUTHORIZATION:API_PUBLIC_KEY:timeStamp:version:hash
POST https://contodeo.w-ha.com/contodeo/api/transactions/init
{
"amount": 12,
"external_id": "T-D12131321",
"auto_confirm": true,
"return_url": "https://achile-service.com/payment-return"
}
This request with initiate a transaction using the default language 'en' -> english, the default template bootstrap4. The formulary with be display with a typical layout. All the label for field and errror are completed with default value. In fact you don't have to provided much data. Be careful by default the cinematic will use 3DS security authentification during the payment workflow.
As you can see you need to provide a valid AUTHORIZATION header, it will
The result of the request look like this :
{
"payment_token": "45544d734467414141576d416f7a68664142524252564d7651304a444c31424c51314d315547466b5a476c755a77434141424
14145434b416a47592b583351436b64574959386774394963414141425162724b3453647452794b4154474d695648307035484
15450705651495a6a6c71623954636d7535774743666a64587861614f38536e73594b6c4a56627272342b69534858506331736
7685a4f634a46685554666b6a6b3035792b744d374d4c6a2f61657971624b6a364c774146484e6e4935466e444673377139354
9587a7954773050334b466b61",
"payment_url": "https://contodeo.w-ha.com/secure-node-contodeo/purchase-form",
"redirect_url": "https://contodeo.w-ha.com/secure-node-contodeo/purchase-form?token=45544d734467414141576d416f7a68664142524252564d7651304a444c31424c51314d315547466b5a476c755a77434
14142414145434b416a47592b583351436b64574959386774394963414141425162724b3453647452794b4154474d695648307
03548415450705651495a6a6c71623954636d7535774743666a64587861614f38536e73594b6c4a56627272342b69534858506
3317367685a4f634a46685554666b6a6b3035792b744d374d4c6a2f61657971624b6a364c774146484e6e4935466e444673377
1393549587a7954773050334b466b61"
}
Typicaly the redirection will be simple server redirect using the redirect_url
parameter. You can also achieve this redirect with javascript code.
The result of the redirection will be :
default bootstrap
After the user credit card data sending, if all data are valids, the bank authorization is done. Contodeo will redirect the user on the specified return_url
parameter with the transaction identifier that you will used to make further call on the service using the rest API.
The redirection url will like this :
https://achile-service.com/payment-return?trx_id=trx_id=886cdc70-08a7-49bc-35077d2bda44