Skip to content
RED SAGSkills
hardQA Engineer interview question

How would you test an integration with a third-party payment gateway that you do not control?

What the interviewer wants to hear

  • Use the provider sandbox and test cards
  • Test success, failure, timeout and pending states
  • Test webhooks and callbacks, including duplicates and out-of-order delivery
  • Use mocks or stubs to simulate rare errors
  • Reconciliation and idempotency checks
  • Monitoring after release

Model answer

I start with the provider's sandbox and documented test cards or UPI test handles to cover success, decline, insufficient funds and 3-D Secure or OTP flows. The tricky part is everything around the happy path. Payments can be pending, time out or succeed after our app gave up, so I test timeouts and what the user sees. Webhooks may arrive late, twice or out of order, so I replay them and check that order status is still correct and no double fulfilment happens. Since the sandbox cannot produce every error, I use a mock server, like WireMock, to simulate 500 errors, slow responses and malformed data. I check idempotency keys on retries, refunds and partial refunds, and that our records reconcile with the gateway's settlement report. Finally, I make sure there is monitoring in production for failure rates, because sandbox and live behaviour can differ.

Can you answer it under time pressure?

Take a timed hard round and get scored on every answer.

Start mock interview

More hard QA Engineer questions