Skip to main content
Table of contents

Testing your integration

Testing your service

You can use your test account to:

  • explore how the GOV.UK Pay API works
  • run automated smoke tests

Do not use your test account for automated integration tests that run every time you change your code. Build a ‘stub’ to simulate the GOV.UK Pay API instead, using a tool like WireMock or mountebank.

Testing the whole user journey

You should test the whole user journey.

To help you test, you can:

You cannot use 3D Secure with test accounts.

Performance testing

You must contact us to get written approval before you do any performance testing.

Mock card numbers and email addresses

Use mock card numbers and email addresses with your test account when you try payments as a user.

Do not use real card numbers or fake email addresses with your test account.

You can enter any valid value for other payment fields. For example, the card expiry date can be any date in the future.

 Mock card numbers

Mock card numbers do not work with your live account.

Testing action Card number Card brand Card type
Successful payment 4444333322221111 Visa Credit
4242424242424242 Visa Credit
4000056655665556 Visa Debit
4988080000000000 Visa Debit - corporate
4000160000000004 Visa Debit - prepaid
4131840000000003 Visa Debit - corporate prepaid
4000620000000007 Visa Credit - corporate
4000000000000010 Visa Credit or debit
5101110000000004 Mastercard Credit
5105105105105100 Mastercard Debit
5200828282828210 Mastercard Debit
371449635398431 American Express Credit
3566002020360505 JCB Credit
6011000990139424 Discover Credit
36148900647913 Diners Club Credit
Card type not accepted 6759649826438453 Maestro Debit
Card declined 4000000000000002 Visa Credit or debit
Card expired 4000000000000069 Visa Credit or debit
Invalid CVC code 4000000000000127 Visa Credit or debit
General error 4000000000000119 Visa Credit or debit

 Mock email addresses

Use one of the following: