Contents

Refunds

For customers that have completed a payment using DCC, it is possible to process refunds by submitting a REFUND request.

 

Info
Remember!

  • The customer’s currency is the currency associated with their card.
  • The merchant’s currency is the local currency associated with your account.

 

DCC refunds have a similar structure to standard REFUND requests, but are subject to additional requirements that are outlined below. There are four DCC refund options available:

 

Warning
It is your responsibility to ensure that all DCC field values you include in any DCC REFUND requests are correct and agreed with your conversion rate provider.

Your conversion rate provider will specify the required process to handle refunds on your account. We recommend that you review the options available and contact our Support team for further information.


 

Option 1: Refund using original rate

 

Request

The request has the same structure as a standard REFUND request, except your system will also need to resubmit either the customer currency fields OR the merchant currency fields, as shown below:

 

Either submit the following two customer currency fields in the request:

currencyiso3a The customer’s currency.
baseamount The amount in the customer’s currency.

 

Or, if you prefer to submit the merchant currency fields in the request:

dcccurrencyiso3a The merchant’s currency.
dccbaseamount The amount in the merchant’s currency.

 

Info
As with standard REFUND requests, the submitted parenttransactionreference field must refer to the parent AUTH request being refunded (not the CURRENCYRATE request).

#!/usr/bin/python
import securetrading
  
stconfig = securetrading.Config()
stconfig.username = "[email protected]"
stconfig.password = "Password1^"
st = securetrading.Api(stconfig)
  
refund= {
  "requesttypedescriptions": ["REFUND"],
  "sitereference": "test_site12345",
  "parenttransactionreference": "1-2-345678",
  "currencyiso3a": "USD",
  "baseamount": "1641"
}
  
strequest = securetrading.Request()
strequest.update(refund)
stresponse = st.process(strequest) #stresponse contains the transaction response
<?php

if (!($autoload = realpath(__DIR__ . '/../../../autoload.php')) && !($autoload = realpath(__DIR__ . '/../vendor/autoload.php'))) {
  throw new Exception('Composer autoloader file could not be found.');
}
require_once($autoload);

$configData = array(
  'username' => '[email protected]',
  'password' => 'Password1^',
);

$requestData = array(
  'requesttypedescriptions' => array('REFUND'),
  'sitereference' => 'test_site12345',
  'parenttransactionreference' => '1-2-345678',
  'currencyiso3a' => 'USD',
  'baseamount' => '1641'
);

$api = Securetradingapi($configData);
$response = $api->process($requestData);
var_dump($response->toArray());

?>
curl --user [email protected]:Password1^ https://webservices.securetrading.net/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{
"alias": "[email protected]",
"version": "1.00",
"request": [{
  "requesttypedescriptions": ["REFUND"],
  "sitereference": "test_site12345",
  "parenttransactionreference": "1-2-345678",
  "currencyiso3a": "USD",
  "baseamount": "1641"
}]}'

Request REFUND
Partial refund

By submitting a baseamount OR dccbaseamount with a lower value than originally authorised, your system can process partial refunds. We will automatically recalculate the amount in the other currency and this will be returned in the response.

 

Response

The response returned will follow a similar structure to a standard REFUND response, with the addition of DCC-specific fields, as described below.

The DCC-specific fields returned will have the same values as in the initial CURRENCYRATE and AUTH requests, reflecting that the same conversion data has been applied.

Info
The dccratio value is calculated using the refund amount in the customer and merchant currencies. Because this value is calculated after the conversion has taken place, and the converted amount is rounded, the dccratio returned in the response may differ slightly from that used in the initial payment.

 

Field specification

Key

Field name Type Length Request Response Description
baseamount Numeric 13

Submit one of these fields

The amount to be refunded in the customer’s currency (this includes the fee added as part of the Margin Rate Percentage calculation). This should be in base units with no commas or decimal points, so £10 would be 1000.

Note: When submitting the baseamount, you must also submit the associated currencyiso3a field.

dccbaseamount Numeric 13 The amount to be refunded to the customer in the merchant’s currency. This should be in base units with no commas or decimal points, so £10 would be 1000.

Note: When submitting the dccbaseamount, you must also submit the associated dcccurrencyiso3a field.

currencyiso3a Alpha 3

Submit one of these fields

The customer’s currency in iso3a format. Click here for a full list of available currencies.

Required if the baseamount is submitted.

dcccurrencyiso3a Alpha 3 The merchant’s currency in iso3a format. Click here for a full list of available currencies.

Required if the dccbaseamount is submitted.

