Need help?

Seamless JS SDK

Mastercard JS API

The following API methods must be invoked during the checkout process. Refer to the Mastercard SDK documentation for full payload details and flow handling:

  • Init()
  • getCards()
  • idLookup()
  • initiateValidation()
  • validate()
  • checkoutWithCard()
  • signOut()

UI Suggestion

As you are not PCI DSS certified, please disable the Add Card option in the src-sdk UI by setting: display-add-card="false" while defining the custom element.

Display an information message to customers advising them to add or manage cards in their Click to Pay profile at www.src.mastercard.com/profile/ when no cards for listing, sample UI below:

Sample UI



Handle the checkoutWithCard response for checkoutActionCode: ADD_CARD the same way as above (redirect or message to manage cards externally).

Order API

Once checkoutWithCard is invoked

  • Check the value of checkoutActionCode.
  • If checkoutActionCode = COMPLETE, call the Order API with the clicktopay parameters.
"paymethod": "clicktopay",
"clicktopay": {
  "merchantTransactionId": "<merchant-transaction-id from C2P JS>",
  "correlationId": "<srcCorrelationId from C2P JS>",
  "flowId": "<x-src-cx-flow-id from C2P JS>"
}

Sandbox profile can be created at https://sandbox.src.mastercard.com/profile