The DCC feature is currently not available in the United States or Canada.
The amount of information that must be presented to the customer, such as rate or margin, varies by Acquirer and Currency Conversion Processor. For more information, contact your account manager (or your Acquirer).
info
Configuration
For configuration code samples, see our Configuration Code for SDKs article.
Rate Lookup
Transaction response = null;
try {
// check if Dynamic Currency Conversion is available
response =
card
.getDccRate()
.withAmount(19.99)
.withCurrency("EUR")
.execute();
} catch (ApiException $e) {
// TODO: add your error handling here
}
if (response != null) {
DccRateData dccRateData = response.getDccRateData();
// get the details to present to the customer
String cardHolderCurrency = dccRateData.getCardHolderCurrency(); // AUD
BigDecimal customerAmount = dccRateData.getCardHolderAmount(); // 28.43
String exchangeRate = dccRateData.getCardHolderRate(); // 1.4220
// TODO: update your application and display the conversion option to the customer
}
<?php
// create the card object
$card = new CreditCardData();
$card->number = "4006097467207025";
$card->expMonth = 12;
$card->expYear = date('Y', strtotime('+1 year'));
$card->cvn = "131";
$card->cardHolderName = "James Mason";
try {
// check if Dynamic Currency Conversion is available
$response = $card->getDccRate()
->withAmount(19.99)
->withCurrency('EUR')
->execute();;
} catch (ApiException $e) {
// TODO: add your error handling here
}
if (isset($response)) {
$dccRateData = $response->dccRateData;
// get the details to present to the customer
$cardHolderCurrency = $dccRateData->cardHolderCurrency; // AUD
$customerAmount = $dccRateData->cardHolderAmount; // 28.43
$exchangeRate = $dccRateData->cardHolderRate; // 1.4220
// TODO: update your application and display the conversion option to the customer
}
CreditCardData card = new CreditCardData();
card.Number = "4263970000005262";
card.ExpMonth = DateTime.Now.Month;
card.ExpYear = DateTime.Now.Year + 1;
card.Cvn = "123";
card.CardPresent = true;
Transaction response = null;
try
{
// check if Dynamic Currency Conversion is available
response =
card
.GetDccRate()
.WithAmount(19.99m)
.WithCurrency("EUR")
.Execute();
}
catch (ApiException e) {
// TODO: add your error handling here
}
if (response != null)
{
DccRateData dccRateData = response.DccRateData;
// get the details to present to the customer
string cardHolderCurrency = dccRateData.CardHolderCurrency; // AUD
decimal? customerAmount = dccRateData.CardHolderAmount; // 28.43
decimal? exchangeRate = dccRateData.CardHolderRate; // 1.4220
// TODO: update your application and display the conversion option to the customer
}
Authorization with DCC
// create the card object
CreditCardData card = new CreditCardData();
card.setNumber("4006097467207025");
card.setExpMonth(12);
card.setExpYear("DCC Rate Lookup request");
card.setCvn("131");
card.setCardHolderName("James Mason");
DccRateData dccRateData = new DccRateData();
dccRateData.setDccId("CCS_bRgMg8rCM4ikmgOWSTXGBm0CsjQlNG");
Transaction response = null;
try {
// Submit the Authorization with the customer's DCC choice
response =
card
.charge(19.99)
.withDccRateData(dccRateData)
.withCurrency("EUR")
.withOrderId("cd82c0aa-cf3c-4887-aed9-0680aee9f484")
.execute();
} catch (ApiException $e) {
// TODO: add your error handling here
}
if (response != null) {
String result = response.getResponseCode(); // SUCCESS
String message = response.getResponseMessage(); // CAPTURED
// get the details to save to the DB for future requests
String authCode = response.getAuthorizationCode(); // 12345
String paymentsReference = response.getTransactionId(); // TRN_bRgMg8rCM4ikmgOWSTXGBm0CsjQlNG
String carBrandRef = response.getCardBrandTransactionId(); // mnYbrBPsbTySGDKA
// TODO: update your application and display transaction outcome to the customer
}
<?php
// create the card object
$card = new CreditCardData();
$card->number = "4006097467207025";
$card->expMonth = 12;
$card->expYear = DCC Rate Lookup request;
$card->cvn = "131";
$card->cardHolderName = "James Mason";
$dccRateData = new DccRateData();
$dccRateData->dccId = 'CCS_bRgMg8rCM4ikmgOWSTXGBm0CsjQlNG';
try {
// Submit the Authorization with the customer's DCC choice
$response = $card->charge(19.99)
->withDccRateData($dccRateData)
->withCurrency("EUR")
->withOrderId("cd82c0aa-cf3c-4887-aed9-0680aee9f484")
->execute();
} catch (ApiException $e) {
// TODO: add your error handling here
}
if (isset($response)) {
$result = $response->responseCode; // SUCCESS
$message = $response->responseMessage; // CAPTURED
// get the details to save to the DB for future requests
$authCode = $response->authorizationCode; // 12345
$paymentsReference = $response->transactionId; // TRN_bRgMg8rCM4ikmgOWSTXGBm0CsjQlNG
$carBrandRef = $response->cardBrandTransactionId; // mnYbrBPsbTySGDKA
// TODO: update your application and display transaction outcome to the customer
}
// create the card object
CreditCardData card = new CreditCardData();
card.Number = "4263970000005262";
card.ExpMonth = DateTime.Now.Month;
card.ExpYear = DateTime.Now.Year + 1;
card.Cvn = "123";
card.CardPresent = true;
DccRateData dccRateData = new DccRateData();
dccRateData.DccId = "CCS_bRgMg8rCM4ikmgOWSTXGBm0CsjQlNG";
Transaction response = null;
try
{
// Submit the Authorization with the customer's DCC choice
response = card
.Charge(19.99m)
.WithDccRateData(dccRateData)
.WithCurrency("EUR")
.WithOrderId("cd82c0aa-cf3c-4887-aed9-0680aee9f484")
.Execute();
}
catch (ApiException e) {
// TODO: add your error handling here
}
if (response != null)
{
string result = response.ResponseCode; // SUCCESS
string message = response.ResponseMessage; // CAPTURED
// get the details to save to the DB for future requests
string authCode = response.AuthorizationCode; // 12345
string paymentsReference = response.TransactionId; // TRN_bRgMg8rCM4ikmgOWSTXGBm0CsjQlNG
string carBrandRef = response.CardBrandTransactionId; // mnYbrBPsbTySGDKA
// TODO: update your application and display transaction outcome to the customer
}
Internal Title
REST API
Show Content Nav
On
Tags