dccconversionrate Numeric 255 The conversion rate originally used to calculate the amount in the customer’s currency (returned in the original CURRENCYRATE response).
dccconversionratesource Alphanumeric 255 The source of the original conversion rate returned from the DCC provider (returned in the original CURRENCYRATE response).
dccenabled Numeric 1 The value returned will be “1”, indicating the account used for processing this payment is enabled for DCC.
dccmarginratepercentage Numeric 11 The percentage (4 decimal places) used as part of the CURRENCYRATE request to calculate the currency conversion fee, which is automatically appended to the amount in the customer’s currency, following calculation.
dccoffered Numeric 1 This value represents whether the REFUND was processed in the customer’s currency or the merchant’s currency:

1 – The customer was refunded in the customer’s currency.

3 – The customer was refunded in the merchant’s currency.

dccproviderdata Alphanumeric 255 A unique string that contains information on the calculated conversion rate, returned directly from participating conversion rate providers (returned in CURRENCYRATE response).
dccratio Numeric 255 The ratio between both amounts processed in the request in main units.
dcctype Alpha 3 If submitted, this must be “DCC”. This is returned in the response.
parenttransactionreference Alphanumeric including hyphen  25 This field must contain the transaction reference of the AUTH request that you would like to refund.
requesttypedescriptions  Alpha 20  * You must submit “REFUND”, as shown in the request example.

*The field ‘requesttypedescription’ is returned instead e.g. “requesttypedescription”:”REFUND”

 


 

Option 2: Refund using new rate

 

Process overview

1
Perform a new CURRENCYRATE request.

Note: When performing a partial refund, you will need to submit a lower dccbaseamount in the request.

2
Perform a REFUND request, ensuring all DCC-specific fields returned in the new CURRENCYRATE response are submitted (see list below).
Info
As with standard REFUND requests, the submitted parenttransactionreference field must refer to the parent AUTH request being refunded (not the CURRENCYRATE request).

 

Request

The following is an example of a request to process a REFUND using a new conversion rate. This presumes you have already performed a new CURRENCYRATE request and are including the new data in the REFUND request (Refer to the field specification below for further information on these fields)


#!/usr/bin/python
import securetrading
  
stconfig = securetrading.Config()
stconfig.username = "[email protected]"
stconfig.password = "Password1^"
st = securetrading.Api(stconfig)
  
refund= {
  "requesttypedescriptions": ["REFUND"],
  "sitereference": "test_site12345",
  "parenttransactionreference": "1-2-345678",
  "currencyiso3a": "USD",
  "baseamount": "1641",
  "dcctype": "DCC",
  "dccconversionrate": "1.5626",
  "dccmarginratepercentage": "2.5000",
  "dcccurrencyiso3a": "GBP",
  "dccbaseamount": "1050"
}
  
strequest = securetrading.Request()
strequest.update(refund)
stresponse = st.process(strequest) #stresponse contains the transaction response
<?php

if (!($autoload = realpath(__DIR__ . '/../../../autoload.php')) && !($autoload = realpath(__DIR__ . '/../vendor/autoload.php'))) {
  throw new Exception('Composer autoloader file could not be found.');
}
require_once($autoload);

$configData = array(
  'username' => '[email protected]',
  'password' => 'Password1^',
);

$requestData = array(
  'requesttypedescriptions' => array('REFUND'),
  'sitereference' => 'test_site12345',
  'parenttransactionreference' => '1-2-345678',
  'currencyiso3a' => 'USD',
  'baseamount' => '1641',
  'dcctype' => 'DCC',
  'dccconversionrate' => '1.5626',
  'dccmarginratepercentage' => '2.5000',
  'dcccurrencyiso3a' => 'GBP',
  'dccbaseamount' => '1050'
);

$api = Securetradingapi($configData);
$response = $api->process($requestData);
var_dump($response->toArray());

?>
curl --user [email protected]le.com:Password1^ https://webservices.securetrading.net/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{
"alias": "[email protected]",
"version": "1.00",
"request": [{
  "requesttypedescriptions": ["REFUND"],
  "sitereference": "test_site12345",
  "parenttransactionreference": "1-2-345678",
  "currencyiso3a": "USD",
  "baseamount": "1641",
  "dcctype": "DCC",
  "dccconversionrate": "1.5626",
  "dccmarginratepercentage": "2.5000",
  "dcccurrencyiso3a": "GBP",
  "dccbaseamount": "1050"
}]}'

 

 

Response

The response returned will follow a similar structure to a standard REFUND response, with the addition of DCC-specific fields, as described below.

The DCC-specific fields returned will have the same values as in the new CURRENCYRATE request, reflecting that the new conversion data has been applied.

 

Field specification

Key

Field name Type Length Request Response Description
baseamount Numeric 13

