Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages

Help for owners

I need my app to take payments and the gateway is not connected

Short answer

Connecting a payment gateway means more than a pay button: the server must confirm each payment from the gateway's own events, handle failures, and keep card details out of your app. Open a test account, decide what is sold, and test with test cards before any real money moves.

  • Written for business owners
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Does this sound like your situation?

  • Customers pay but my system does not mark the order as paid.
  • I want to add Stripe, Paddle or another gateway to an existing app.
  • I am unsure what my app is allowed to store about cards.
  • Payments work in testing and fail live.
  • Refunds and failed payments are handled by hand.

Why does this happen?

  1. The result arrives later

    Many payment outcomes, such as a bank confirming a payment or a dispute, arrive after the customer has left. The gateway tells your server using webhook events, so the server must be ready to receive them.

  2. Events must be verified and fast

    Stripe's guidance is to verify that an event really came from Stripe and to return a success status quickly, before slow work such as updating your records.

  3. Events can repeat or arrive out of order

    Stripe says an endpoint may receive the same event more than once and that events can arrive in a different order from how they happened, so the handler must cope with both.

  4. Test and live are separate

    Stripe's test mode uses test keys and test cards and moves no money. It also says not to use real card details when testing, and that live keys must not sit in source code.

What can I do about it today?

  1. Create the gateway account in your company's nameUse a company email you control. Do the identity and bank steps yourself.
  2. Decide what you sellOne-off purchases, subscriptions, or both, and in which currencies. The gateway's choices depend on this.
  3. Ask for test mode firstEverything should be tried with the gateway's test cards. Never test with your own real card.
  4. Do not send card numbers to a developerA developer needs test keys only. Live keys are entered by you or kept in a secure place.
  5. Check refund and failure policyWrite down what happens when a payment fails or a customer asks for a refund.

When should I bring someone in?

  • Customers are paying and orders are not being confirmed.
  • You sell subscriptions or handle many payments.
  • You are unsure whether your setup meets the gateway's or a regulator's rules. Ask the gateway and a qualified adviser.

How do I handle it?

  1. Choose the integration styleI prefer the gateway's hosted payment pages where they fit, so card details never touch your server.
  2. Build the server sidePayment records and webhook handling are written so that repeats and late events are safe.
  3. Test every pathSuccess, failure, authentication, refund and duplicate events are tried in test mode.
  4. Go live carefullyLive keys are set up by you or stored securely, and the first real payment is watched.
  5. Add alertsA failed webhook or payment raises a message, so problems are seen early.

The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.

What do owners ask about this?

Which gateway should I use?

It depends on where you sell and what you sell. I explain the trade-offs from each gateway's own documentation.

Will my app store card numbers?

It should not. Hosted payment pages keep card details with the gateway.

Can you set it up without my keys?

Yes, I work with test keys. Live keys are your decision.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.

For your developer: the technical fixes

Next step

Want this off your desk?

Send me a few lines on where things stand. I reply within 24 hours.