HomeChallengesRepsProblemsLeaderboardTake a challenge

The reference you were handed

The browser says the customer paid ₦150,000. Find out whether they did.

Intermediate20 min on the clock7 graded checks · 100 pointsAPI Integration Sprint
Graded by running your code against real cases.

What you build

  • Ask Paystack about the reference instead of trusting the caller
  • Reject anything that is not a successful transaction
  • Check the amount paid against the amount owed
  • Check the currency
  • Check the reference belongs to this order
  • Make a second call fulfil nothing

Done means

A successful transaction for the wrong amount, the wrong currency, or another order is rejected, and fulfilment happens once.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else. Each one runs your code; it is not a search for keywords.

  1. It asks Paystack rather than trusting the caller+15Authentication and tokens
  2. A real payment is accepted and fulfilled+15Authentication and tokens
  3. An underpaid transaction is rejected+25Authentication and tokens
  4. The wrong currency is rejected+10Authentication and tokens
  5. A successful reference from another order is rejected+15Authentication and tokens
  6. Failed and abandoned transactions are rejected+10Error handling
  7. Calling it twice fulfils once+10Safe to repeat

What it teaches

Safe to repeatintermediate

A request that times out has not necessarily failed — you just did not hear back — so the client retries, and unless the write recognises that it has already happened the customer is charged twice.

The rest of API Integration Sprint