Skip to main content
Software Payments

Test the payment path without charging anyone

The payment code is the code you least want to try for the first time on a live phone. A fake provider that speaks the same states will catch the bugs that matter.

LesterTechLabs Engineering Estimated 2 min read

The payment code is the code you least want to try for the first time on a live phone. A fake provider that speaks the same states will catch the bugs that matter.

Same states, smaller money

The test double should return pending, paid, failed, and duplicate, because those are the branches the screen and the ledger use. A double that only returns success tests the decoration. Keep amounts in the smallest unit you store, and assert the invoice total rather than a string on the page.

The callback is a request

Post the callback payload at the real URL in the test client, including a duplicate delivery. The handler should mark one invoice paid and ignore the second. If the test only calls the service function, you will miss the authentication and the content type.

One live test, on purpose

Before launch, do one small live payment on a number you control and refund it or let it stand as a recorded test. Check the receipt, the portal status, and the email. Then turn the test keys off.

What to do this week

  1. Cover pending, paid, failed, and duplicate in tests.
  2. Hit the callback URL, not only the service.
  3. Run one small live payment and read the receipt.

On the site

Software

Have a system to build?

We design and ship custom software with a scope you can track, from the first request to handover.