Process a Direct Debit Sale
Processing a direct debit requires sending a sale request to the inter-bank system. You
must include the mandate ID in the sale request. A successful sale response includes a
request ID that is required for any follow-on services.
Only merchants who have a
Cybersource
settlement
services account can process a direct debit and any of the follow-on services. For more
information about merchant account types, see Merchant Account Types.A direct debit settles through a batching process. For more information, see Direct Debit Batching Schedule.
Shipping Policy
Cybersource
recommends shipping the purchased
goods after the direct debit status is settled.Endpoints
Set the
apSaleService_run
field to
true
, and send the request to one of these
endpoints:Production:
https://ics2ws.ic3.com/commerce/1.x/transactionProcessor
Test:
https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor
Response Statuses
This table describes the possible statuses that you can receive in a sale response
message. The status is found in the
apSaleReply_paymentStatus
field.Cybersource Status | Description | Response Time |
---|---|---|
Chargeback | The customer claimed
that the goods were not sent. The merchant can proceed with one
of these actions:
| Any time after the purchase is settled. |
Failed | The sale request
failed. The sale request was not accepted. For example, the
currency provided was incorrect. Direct debits in the Bacs scheme must be in British pounds
sterling (GBP | Immediate in the API
response. |
Pending | The processor accepted
the sale request, but the sale is not settled. Send a check
status request for status updates. See Check a Direct Debit Status. | Immediate in API
response. |
Settled | The direct debit was
completed, and the customer is not expected to return the goods. You
can begin shipping the purchased goods. | D + 3 |
Settle_accepted | The Bacs scheme executed the direct debit.The
customer's bank sent the funds to the merchant
account. Funds can be pulled back
by the customer's bank for no reason for up to five days
after the debit is executed (until D+3 days). If the funds
are pulled back, the status changes to
Returned. | D |
Settle_initiated | The processor sent the
direct debit request to the Bacs scheme
1 day before the execution date (D-1 day).Set the execution
date in the sale request. If the merchant did not set the
execution date, the processor sent the direct debit to the
Bacs scheme in the next
scheduled batch. When the processor sends the direct debit,
the execution date is set to the day after the batch
operation. | D - 3 |
Settle_rejected | The Bacs scheme rejected
the direct debit request.A direct debit can be rejected for
several reasons, such as when the IBAN is closed or the customer
has non-sufficient funds. | Invalid for Bacs . |
Returned | The direct debit is
returned by the customer's bank. | D to D + 3 |
D is the date
on which the direct debit is executed. D + is the count of business days after the execution date. D - is the count of business days before the execution date. |
The sale service also responds with a reason code in the
apSaleReply_reasonCode
field. For more information about reason
codes, see the Reason Codes for Bacs Direct Debits for the Simple Order API.Successful Sale Batching Schedule
Direct debit sales are settled on a batching schedule and progress through a series
of statuses before the transaction is complete. These are the statuses a successful
sale progresses through in the order in which they occur:
- Pending
- Settle_initiate
- Settle_accepted
- Settled
For more information about the direct debit batching schedule and statuses, see Direct Debit Batching Schedule.
Required Fields for Processing a Direct Debit
- Set to.STL
- Set totrue.
- mandateID
- Set to.bacs
- Set to.GBP
- The value cannot exceed 11 digits and the maximum total amount cannot exceed 20 Million.GBP
Test Triggers for Processing Direct Debits
In the
Cybersource
test environment, you can
simulate specific response messages that you receive from transaction requests by
including certain values in your transaction requests. The simulated environment enables
you to become familiar with the response messages and develop methods for error
handling.Your account must be configured for testing trigger
values. Contact your
Cybersource
account manager for more
details.Test Endpoint
For test transactions, send an API request to the test endpoint.
Test:
https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor
Trigger Values
To test, send a sale request and set the
purchaseTotals_grandTotalAmount
field to a value listed in the
Trigger Value column. The Cybersource
response status is returned in
the apSaleReply_paymentStatus
field.Cybersource Response Status | Trigger Value |
---|---|
Failed | 4000.01 |
Pending | Any value except
4000.01 |
Simple Order Example: Processing a Direct Debit
Request
123456789101112<="urn:schemas-cybersource-com:transaction-data-1.214"> <merchantID>test-merchant</merchantID> <merchantReferenceCode>refnum-4321</merchantReferenceCode> <paymentScheme>bacs</paymentScheme> <mandateID>12345678912345</mandateID> <purchaseTotals> <currency>GBP</currency> <grandTotalAmount>20.00</grandTotalAmount> </purchaseTotals> <apPaymentType>STL</apPaymentType> <apSaleService run="true"/> </requestMessage>
Response to a Successful Request
123456789101112131415161718192021222324252627<replyMessage xmlns:c="urn:schemas-cybersource-com:transaction-data-1.214"> <merchantReferenceCode>refnum-1234</merchantReferenceCode> <requestID>7098276691046386503008</requestID> <decision>ACCEPT</decision> <reasonCode>100</reasonCode> <requestToken>AxjnrwSTgMxgsjmXDg1g//8ZYjWmdmpHhRpraKnvv3nGgmdC/oH8cMmkmXoxX9xYJOAzGCyOZcODWAAXXXXX</requestToken> <purchaseTotals> <currency>GBP</currency> </purchaseTotals> <exportReply> <reasonCode>100</reasonCode> <ipCountryConfidence>-1</ipCountryConfidence> </exportReply> <apReply> <transactionExpirationDate>20240313</transactionExpirationDate> </apReply> <apSaleReply> <reasonCode>100</reasonCode> <paymentStatus>pending</paymentStatus> <responseCode>00001</responseCode> <processorTransactionID>TN2ELT6W8Z3KVPG8P&</processorTransactionID> <reconciliationID>XFZ3YTGBFM6E</reconciliationID> <amount>20.00</amount> <processorResponse>00001</processorResponse> <dateTime>2024-03-07T16:07:50Z</dateTime> </apSaleReply> </replyMessage>