Skip to main content

Card Payments

Take Visa and Mastercard payments with 3D Secure through NMB Bank's Mastercard gateway. The card is typed into gateway-hosted fields and never reaches your servers or Malipopay's. Create the payment with your apiToken, then let the hosted checkout, the embeddable card element or your own client run the session. On UAT the test gateway takes test cards and moves no money; on production every card payment is a real charge.

๐Ÿ“„๏ธCreate a card payment

Creates a card collection and returns its reference, for the embeddable card element, the hosted checkout link or your own client. Server side only, with your `apiToken` (the dashboard uses a `project` header plus a signed-in member's Bearer JWT; a bare `project` header is refused). Your project's limits apply as for any collection; the test-recipient whitelist does not, because a card payment has no phone number. Never send card numbers to Malipopay: `POST /api/v1/payment` refuses card fields with `CARD_DETAILS_NOT_ACCEPTED`.

๐Ÿ“„๏ธCapture a card payment

Reads the attempt's authentication result from the gateway, decides, and issues the PAY. Called by the page when 3D Secure is not offered, and as a safety net after a challenge. Idempotent: a capture already credited answers alreadyPaid, and a second call while one is in flight answers PENDING. If the gateway does not answer the PAY, it answers PENDING with gatewayCode `UNCONFIRMED`: poll `GET /api/v1/payment/verify/{reference}`, which asks the gateway and settles it, and never start another attempt meanwhile. Always HTTP 200; branch on data.status.