Payment Methods represent the various ways customers can pay for goods and services, such as credit cards, debit cards, and bank accounts. In the Stax Core Data API, payment methods are securely stored and tokenized to facilitate transactions without exposing sensitive financial information.
Managing payment methods effectively allows merchants to provide a seamless and secure payment experience for their customers.
Key Concepts and Features
Creating Payment Methods
Payment methods can be created by tokenizing sensitive payment information, either via client-side libraries like Stax.js or server-side API calls. Tokenization replaces sensitive data with a unique identifier (token) that can be used for future transactions without exposing the actual payment details.
Important Note: For PCI compliance and security, it is strongly recommended to use client-side tokenization methods like Stax.js when handling credit card information.
Test Cards and Bank Accounts
When working in a sandbox environment or testing your integration, you can use specific test card numbers and bank account numbers to simulate successful or failed transactions.
Import Credit Cards
If you need to import tokenized credit cards from your current processor into Stax, please contact your Account Manager or Partner Success Manager for assistance.
Get All Payment Methods for a Merchant
Retrieve all non-deleted payment methods associated with a merchant account. This allows merchants to manage and review all stored payment methods used by their customers.
Get All Payment Methods for a Customer
Retrieve all non-deleted payment methods associated with a specific customer. This is useful for displaying saved payment options to the customer or managing their payment methods.
Get a Payment Method by ID
Retrieve detailed information about a specific payment method using its unique ID. This includes card brand, last four digits, expiration date, and metadata.
Cards
- Debit or Credit Indicator: The
bin_type
parameter indicates if the card is "DEBIT" or "CREDIT". - Prepaid Card Check: The
meta.prepaid
boolean indicates if the card is a prepaid debit or gift card.
Update a Payment Method
Modify details of an existing payment method, such as updating the expiration date or metadata.
Delete a Payment Method
Soft-delete a payment method, making it inaccessible for future transactions. The payment method is not permanently deleted but is marked as deleted.
Share a Payment Method with a Third Party
Enable merchants to copy an existing Stax payment method to an external gateway without re-entering card details. This is useful when integrating with third-party services that require access to the payment method.
Important Note: Requires a gateway_token. Contact your Partner Success representative for details.
Review a Transaction's Surcharge Information
Calculate surcharge information based on a given payment_method_id and transaction amount. Useful for informing customers of any additional fees associated with using certain payment methods.
Surcharge Calculation: Only applicable to credit cards and when the merchant has surcharging enabled.
Surcharge Details: Provides the surcharge rate and amount.