Menu

Testing

This guide explains how to use our test environment.


Worldpay offers two environments, “live” and “test”. Live must be used for all real transactions and test is used for testing your implementation.

The live and test environments each has a different API key - you can find both keyshere. Both live and test APIs use the sameAPI endpointand both environments work in the same way, with one exception: in the test environment you can only use specific card numbers. You can find the full list of test card numbers below.

We run separate transaction reports for live and test traffic. You can see the required report by changing the live/test slider at the top of the dashboard. Test transactions will never move to SETTLED or CHARGED_BACK. See ourAPI Referencefor a full list of possible order states.

Test cards

Only the following credit / debit card numbers may be used for test payments in the test environment. When using test cards, you can specify an expiry date up to seven years in the future. The test cards do not have a card verification code or an issue number.

CardNumber
Mastercard Credit5555555555554444
Mastercard Debit5454545454545454
Maestro6759649826438453
Visa Credit4444333322221111, 4911830000000 and 4917610000000000
Visa Debit4462030000000000
American Express343434343434343

Simulate success and error flows

You can simulate different outcomes when submitting orders by entering the following values as the cardholder name:

ValueDescription
SUCCESSSimulation of a successful payment
FAILEDSimulation of a unsuccessful payment
ERRORSimulation of an error
Visa Credit4444333322221111, 4911830000000 and 4917610000000000
Visa Debit4462030000000000
American Express343434343434343

Additionally, you can simulate payments which have failed due torisk settingsissues:

TypeDescription
Failed due to Address VerificationSet Address Verification to on in the Risk page and in your order set postalCode to JJJJ. For a successful payment with Address Verification set to on the billing address must be specified with values populated in all of address1, postalCode, city and countryCode
Failed due to Card Security CodeSet Card Security Code check to on in the Risk page and provide 000 as the Card Security Code. For a successful payment with Card Security Code check to on you can provide any other value for the Card Security Code

Testing 3DS

3DS orders can be tested using the test card numbers above, while setting is3DSOrder to true, and name to 3D

See the3D Securepage to review the 3D Secure order process.

The following values for the threeDSResponseCode can be provided during testing:

threeDSResponseCodeSituation being simulatedResulting paymentStatus
IDENTIFIEDCardholder authenticated successfully, proceed with normal order processingSUCCESS or AUTHORIZED
IDENTIFIED_NOIDCardholder authenticated successfully and XID was not received, proceed with normal order processingSUCCESS or AUTHORIZED
NOT_IDENTIFIEDIssuing bank decided no 3DS authentication was required, proceed with normal order processingSUCCESS or AUTHORIZED
NOT_IDENTIFIED_NOIDIssuing bank decided no 3DS authentication was required and XID was not received, proceed with normal order processingSUCCESS or AUTHORIZED
UNKNOWN_IDENTITYCardholder failed authentication. The order does not proceed to authorization.FAILED
CANCELLED_BY_SHOPPERCardholder failed authentication. The order does not proceed to authorization.FAILED
ERRORResponse failed validation checks. The order does not proceed to authorization.FAILED
3DS_VALID_ERROR_CODEAuthentication unavailable. The order does not proceed to authorization.FAILED
3DS_INVALID_ERROR_CODEResponse failed validation checks. The order does not proceed to authorization.FAILED

Testing Hosted Payment Pages

We'd recommend you test your Hosted Payment Pages setup before customers start submitting transactions. Use the test card numbers above and enter these magic values on the payment page:

ScenarioMagic valueOutcome
Authorisation - Success without 3D SecureCardholder Name = AUTHORISEDWorldpay will simulate an AUTHORISED response. In this scenario, advise the shopper their transaction was processed successfully and proceed with any post-processing activities. Note that the Cardholder name is no an element in Hosted, rather it's just a term on the payment page where the response is displayed
Authorisation - FailureCardholder Name = REFUSEDWorldpay will simulate a REFUSED response. In this scenario, advise the shopper that their transaction was declined and that they should check their payment details, try again, or use an alternative payment to complete the transaction
Authorisation - ErrorCardholder Name = ERRORWorldpay will simulate an ERROR response. In this scenario, advise the shopper that an error occured processing their transcation, that no funds have been debited, and that they should try again