跳转到内容

Multi-Currency Transaction

It is only applicable to EC Scenario.

In online transactions, merchants often deal with users from different countries. When a transaction occurs, users typically prefer to use their local currency for the transaction. Therefore, EVO Cloud offers two features, FX Rate Inquiry and Multi-Currency Price (MCP), to meet the needs of merchants.

FX rate source setting

In the EVO Cloud portal, you can configure the sources of FX Rate used for each scenario. The rate sources are divided into two categories: EVO Cloud FX Rate and Acquirer FX Rate.

Under the EVO Cloud FX Rate, you can further specify rates for different card schemes, including Visa, Mastercard, and JCB. Additionally, EVO Cloud supports automatic selection of the Priority FX Rate. For more information, please refer to the EVO Cloud Portal User Manual.

If you have configured the rate source as Acquirer FX Rate, please note that after setting up the exchange rates in the EVO Cloud portal, you may need to wait for up to 5 minutes before the rates can be used in API calls.

FX Rate Inquiry

The service enables the merchant to receive a daily FX rate and use it to re-quote its products. The acquirer can define the FX rate source or setup the customized FX Rate and markup.

FX rate source setting

In the EVO Cloud portal, you can configure the sources of exchange rates used for FX Rate Inquiry. The rate sources are divided into two categories: EVO Cloud FX Rate and Acquirer FX Rate. Under the EVO Cloud Rates FX Rate, you can further specify rates for different card schame, including Visa, Mastercard, and JCB. Additionally, EVO Cloud supports automatic selection of the Priority FX Rate. For more information, please refer to the EVO Cloud Portal User Manual.

FX rate inquiry request

From your server, you can make an HTTP GET request to EVO Cloud endpoint

/g2/v1/payment/mer/{sid}/FXRateInquiry

and specify the additional parameters below.

ParameterRequiredDescription
baseCurrencyMCode of the currency that is being converted from.
quoteCurrencyMCode of the currency that is being converted to.

If the rate source is EVO Cloud FX Rate, you can query the FX rates for any two currency pairs. However, if the rate source is Acquirer Rate, you will need to configure the corresponding rates within the EVO Cloud portal before you can access them via the API.

Here is an example of requesting the API without any query parameter:

js
1.curl https://{EVO_Cloud_DOMAIN_NAME.com}/g2/v1/payment/mer/{sid}/FXRateInquiry? baseCurrency=USD&quoteCurrency=IDR paymentMethod \  
2.-H "Content-Type: application/json" \  
3.-H "DateTime: 2021-12-31T08:30:59+0800" \  
4.-H "MsgID: 2d21a5715c034efb7e0aa383b885fc7a" \  
5.-H "SignType: SHA256" \  
6.-H "Authorization: YOUR_MESSAGE_SIGNATURE"

The response includes the FX Rate in a localToTransFXRate object, containing the following fields:

  1. baseCurrency: The code of the currency that is being converted from.
  2. quoteCurrency: The code of the currency that is being converted to.
  3. date: The value of the FX rate, accurate to 7 decimal places.
  4. value: The date for the exchange rate processing.

For more details, see the EVO Cloud API Specification.

Here is an example of the response:

js
1.{  
2.    "fxRateInquiry": {  
3.        "localToTransFXRate": {  
4.            "baseCurrency": "IDR",  
5.            "date": "20230912",  
6.            "quoteCurrency": "USD",  
7.            "value": "0.0000688"  
8.        }  
9.    },  
10.    "result": {  
11.        "code": "S0000",  
12.        "message": "Success"  
13.    }  
14.}

Multi-Currency Price (MCP)

Step 1: Get the converted transaction amount

From your server, you can make an HTTP POST request to EVO Cloud endpoint

/g2/v1/payment/mer/{sid}/FXRateInquiry

and specify the additional parameters below.

ParameterRequiredDescription
merchantTransInfoMThe reference for the FX Rate Inquiry, including a unique merchantTransID and merchantTransTime to specify the time you initiate the request.
transAmountMThe currency after conversion for the payment. The value must follow the currency's minor unit.
localAmountMThe currency and value before conversion for the payment. The value must follow the currency's minor unit.

If the rate source is EVO Cloud FX Rate, you can query the FX rates for any two currency pairs. However, if the rate source is Acquirer Rate, you will need to configure the corresponding rates within the EVO Cloud portal before you can access them via the API.

Here is an example of get converted transaction from THB to HKD:

js
1.curl https://{EVO_Cloud_DOMAIN_NAME.com}/g2/v1/payment/mer/{sid}/evo.e-commerce.FXRateInquiry \  
2.-H 'Content-Type: application/json' \  
3.-H 'DateTime: 2023-09-12T11:50:50+08:00' \  
4.-H 'SignType: SHA256' \  
5.-H 'Authorization: e3a1623b09dd71ef4c400f222e88a38e87810451231f2ba5a64cc16e16cac148' \  
6.-H 'MsgID: M202309121694490650235' \  
7.-'{  
8.    "merchantTransInfo": {  
9.        "merchantTransID": "T309121694490650235",  
10.        "merchantTransTime": "2023-09-12T11:50:50+08:00"  
11.    },  
12.    "localAmount": {  
13.        "currency": "THB",  
14.        "value": "500.00"  
15.    },  
16.    "transAmount": {  
17.        "currency": "HKD"  
18.    },  
19.    "metadata""This is a metadata"  
20.}'

