Payments module initialisation
Initialise the SDK with your public API key to access individual payment method buttons.
Payments module initialisation creates a RevolutPaymentsModuleInstance with separate payment methods. Use this method when you need individual payment method buttons with granular control over UI placement and create orders on-demand during checkout.
Payment methods available:
| Payment method | Reference | Integration guide |
|---|---|---|
| Revolut Pay | SDK reference | Guide |
| Apple Pay / Google Pay | SDK reference | Guide |
| Pay by Bank | SDK reference | Guide |
Type signature
RevolutCheckout.payments(options: {
publicToken: string
mode?: 'prod' | 'sandbox'
locale?: Locale | 'auto'
}): Promise<RevolutPaymentsModuleInstance>
Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
publicToken | Your Merchant API public key | string | Yes |
mode | API environment. Default: 'prod' | 'prod' | 'sandbox' | No |
locale | Widget language. Default: 'auto' | Locale | 'auto' | No |
Tip
The mode parameter must match the environment used for your public API key. Production keys work only in 'prod' mode, and sandbox keys only in 'sandbox' mode.
Returns
Returns a Promise<RevolutPaymentsModuleInstance> with the following methods:
interface RevolutPaymentsModuleInstance {
revolutPay: PaymentsModuleRevolutPayInstance
paymentRequest: PaymentsModulePaymentRequest
payByBank: PaymentsModulePayByBank
setDefaultLocale: (locale: Locale) => void
destroy: () => void
}
revolutPay- Accept payments via Revolut PaypaymentRequest- Accept payments via Apple Pay and Google PaypayByBank- Accept payments via Pay by BanksetDefaultLocale- Change widget language dynamicallydestroy- Manually destroy the instance
Example
import RevolutCheckout from '@revolut/checkout'
const paymentsInstance = await RevolutCheckout.payments({
publicToken: 'pk_...',
mode: 'prod',
locale: 'auto'
})