It is possible to place restrictions on your site reference(s) to prevent a payment from being processed when the card number submitted is not thought to match the payment type selected by the customer. This feature is called verify card type, and there are two supported configurations:
0 – Auto-correct (Default)
By default, when a request is processed, we will use the IIN found at the start of the card number to automatically determine the payment type, which are stored in our records.
1 – Fail if PAN doesn’t match
Under this configuration, you are required to submit a paymenttypedescription in the request. Like with the “Auto-correct” configuration described above, we will automatically determine the payment type of the card number submitted, however if the detected payment type does not match the submitted paymenttypedescription, a 10103 error will be returned in the response. In this scenario, the authorisation will not be processed successfully.
The following is an example of an AUTH request that contains the additional field paymenttypedescription:
#!/usr/bin/python
import securetrading
stconfig = securetrading.Config()
stconfig.username = "webservices@example.com"
stconfig.password = "Password1^"
st = securetrading.Api(stconfig)
auth = {
"sitereference": "test_site12345",
"requesttypedescriptions": ["AUTH"],
"accounttypedescription": "ECOM",
"currencyiso3a": "GBP",
"baseamount": "1050",
"orderreference": "My_Order_123",
"paymenttypedescription": "VISA",
"pan": "4111111111111111",
"expirydate": "12/2020",
"securitycode": "123"
}
strequest = securetrading.Request()
strequest.update(auth)
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' => 'webservices@example.com',
'password' => 'Password1^',
);
$requestData = array(
'sitereference' => 'test_site12345',
'requesttypedescriptions' => array('AUTH'),
'accounttypedescription' => 'ECOM',
'currencyiso3a' => 'GBP',
'baseamount' => '1050',
'orderreference' => 'My_Order_123',
'paymenttypedescription' => 'VISA',
'pan' => '4111111111111111',
'expirydate' => '12/2020',
'securitycode' => '123'
);
$api = \Securetrading\api($configData);
$response = $api->process($requestData);
var_dump($response->toArray());
?>
curl --user webservices@example.com:Password1^ <DOMAIN>/json/ -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{
"alias":"webservices@example.com",
"version": "1.00",
"request": [{
"currencyiso3a": "GBP",
"requesttypedescriptions": ["AUTH"],
"sitereference": "test_site12345",
"baseamount": "1050",
"orderreference": "My_Order_123",
"accounttypedescription": "ECOM",
"paymenttypedescription": "VISA",
"pan": "4111111111111111",
"expirydate": "12/2020",
"securitycode": "123"
}]
}'
{
"alias":"webservices@example.com",
"version":"1.00",
"request":[{
"currencyiso3a":"GBP",
"requesttypedescriptions":["AUTH"],
"sitereference":"test_site12345",
"baseamount":"1050",
"orderreference":"My_Order_123",
"accounttypedescription":"ECOM",
"paymenttypedescription":"VISA",
"pan":"4111111111111111",
"expirydate":"12/2020",
"securitycode":"123"
}]
}
<requestblock version="3.67">
<alias>webservices@example.com</alias>
<request type="AUTH">
<merchant>
<orderreference>My_Order_123</orderreference>
</merchant>
<billing>
<payment type="VISA">
<expirydate>12/2020</expirydate>
<pan>4111111111111111</pan>
<securitycode>123</securitycode>
</payment>
<amount currencycode="GBP">1050</amount>
</billing>
<operation>
<sitereference>test_site12345</sitereference>
<accounttypedescription>ECOM</accounttypedescription>
</operation>
</request>
</requestblock>
Replace <DOMAIN>
with a supported domain. Click here for a full list.
Field specification
Field | Format | Description | |
paymenttypedescription XPath: /billing/payment/@type |
Alpha (20) |
Payment method (e.g. “VISA” or “MASTERCARD”).
With verify card type set to “1”, if the card number submitted by the customer does not match this payment method, the AUTH will not be completed and a 10103 error will be displayed. |
Configuration
To change your verify card type configuration, please contact our Support Team.