Overview

Card transaction functionalities allow the customer to pay for their in-app purchases with Samsung Pay. The payment data is handled between Samsung Pay, your app, and your payment gateway (PG) as direct network tokens or indirect gateway tokens.

To manage a card transaction for an in-app payment:

  1. Check the eligibility of the customer's cards to ensure that you support payments with at least one card in the customer's Samsung Wallet.

    If not, hide the Samsung Pay button and let the customer use other payment methods.

  2. Create a custom payment sheet for a transaction request.

  3. Request payment from the customer.

  4. Process the payment data.

The following figure illustrates the card transaction flow that involves a series of operations that ensure secure, seamless, and verified payment processing between your app, Samsung Pay, and PG.

Card transaction flow

  1. To determine whether you can display the Samsung Pay button, check the Samsung Pay status on the customer's device and confirm that you support payments with at least one card in the customer's Samsung Wallet.

  2. When the customer clicks the Samsung Pay button, start the payment process with the startInAppPayWithCustomSheet() method.

    A binding is established between your app and the Samsung Wallet app, your app is verified, and the custom payment sheet is displayed to the customer.

  3. The onCardInfoUpdated() event notifies you of the card the customer has selected. Use the updateSheet() method to update the payment amount based on the card, as necessary, and display the updated custom sheet to the customer.

  4. The updateSheet() method's onResult() event notifies you of the billing and shipping addresses the customer wants to use. Use the updateSheet() method to update the payment amount based on the shipping costs, as necessary, and display the updated custom sheet to the customer.

  5. The customer sheet allows the customer to be authenticated in the Samsung Wallet app using biometrics or other secure methods supported by the app, and the startInAppPayWithCustomSheet() method's onSuccess() event notifies you of the successful authentication and provides the tokenized payment data.

  6. Submit the payment data to your PG for transaction processing.

  7. Receive confirmation of the transaction success or failure from the PG. Display the result to the customer and update your app backend accordingly.