Charge Credit Cards in Sandbox
To charge a credit card use the Pay Advantage iframe for complete PCI compliance
The sandbox environment accepts a number of test credit cards which will return a specific result. Test cards will return a different result based on the card number being used. Each charge request will experience a random delay of anywhere between 1-4 seconds to simulate live processing times.
Card card using the Pay Advantage iframe
Pay Advantage provides an iframe for collecting credit card information and processing payment information. The iframe provides greater security with enhanced 3Dsecure verification and complete PCI-DSS compliance.
Refer to charging via the Pay Advantage iframe
Alternatively you are able to charge the API endpoint directly. However, processing credit card amount limits do apply using the direct API.
Charge card directly using the API endpoint
To charge a credit card use the https://api.test.payadvantage.com.au/v3/payment_authorizations endpoint. If the amount is provided as $0 the card will be tokenized and a customerPaymentAccount.code
is returned to be used for charging the card at a later date. If the amount is above $0 then a payment will be created for this credit card whilst still returning the customerPaymentAccount.code
.
When using the charge method, posting an ExternalID in the request body is a useful way to append an identifier from your system that can be used to query a charge at a later date.
Any valid card number not in the below list will return a successful response.
const options = {
method: 'POST',
headers: {accept: 'application/json', 'content-type': 'application/json'},
body: JSON.stringify({
customer: {code: 'ABC123'},
creditCard: {cardNumber: '4631770080000000', expiryMonth: 10, expiryYear: 2025},
onchargeFees: true,
amount: 10,
description: 'Golf Clubs',
externalID: 'PAYMENT001',
cvn: '000',
performCapture: true
})
};
fetch('https://api.test.payadvantage.com.au/v3/payment_authorizations', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Never store the Credit card or CVN. The CVN should always be set to null if the card is not present. Once the card has been processed by Pay Advantage the customerPaymentAccount.code
can be used for subsequent payments to the customers credit card.
Test Cards for Payments
An undetermined error occurs on the rare instance where we can not confirm if the issuing bank has properly received the request or if the charge has been approved or declined.
If an undetermined response is received you should NOT reattempt to charge the card until a valid determination is received by querying the response of the payment using the payment.code
from the response object.
The test system has been configured to update an undetermined response to a valid response after 5 minutes. Below is the method used to check the if the payment has been updated or resolved.
const options = {
method: 'GET',
headers: {accept: 'application/json', authorization: 'Bearer token'}
};
fetch('https://api.test.payadvantage.com.au/v3/payments/ABC123', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Test CVNs for Cards
Use below CVN to simulate:
Visa/Mastercard
000 - Matched
111 - Failed
222 - Unknown
Simulate Card Timeout
Use the amount of 60.00
without on-charging fees which will cause our API to not respond for 60 seconds.
Simulate Chargeback
Use the amount of 70.00
without on-charging fees to generate a full chargeback on the charge after 30 minutes.
Use the amount of 80.00
without on-charging fees to generate a partial chargeback of $70.00 on the charge after 30 minutes. Partial chargebacks occur when the customer has not reclaimed the full payment amount. This leaves you the option to refund the remaining balance if needed.
Updated 4 months ago