The full amount to be refunded in the customer’s currency (this includes the fee added as part of the Margin Rate Percentage calculation). This should be in base units with no commas or decimal points, so £10 would be 1000.
dccbaseamount Numeric 13 The full amount to be refunded to the customer in the merchant’s currency. This should be in base units with no commas or decimal points, so £10 would be 1000.
currencyiso3a Alpha 3 The customer’s currency in iso3a format. Click here for a full list of available currencies.
dcccurrencyiso3a Alpha 3 The merchant’s currency in iso3a format. Click here for a full list of available currencies.
dccconversionrate Numeric 255 The conversion rate used to calculate the new amounts (returned in the new CURRENCYRATE response).
dccconversionratesource Alphanumeric 255 The source of the new conversion rate returned from the DCC provider (returned in the new CURRENCYRATE response).
dccenabled Numeric 1 The value returned will be “1”, indicating the account used for processing this payment is enabled for DCC.
dccmarginratepercentage Numeric 11 The percentage used as part of the new CURRENCYRATE request, to calculate the currency conversion fee (4 decimal places), automatically added to the amount in the customer’s currency by the DCC provider.
dccoffered Numeric 1 This value represents whether the REFUND was processed in the customer’s currency or the merchant’s currency:

1 – The customer was refunded in the customer’s currency.

3 – The customer was refunded in the merchant’s currency.

dccproviderdata Alphanumeric 255 A unique string that contains information on the calculated conversion rate, returned directly from participating conversion rate providers (returned in CURRENCYRATE response).
dccratio Numeric 255 The ratio between both amounts processed in the request in main units.
dcctype Alpha 3 This must be submitted as “DCC” in the request. This is returned in the response.
parenttransactionreference Alphanumeric including hyphen  25 This field must contain the transaction reference of the AUTH request that you would like to refund.
requesttypedescriptions  Alpha 20  * You must submit “REFUND”, as shown in the request example.

*The field ‘requesttypedescription’ is returned instead e.g. “requesttypedescription”:”REFUND”

 


 

Option 3: Refund using custom rule

 

Process overview

Your conversion rate provider may require you to use a new conversion rate when performing a DCC refund after a pre-specified number of days have passed since the parent AUTH was processed (we’ll refer to this as x days). To address this, our Support team can configure your account to behave in the following way:

To have this configured for your account or to find out further information, please contact our Support team.

 

Request

The request has the same structure as a standard REFUND request, except your system will also need to resubmit either the customer currency fields OR the merchant currency fields, as shown below:

 

Either submit the following two customer currency fields in the request:

currencyiso3a The customer’s currency.
baseamount The amount in the customer’s currency.

 

Or, if you prefer to submit the merchant currency fields in the request:

dcccurrencyiso3a The merchant’s currency.
dccbaseamount The amount in the merchant’s currency.

 

Info
As with standard REFUND requests, the submitted parenttransactionreference field must refer to the parent AUTH request being refunded (not the CURRENCYRATE request).
Info
This implementation supports both partial refunds and full refunds. Simply submit a lower baseamount OR dccbaseamount and we will calculate the value in the other currency.

 


#!/usr/bin/python
import securetrading
  
stconfig = securetrading.Config()
stconfig.username = "[email protected]"
stconfig.password = "Password1^"
st = securetrading.Api(stconfig)
  
refund= {
  "requesttypedescriptions": ["REFUND"],
  "sitereference": "test_site12345",
  "parenttransactionreference": "1-2-345678",
  "currencyiso3a": "USD",
  "baseamount": "1641"
}
  
strequest = securetrading.Request()
strequest.update(refund)
stresponse = st.process(strequest) #stresponse contains the transaction response
<?php

if (!($autoload = realpath(__DIR__ . '/../../../autoload.php')) && !($autoload = realpath(__DIR__ . '/../vendor/autoload.php'))) {
  throw new Exception('Composer autoloader file could not be found.');
}
require_once($autoload);

$configData = array(
  'username' => '[email protected]com',
  'password' => 'Password1^',
);

$requestData = array(
  'requesttypedescriptions' => array('REFUND'),
  'sitereference' => 'test_site12345',
  'parenttransactionreference' => '1-2-345678',
  'currencyiso3a' => 'USD',
  'baseamount' => '1641'
);

$api = Securetradingapi($configData);
$response = $api->process($requestData);
var_dump($response->toArray());

?>
curl --user [email protected]:Password1^ https://webservices.securetrading.net/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{
"alias": "[email protected]",
"version": "1.00",
"request": [{
  "requesttypedescriptions": ["REFUND"],
  "sitereference": "test_site12345",
  "parenttransactionreference": "1-2-345678",
  "currencyiso3a": "USD",
  "baseamount": "1641"
}]}'

 


Option 4: Refund using MyST

 

It is also possible to refund DCC payments by using MyST. If the payment was processed using the customer’s currency (shown within MyST as dccoffered = 1), we automatically perform a new CURRENCYRATE request in order to refund the customer using an up-to-date conversion rate. MyST also supports the ability to process partial refunds.

User
The ability to refund transactions using MyST is limited to users with certain user roles (refer to the MyST User Guide for information on different user roles).