Skip to main content
Step 4 of 7. When the first payment succeeds, Nomba sends you the card token in a payment_success webhook. Save it so you can charge the card later.

payment_success webhook

Nomba sends the webhook to your webhook URL. The card token is in data.tokenizedCardData. For the full payload, see Webhooks.
Check the webhook signature before you trust the payload. See Webhooks.

Webhook body

string
required
payment_success
object
The saved card
object
required
The order the customer paid
If the webhook has no tokenizedCardData, or tokenKey is "N/A", the card token wasn’t ready when Nomba sent the webhook. This can happen when the bank approves the payment without an OTP, because Nomba saves the card in the background. Wait a few seconds, then list the customer’s saved cards by email.

Store the token

Save these details with the customer’s record in your database: A token works only with the email address it was saved with. If you charge it with a different customerEmail, Nomba rejects the charge with β€œEmail address doesn’t match token key”. If the customer changes their email in your app, change the email on the saved card too.

Avoid duplicate cards

If the customer saves the same card again with the same email, Nomba returns the same tokenKey as before. Check whether you already have that tokenKey for the customer before you add a new record. If the customer saves the same card with a different email, Nomba creates a new token.

Show the saved card to the customer

When a customer pays again, show them which card you’ll charge, for example Visa ending 1119. Let them choose a different saved card, or add a new one with a new card-saving payment.

Keep the token safe

Store tokenKey on your server only. Don’t send it to the browser or your mobile app, and don’t log it in plain text.

Next: Charge a saved card

Use the token to charge the customer when a payment is due.