DCC
DCC (Dynamic Currency Conversion) is a technological solution that allows customers to perform transactions using a bank card when travelling abroad. These transactions can be in any currency other than the domestic currency of the country in which the transaction takes place. This includes payments, reversals, captures, and refunds.
Some merchant customers pay for goods and services in the currency of the merchant. In order to process payments in the customer's preferred currency, a DCC service must be used. This service allows payments to be processed in the customer's card currency.
DCC functionality works only for non-local JCC cards (the customer's bank card differs from the currency used for payment for the merchant's order).
Below is the description of possible scenarios of using DCC.
Scenarios
Redirect Payment using DCC
The below scheme describes the scenario of using DCC when the card data are collected on the side of Payment Gateway. In this scenario, the currency of the customer's bank card differs from the currency used for payment for the merchant's order.
(register.do) PG -->> OS: orderId, formUrl OS -->> C: Redirecting to the payment page C ->> PG: Entering the card data
or selecting a store credential PG ->> PG: Calculating currency conversion PG -->> C: Displaying DCC payment option on the payment page C ->> PG: Selecting DCC payment option PG ->> PG: Making the payment PG -->> C: Redirecting the client to the final page C ->> PG: Clicking "Back to shop" PG -->> C: Redirecting to the online store C ->> OS: Requesting payment status OS ->> PG: Checking the status
(getOrderStatusExtended.do) PG -->> OS: Status of the Order OS -->> C: Showing the result
- The customer has added items to their shopping cart and proceeds to payment by clicking on the appropriate element on the merchant's page.
- The merchant performs standard order registration process by sending register.do request.
- Payment Gateway verifies the merchant's details and permissions, sends a unique order number and a link to the payment page.
- The merchant redirects the customer to the payment page.
- The customer enters the card data or selects a stored credential.
- Payment Gateway interacts with DCC service to calculate conversion for currency of the customer’s card.
- Payment Gateway displays the DCC payment option on the payment page.
- The customer chooses the payment option in the currency of their card, including DCC conversion calculation, and clicks on the payment button.
- Payment Gateway performs the payment.
- Payment Gateway redirects the customer to the final page.
- The customer clicks the Back to shop element.
- The customer is redirected to the merchant's website.
- The customer’s browser requests the payment result.
- The merchant requests payment status by sending the getOrderStatusExtended.do request.
- The Payment Gateway returns the order information.
- The merchant displays the payment result to the customer.
Direct Payment using DCC
The below scheme describes the scenario of using DCC when the merchant has its own payment page to collect card data natively through its web site. In this scenario, the currency of the customer's bank card differs from the currency used for payment for the merchant's order.
or selecting a store credential OS ->> PG: calculate.do PG ->> PG: Calculating currency conversion PG -->> OS: Calculation result OS -->> C: Displaying DCC payment option on the payment page C ->> OS: Selecting DCC payment option OS ->> PG: instantPayment.do
with DCC data PG ->> PG: Making 3DS authorization
and the payment PG -->> OS: Payment result OS -->> C: Redirecting the client to the final page C ->> OS: Clicking "Back to shop" OS -->> C: Redirecting to the online store C ->> OS: Requesting payment status OS ->> PG: Checking the status
getOrderStatusExtended.do PG -->> OS: Status of the Order OS -->> C: Showing the result
- The customer has added items to their shopping cart and proceeds to payment by clicking on the appropriate element on the merchant's page.
- Online store redirects the customer to the payment page.
- The customer enters the card data or selects a stored credential.
- The merchant sends the DCC calculation request calculate.do to the Payment Gateway specifying the amount, currency, and (optionally)
merchantLogin
. - Payment Gateway interacts with DCC Server to calculate conversion for currency of the customer’s card and assigns a
dccUuid
calculation identifier to the original DCC data calculation request. - Payment Gateway stores the calculation under the generated
dccUuid
identifier and transmits the result of the calculation to the online store in thedccData
block. - The online store displays an additional payment option in the currency of the customer's card, including DCC conversion calculation.
- The customer chooses the payment option in the currency of their card, including DCC conversion calculation, and clicks on the payment button.
- The merchant sends instantPayment.do request passing DCC data received in the
dccData
block on step 6. - Payment Gateway performs 3DS authentication of the customer using the currency of the DCC conversion calculation and performs the payment.
- Payment Gateway sends the payment result to the Online Store.
- Online Store redirects the customer to the final page.
- The customer clicks the Back to shop element.
- The customer is redirected to the merchant's website.
- The customer’s browser requests the payment result.
- The merchant requests payment status by sending the getOrderStatusExtended.do request.
- Payment Gateway returns the order information.
- The merchant displays the payment result to the customer.
Reversal using DCC
The below scheme describes the scenario of reversal for a two-phase order payed with DCC. To make partial reversals, you need to have a special permission.
-
The merchant initiates reversal by sending the reverse.do request to the Payment Gateway and specifying the reversal amount.
If the
currency
parameter is specified in the request, this currency is used for the reversal. If the currency is not specified, the original currency of the order is used by default. Payment Gateway interacts with DCC Server to calculate conversion for currency using
dccUuid
parameter of the initial payment.Payment Gateway sends the reversal result to the merchant.
Capture using DCC
The below scheme describes the scenario of completion of a two-phase order payed with DCC (capture of the funds).
-
The merchant initiates capture by sending the deposit.do request to the Payment Gateway and specifying the capture amount.
If the
currency
parameter is specified in the request, this currency is used for the capture. If the currency is not specified, the original currency of the order is used by default. Payment Gateway interacts with DCC Server to calculate conversion for currency using
dccUuid
parameter of the initial payment.Payment Gateway sends the capture result to the merchant.
Refund using DCC
The below scheme describes the scenario of refund for an order payed with DCC.
-
The merchant initiates a refund by sending the refund.do request to the Payment Gateway and specifying the refund amount.
If the
currency
parameter is specified in the request, this currency is used for the refund. If the currency is not specified, the original currency of the order is used by default. Payment Gateway interacts with DCC Server to calculate conversion for currency using
dccUuid
parameter of the initial payment.Payment Gateway sends the refund result to the merchant.
API calls
DCC calculate
To calculate and recieve DCC data use the https://gateway-test.jcc.com.cy/payment/rest/dcc/calculate.do
request.
When sending request, you should use header:
Content-Type: application/json
Request parameters
Required | Name | Type | Description |
---|---|---|---|
Mandatory | userName |
String [1..100] | Merchant's API account login. |
Mandatory | password |
String [1..200] | Merchant's API account password. |
Conditional | mdorder |
String [1..36] | Order number in the payment gateway. Unique within the payment gateway. Should be specified if an order already exists. |
Conditional | pan |
String [1..19] | Payment card number (mandatory, unless bindinId is passed). pan overrides bindingId . |
Conditional | bindingId |
String [1..255] | Identifier of an already existing stored credential. This is the card ID tokenized by the Gateway. Can be used only if the merchant has the permission to work with stored credentials. Is mandatory if pan is not specified. |
Conditional | amount |
Integer [0..12] | Payment amount in minor currency units (e.g. in cents). Is mandatory if mdorder is not specified. |
Conditional | currency |
Integer [3] | Original currency of expected transaction. Is mandatory if mdorder is not specified. |
Optional | merchantLogin |
String [1..255] | API account login of the merchant on whose behalf the call is being made (should be accessible for currently authorized user, e.g. may be a child merchant). If it is not specified, currently authorized user merchant will be used. |
Optional | language |
String [2] | ISO 639-1 encoded language key. If the language is not specified, the default language specified in the store settings is used. Supported languages: en, el. |
Response parameters
Required | Name | Type | Description |
---|---|---|---|
Optional | errorCode |
Integer [1..2] | Information parameter in case of an error, which may have different code values:
|
Optional | errorMessage |
String [1..512] | Information parameter that is an error description in a case of error occurance. errorMessage value can vary, so it should not be hardcoded. Language of the description is set in language parameter of the request. |
Optional | originalAmount |
String [1..12] | Original amount. |
Optional | dccUuid |
String | Identifier of DCC calculation. |
Optional | dccData |
Array of objects | Array of blocks with the data for the DCC target calculation for each currency. See nested parameters. |
Below are the parameters of the object in dccData
array.
Required | Name | Type | Description |
---|---|---|---|
Optional | dccCurrencyCode |
Integer [3] | Currency of DCC conversion. |
Optional | dccAmount |
String | Amount of DCC conversion. |
Optional | dccAmountFormatted |
String | Formatted amount of payment to DCC calculation. |
Optional | dccCurrencyCodeAlpha |
String | Alphabetic ISO 4217 code of the payment currency. |
Optional | dccConversionRate |
String | Conversion rate of DCC calculation. |
Optional | dccDirectConversionRate |
String | Direct conversion rate. |
Optional | dccFeePercentage |
String | Fee amount as a percentage. |
Optional | additionalParams |
Object | A set of additional parameters, structure:{name1:value1,…,nameN:valueN}
|
Examples
Request example
curl --request POST \
--url https://gateway-test.jcc.com.cy/payment/rest/dcc/calculate.do \
--header 'content-type: application/json' \
--data '{
"pan":"4000001111111118",
"amount":"1000000",
"currency": "978",
"merchantLogin":"test_merchant_login",
"language":"en",
"username": "test_user",
"password": "test_user_password"
}'
Response example
{
"errorCode": 0,
"dccUuid": "bc42df3d-75ad-40bc-8249-4997fc8f914a",
"originalAmount": 1000000,
"dccData": [
{
"dccAmount": 1518300,
"dccAmountFormatted": "15183.00",
"dccCurrencyCode": 702,
"dccCurrencyCodeAlpha": "SGD",
"dccConversionRate": "0.6586",
"dccDirectConversionRate": "1.5183",
"dccFeePercentage": "3.00",
"additionalParams": {}
}
]
}