Dual Messaging
Auth and Capture
Sometimes as a merchant you might want to place a lien on a customer's account first before making a subsequent call to either void it, or convert the lien to a sale. That's where our dual messaging comes into play. Via our web redirect/inline or direct APIs, you can achieve this flow by sending a transactionMode request parameter.
The dual messaging APIs are part of our Card Payments API, so the way the card is encrypted and API requests are authenticated follow the same flow.
Auth Request
To send a preauth request, all you need to do is to add a transactionMode request parameter, and the value should be AUTH. There's also an optional parameter authorizationDuration you can send to indicate how many days you want the auth to be active for. If no completion or void message comes before the time elapses, the preauth is automatically voided.
curl --request POST \
--url https://qa.interswitchng.com/collections/api/v3/purchases \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '
{
"customerId": "[email protected]",
"amount": "600.00",
"transactionRef": "asdfasdfasdf",
"transactionMode": "AUTH",
"currency": "NGN",
"authData": "G3cf/VTghh=="
}
'
Capture Request
To capture and complete an original preauth transaction, the details of the transaction are sent and how much of the amount is supposed to be captured. For partial capture, send the amount you want, for full capture, send the original transaction amount. A unique reference for the capture request should be sent as requestRef.
curl --request POST \
--url https://qa.interswitchng.com/collections/api/v3/purchases/capture \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '
{
"transactionRef": "asdfasdfasdf",
"requestRef": "aaaa1223",
"amount": 300.50
}
Void Request**
You can immediately void the preauth request if you want to cancel the transaction or void the original preauth request for whatever reason. The transactionRef* should contain the original reference of the preauth transaction you're trying to void.
curl --request POST \
--url https://qa.interswitchng.com/collections/api/v3/purchases/reverse \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '
{
"transactionRef": "asdfasdfasdf",
"reversalReason": "Not proceeding with transaction"
}
Updated about 1 month ago