Implement a Save to Pay integration

To implement Save to Pay on your website:

  1. After the customer has selected the card to add to Samsung Wallet on your website, create a registration session using the POST /registrations REST API operation.

    Save to Pay returns a registration session ID and the welcome UI's URL in the response.

  2. Store the registration session ID for later use.

  3. Include the Save to Pay JavaScript library for your website:

    <script src="https://spay.samsung.com/s2p/libs/js/0.0.4/s2p.min.js"></script>
    
  4. Display the welcome UI with the showWelcomeModal() or showWelcomeModalPromise() JavaScript method.

    The welcome UI's URL has an expiration time. If you are unsure whether the URL is still valid, use the GET /registrations/{regId} REST API operation to retrieve a valid URL.

  5. Wait while the customer scans the QR code on the welcome page.

    When the Save to Pay process has started and Samsung Wallet is ready to proceed, Save to Pay sends you a WA_READY notification using the POST /notifications REST API operation.

  6. Contact the card issuer to pre-provision the card and receive the provisioning data.

  7. Send the provisioning data (encrypted card information) in your response to the POST /notifications REST API operation.

  8. Wait while the provisioning is completed within the payment system.

    When the provisioning process is completed, Save to Pay sends you a WA_PROVISIONED or WA_PROVISION_FAILURE notification using the POST /notifications REST API operation. There is no need to respond to that notification.

    The welcome UI automatically redirects the customer when the process completes. If you need to close the welcome UI on purpose for any reason, use the closeWelcomeModal() JavaScript method.