This flow spans both the server-side (calling the Generate / Inquiry / Remove APIs) and the frontend (submitting card information via
@waffo/payment-sdk).Core flow
Card binding flow
1
Merchant backend calls the Generate API
Call POST /api/v1/tokenization/generate, passing parameters such as
tokenRequestId, merchantUserId, and tokenType: "CARD". On success, it returns tokenSessionId.2
Frontend submits card information
Use the The merchant frontend passes plaintext card data to the SDK, which encrypts the data before transmission. With the frontend SDK binding flow, the merchant does not need PCI DSS certification as long as its backend neither retains nor transmits plaintext card data.
tokenizationSubmit method of @waffo/payment-sdk to encrypt the card data and submit it to the Waffo server:3
Handle the card binding result
notifyUrl, Waffo sends TOKENIZATION_NOTIFICATION when card binding completes, the Token status changes, or the card summary is updated. Process notifications idempotently using result.tokenId, and store the latest tokenStatus and Token data. The notification is not limited to the initial binding result.Token status
After card binding succeeds, the Token starts inUNVERIFIED. You must complete a successful CIT (cardholder-initiated transaction) before its status changes to VERIFIED. The verification transaction can be a separate ONE_TIME_PAYMENT for 0 or 0.01, or a normal CIT payment.
UNVERIFIED: The Token exists but has not completed a successful CIT. You cannot use it for scheduled or unscheduled MIT; Waffo returnsA0045.VERIFIED: The Token has completed a successful CIT and can be used for subsequent payments.EXPIRED: The Token status becomesEXPIREDwhen the card reaches its expiry date.SUSPENDED: Waffo has suspended use of the Token. The public contract does not define the exact trigger conditions.
Pay with a token
After obtainingtokenId, pass it as paymentInfo.userPaymentAccessToken when creating an order to replace the card number:
tokenId only with Waffo’s ONE_TIME_PAYMENT product. Do not pass it to Waffo’s SUBSCRIPTION product.
If you manage your own recurring billing schedule, you can repeatedly create ONE_TIME_PAYMENT orders after the Token becomes VERIFIED. MIT orders must also set paymentInfo.merchantInitiatedMode.
Token API usage
Security mechanisms
- The merchant frontend passes plaintext card data to the SDK, which encrypts it before transmission; the merchant backend does not handle the plaintext card number
- All API requests and responses use SHA256WithRSA signature verification
- Supports 3DS verification to enhance payment security