Please see the guidance below:
For Payment Pages, JavaScript or Mobile SDK integrations
If you're developing Payouts for Apple Pay for integrations using our hosted Payment Pages or JavaScript solutions, you can only process payouts using a parenttransactionreference value from a previous transaction.
Submit a REFUND request including the parenttransactionreference of a previous transaction from which you want to inherit the Apple Pay card token.
#!/usr/bin/python
import securetrading
stconfig = securetrading.Config()
stconfig.username = "webservices@example.com"
stconfig.password = "Password1^"
st = securetrading.Api(stconfig)
payout= {
"accounttypedescription": "CFT",
"baseamount": "1",
"currencyiso3a": "GBP",
"parenttransactionreference": "1-2-345678",
"requesttypedescriptions": ["REFUND"],
"sitereference": "site12346"
}
strequest = securetrading.Request()
strequest.update(payout)
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(
'accounttypedescription' => 'CFT',
'baseamount' => '1',
'currencyiso3a' => 'GBP',
'parenttransactionreference' => '1-2-345678',
'requesttypedescriptions' => array('REFUND'),
'sitereference' => 'site12346'
);
$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": [{
"accounttypedescription": "CFT",
"baseamount": "1",
"currencyiso3a": "GBP",
"parenttransactionreference": "1-2-345678",
"requesttypedescriptions": ["REFUND"],
"sitereference": "site12346"
}]
}'
{
"alias":"webservices@example.com",
"version":"1.00",
"request":[{
"accounttypedescription":"CFT",
"baseamount":"1",
"currencyiso3a":"GBP",
"parenttransactionreference": "1-2-345678",
"requesttypedescriptions":["REFUND"],
"sitereference":"site12346"
}]
}
<requestblock version="3.67">
<alias>webservices@example.com</alias>
<request type="REFUND">
<billing>
<amount currencycode="GBP">1</amount>
</billing>
<operation>
<accounttypedescription>CFT</accounttypedescription>
<parenttransactionreference>1-2-345678</parenttransactionreference>
<sitereference>site12346</sitereference>
</operation>
</request>
</requestblock>
Replace <DOMAIN> with a supported domain. View full domain list.
If the payout is declined, this may be due to the Apple Pay token referenced in your request being deleted or updated. In this scenario:
- Process a new payment or account check to re-capture the cardholder's Apple Pay details.
- Obtain the new transactionreference from the response.
- Submit a new payout request using this transactionreference as the parenttransactionreference.
If the payout is still declined, the cardholder should contact their card issuer for support.
For API integrations with Apple Pay direct
If you're developing Payouts for integrations that processes transactions with Apple Pay directly, you can include an Apple Pay card token in a new API request to process the payout.
Submit a REFUND request including the unique Apple Pay card token in the pan field. Note: You don't need to submit the parenttransactionreference in this flow.
#!/usr/bin/python
import securetrading
stconfig = securetrading.Config()
stconfig.username = "webservices@example.com"
stconfig.password = "Password1^"
st = securetrading.Api(stconfig)
auth = {
"accounttypedescription":"CFT",
"baseamount":"2000",
"currencyiso3a":"GBP",
"eci":"2",
"expirydate":"07/2023",
"pan":"5100000000000511",
"requesttypedescriptions": ["REFUND"],
"sitereference": "test_site12345",
"tavv":"ALFoEd4DhmGzAIj3dUo4AoABFA==",
"walletdisplayname":"MasterCard 0511",
"walletsource":"APPLEPAY"
}
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(
'accounttypedescription' => 'CFT',
'baseamount' => '2000',
'currencyiso3a' => 'GBP',
'eci' => '2',
'expirydate' => '07/2023',
'orderreference' => 'My_Order_123',
'pan' => '5100000000000511',
'requesttypedescriptions' => array('REFUND'),
'sitereference' => 'test_site12345',
'tavv' => 'ALFoEd4DhmGzAIj3dUo4AoABFA==',
'walletdisplayname' => 'MasterCard 0511',
'walletsource' => 'APPLEPAY'
);
$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": [{
"accounttypedescription":"CFT",
"baseamount":"2000",
"currencyiso3a":"GBP",
"eci":"2",
"expirydate":"07/2023",
"orderreference": "My_Order_123",
"pan":"5100000000000511",
"requesttypedescriptions": ["REFUND"],
"sitereference": "test_site12345",
"tavv":"ALFoEd4DhmGzAIj3dUo4AoABFA==",
"walletdisplayname":"MasterCard 0511",
"walletsource":"APPLEPAY"
}]
}'
{
"alias":"webservices@example.com",
"version":"1.00",
"request":[{
"accounttypedescription":"CFT",
"baseamount":"2000",
"currencyiso3a":"GBP",
"eci":"2",
"expirydate":"07/2023",
"orderreference": "My_Order_123",
"pan":"5100000000000511",
"requesttypedescriptions": ["REFUND"],
"sitereference": "test_site12345",
"tavv":"ALFoEd4DhmGzAIj3dUo4AoABFA==",
"walletdisplayname":"MasterCard 0511",
"walletsource":"APPLEPAY"
}]
}
<requestblock version="3.67">
<alias>webservices@example.com</alias>
<request type="REFUND">
<billing>
<payment>
<expirydate>07/2023</expirydate>
<pan>5100000000000511</pan>
<wallet>
<displayname>MasterCard 0511</displayname>
<source>APPLEPAY</source>
</wallet>
</payment>
<amount currencycode="GBP">2000</amount>
</billing>
<merchant>
<orderreference>My_Order_123</orderreference>
</merchant>
<operation>
<sitereference>test_site12345</sitereference>
<accounttypedescription>CFT</accounttypedescription>
</operation>
<threedsecure>
<eci>2</eci>
<tavv>ALFoEd4DhmGzAIj3dUo4AoABFA==</tavv>
</threedsecure>
</request>
</requestblock>
Replace <DOMAIN> with a supported domain. View full domain list.
If the payout is declined, the cardholder should contact their card issuer for support.