Method to obtain other available payment methods
Purpose
Returns the list of Alternative Payment Methods (APMs) available for the current order/merchant context, including per-method capabilities when relevant (e.g., Apple Pay credential status).
Initialization
No explicit initialization is required. You only need an instance of the APM SDK; do not call init() just to query availability.
Method signature
const apmsWithCapabilities = await apmsSdk.getApmsAvailableByMerchant();
Response type (summary)
type ApmName = 'apple_pay' | 'google_pay' | 'paypal' | 'stripe_link';
type ApplePayPaymentCredentialStatus =
| 'paymentCredentialsAvailable'
| 'paymentCredentialStatusUnknown'
| 'paymentCredentialsUnavailable'
| 'applePayUnsupported';
type ApmAvailability = {
name: ApmName;
capabilities?: {
paymentCredentialStatus?: ApplePayPaymentCredentialStatus;
};
};
type GetApmsAvailableByMerchantResult = ApmAvailability[];
Success response example
[
{
"name": "apple_pay",
"capabilities": {
"paymentCredentialStatus": "paymentCredentialsAvailable"
}
},
{
"name": "google_pay"
},
{
"name": "paypal"
},
{
"name": "stripe_link"
}
]
Apple Pay capability mapping (UI guidance)
| Status | UI Guidance |
|---|---|
| paymentCredentialsAvailable | Show Apple Pay button and offer Apple Pay as the primary payment option. |
| paymentCredentialStatusUnknown | Show Apple Pay button and offer Apple Pay as a payment option. |
| paymentCredentialsUnavailable | Optional: consider showing Apple Pay button (user may still add credentials). |
| applePayUnsupported | Do not show Apple Pay button or offer Apple Pay. |
When to use each method
- getApmsAvailableByMerchant(): Check what APMs are available (and their capabilities) before rendering anything; no init() required.
- init([...]): Render and mount APM UI components to the page; use only when you want to display buttons or containers.
Backwards compatibility & migration notes
- The old shape
{ apms: [...] }is replaced by an array of objects as shown above; update any code relying on the previous property. - Remove any preparatory init() calls used only to perform the availability check; keep init() for UI rendering.