Create a Saved Payment Method Record from a Client-Side Component
Buyers can save their payment details directly from a buyer-facing client-side component. The client-side component calls a third-party payment gateway to tokenize the buyer’s payment method. It then sends the token and related metadata to Salesforce by using the SavedPaymentMethod sObject API. Salesforce creates the Saved Payment Method (SPM) record.
This flow supports only third-party payment gateways and these payment methods categories:
- Alternative Payment Methods (APMs)
- Digital Wallets (such as Amazon Pay)
- Credit Cards
Before you begin, make sure your configuration meets these requirements.
- Payment gateway tokenization is configured. Your storefront or third-party gateway must tokenize the buyer’s payment details before sending any information to Salesforce.
- Buyer is authenticated and has access to the SavedPaymentMethod sObject API.
- Supported payment types—APMs, Digital Wallets, and Credit Cards—are configured in your Payments setup.
- Required fields such as paymentMethodType and payment token are available in your client-side component.
- HTTPS securely transmits all tokenized data.
- Buyer enters their payment details in your storefront component.
- Client-side component calls the third-party payment gateway to tokenize the payment method.
- The gateway returns a payment token.
- Client-side component sends the token and related payment metadata to the SavedPaymentMethod sObject API. Submit this information using one of the following ways:
- Salesforce validates the request and creates the SPM record, including data such as:
- Last four digits, expiration date, and name on card
- Gateway token
- The SPM record becomes available for future use by the Billing Engine.
See Also