If the request is successful, you will receive a response with a transAmount object that shows the converted transaction amount and currency.

Details about the transAmount Object:

  1. fxRateInquiry.status: The status of the FX Rate Inquiry (required). The value can be Success or Failed.
  2. fxRateInquiry.transAmount: The currency and value after currency conversion for the payment (required). You need to use the same currency and value in the POST payment in Step 2.

Here is an example of a successful response:

js
1.{  
2.    "fxRateInquiry": {  
3.        "evoTransInfo": {  
4.            "evoTransID": "daf559621e9f4a9a9be8cd3a992f68b1",  
5.            "evoTransTime": "2023-09-12T11:50:50+08:00"  
6.        },  
7.        "localAmount": {  
8.            "currency": "THB",  
9.            "value": "500.00"  
10.        },  
11.        "localToTransFXRate": {  
12.            "baseCurrency": "THB",  
13.            "date": "20230517",  
14.            "quoteCurrency": "HKD",  
15.            "source": "customization",  
16.            "value": "0.2397226"  
17.        },  
18.        "merchantTransInfo": {  
19.            "merchantTransID": "T309121694490650235",  
20.            "merchantTransTime": "2023-09-12T11:50:50+08:00"  
21.        },  
22.        "status": "Success",  
23.        "transAmount": {  
24.            "currency": "HKD",  
25.            "value": "119.86"  
26.        }  
27.    },  
28.    "metadata""This is a metadata",  
29.    "result": {  
30.        "code": "S0000",  
31.        "message": "Success"  
32.    }  
33.}

From your server, you can make an HTTP POST request to EVO Cloud endpoint

/g2/v1/payment/mer/{sid}/payment

and specify the additional parameters below to make a MCP payment. Query Parameters

ParameterRequiredDescription
merchantTransIDMThe merchantTransInfo.merchantTransID of the initial FX Rate Inquiry.

Body Parameters

ParameterRequiredDescription
merchantTransInfoMThe reference for the payment, including a unique merchantTransID and merchantTransTime to specify the time you initiate the request.
transAmountMThe currency and value of the payment. The value must follow the currency's minor unit. This value must be the same as the value specified in paymentMethod.
paymentMethodMUse paymentMethod.type to specify different payment method types, such as e-wallet or card payment, with the relevant payment information collected in the previous step.
transInitiatorMInformation about the device that initiates the transaction.
storeInfoOSupplemental store information. Required when your store is assigned multiple MCCs in EVO Cloud to indicate which MCC you are using for this payment.
tradeInfoORequired when paymentMethod.e-wallet.paymentBrand is Alipay to indicate detailed information about this payment.
userInfoODetailed information about the buyer. Specify this if available to help EVO Cloud with laundering and fraud detection, and to increase payment success rates.
validTimeOApplied when paymentMethod.type is e-wallet to indicate the effective time (in minutes) of the order. The payment can only be executed before this time. Contact your EVO Cloud account manager for special requirements.
returnURLOThe URL to redirect your customer back to after they complete or cancel the payment.
webhookOThe URL to receive notifications. Specify this to get notifications from EVO Cloud after the payment succeeds.
metadataOSelf-defined reference information specified in the request, echoed back in the response. The metadata in the response is the same as in the request message, except for GET requests. In the GET response, it matches the POST request message metadata. Notifications will also carry the same metadata from the POST request.

Here is an example of making a THB convert to USD MCP payment

js
1.curl https://{EVO_Cloud_DOMAIN_NAME.com}/g2/v1/payment/mer/{sid}/evo.e-commerce.payment?merchantTransID=T309121694507588860 \  
2.-H 'Content-Type: application/json' \  
3.-H 'DateTime: 2023-09-12T16:33:11+08:00' \  
4.-H 'SignType: SHA256' \  
5.-H 'Authorization: 14d051b801973f1f18819f010bb6c7ab94117716e6d6e6e89a9ca920496f1f0f' \  
6.-H 'MsgID: M202309121694507591175' \  
7.-'{  
8.    "merchantTransInfo": {  
9.        "merchantTransID": "T309121694507591175",  
10.        "merchantTransTime": "2023-09-12T16:33:11+08:00"  
11.    },  
12.    "localAmount": {  
13.        "currency": "THB",  
14.        "value": "500.00"  
15.    },  
16.    "transAmount": {  
17.        "currency": "USD",  
18.        "value": "15.27"  
19.    },  
20.    "captureAfterHours":"0",  
21.    "paymentMethod": {  
22.        "type": "card",  
23.        "card":{  
24.            "cardInfo":{  
25.                "cardNumber": "4761349999000039",  
26.                "expiryDate": "3112",  
27.                "cvc": "998"  
28.            }  
29.        }  
30.    },  
31.    "transInitiator": {  
32.        "platform": "WEB"  
33.    },  
34.    "metadata""This is a metadata",  
35.    "webhook""https://YOUR_COMPANY.com/WEBHOOK"

TIP

Your next steps depend on whether the payment response contains an action object. See chapter Payment for more details.