Accepting Payments via the Checkout Plugin
Learn when and how to integrate an embedded payment checkout form using the Checkout Plugin
The Checkout Plugin provides a secure, PCI-compliant payment form that can be embedded directly into your application. It handles payment collection, customer enrollment, and Autopay setup while keeping sensitive payment data out of your application scope.
The Checkout Plugin is ideal for one-time payments, invoice payments, and Autopay enrollment. For recurring billing without customer interaction, see Creating Payment Intents or Billing Schedules.
Prerequisites
Before integrating the Checkout Plugin, it's helpful to learn about the following topics.
When to Use the Checkout Plugin
Use the Checkout Plugin when you need an embedded payment form inside your application that handles sensitive payment data in a PCI-compliant manner. The plugin provides a turnkey solution for payment acceptance without requiring you to build and maintain your own payment forms or handle card/bank account details directly.
Common use cases
- Invoice Payments: Allow customers to pay invoices directly from your application with an embedded checkout form.
- One-Time Purchases: Accept payments for products or services with a simple, secure checkout experience.
- Donation Forms: Accept variable amounts with an editable amount field, ideal for fundraising and tip jars.
- Custom Payment Flows: Embed checkout at specific points in your application flow rather than redirecting to external pages.
Usage
There are two steps to using the Checkout Plugin: creating an intent on your backend and rendering the plugin on the frontend.
The examples below show both steps in two different form factors.
This example shows the steps to setting up the plugin as a modal overlay and capturing the payment result.
- Create intent token with
type='checkout_plugin'and configure checkout options on the backend - Use the token to launch the
CheckoutPluginon the frontend - Use the
onSuccess(evt)listener to capture the transaction ID when payment completes - Use
onClose()to handle when the customer closes the checkout without completing payment
This pattern provides a focused checkout experience that overlays your application, guiding the customer through payment without navigation away from the current page.
This example shows the steps to setting up the plugin as an inline form embedded directly in your page.
- Create intent token with
type='checkout_plugin'and configure checkout options on the backend - Use the token to mount the inline form using
inline: trueand specify a container element - Use the
onSuccess(evt)listener to capture the transaction ID when payment completes
This pattern embeds the checkout form directly into your page layout, providing a seamless experience where the checkout is part of your application's natural flow rather than an overlay.
Configuring Checkout Options
The Checkout Plugin provides extensive configuration options to control payment methods, fees, billing fields, and UI behavior.
Payment Methods
Control which payment types are available to customers during checkout using the
allowed_methods configuration:
This configuration:
- Enables card payments (Visa, Mastercard, American Express, Discover)
- Disables bank account payments
- Enables Apple Pay for customers on Apple devices
- Enables Google Pay for customers on Android devices
Default Behavior: If you don't specify allowed_methods, the checkout will use your
processing account's default payment method settings. Use this configuration to override those
defaults for specific checkout flows.
Convenience Fees
Add a convenience fee to offset payment processing costs:
This example adds a 3% convenience fee to the total payment amount. The fee is calculated and displayed to the customer before they complete the payment.
Fee Disclosure: When using convenience fees, ensure you comply with card network rules and local regulations regarding fee disclosure. The Checkout Plugin automatically displays the fee amount to customers before payment.
Editable Amount
Allow customers to change the payment amount, useful for donations or tip jars:
This configuration:
- Displays the initial amount as $50
- Allows customers to change the amount to any value they choose
- Useful for donation forms, tips, or customer-determined payments
Autopay Enrollment
Enable the Autopay toggle to let customers enroll in automatic billing:
This configuration:
- Shows an Autopay enrollment checkbox in the checkout form
- Sets Autopay to enabled by default (customers can opt out)
- Automatically saves the payment method and links it to the customer account
- Sets the payment method as the default for future automatic payments
Account Required: Autopay enrollment requires either an existing account_id or that you
provide customer information (name, email) so a new account can be created automatically
when the payment is processed.
Billing Address Requirements
Control which billing address fields are required during checkout:
This configuration:
- Requires postal code for address verification
- Optionally collects full address (street, city, state)
- Use
required_fieldsto specify exactly which fields must be completed
Checkout for Existing Customers
If you already have a customer account, pass the account_id to pre-populate customer
information and link the payment:
This configuration:
- Links the payment to the existing customer account
- Automatically associates saved payment methods with the account
- Enables faster checkout for returning customers
- Allows the customer to use saved payment methods
Handling Checkout Results
The Checkout Plugin provides event listeners to track the checkout lifecycle and handle results.
Success Event
When a payment completes successfully, the onSuccess event fires with the transaction details:
checkout.on('success', (evt) => {
console.log('Payment successful!')
console.log('Transaction ID:', evt.transaction_id)
// Redirect to success page or show confirmation
window.location.href = `/payment/success?txn=${evt.transaction_id}`
})Error Event
If the payment fails or encounters an error, the onError event fires:
checkout.on('error', (evt) => {
console.error('Payment failed:', evt.message)
// Show error message to customer
alert(`Payment failed: ${evt.message}`)
// Optionally retry or redirect
})Close Event
When the customer closes the checkout without completing payment:
checkout.on('closed', (evt) => {
console.log('Customer closed checkout')
// Return to cart or previous page
window.location.href = '/cart'
})Transaction Status: After a successful payment, you can query the transaction using the
returned transaction.id to check its processing status, view full details, or track
settlement. See Transaction Status for details.
Schema Reference
The following fields are available when configuring the Checkout Plugin intent. For complete API reference documentation, see Intent API Reference.
Intent Configuration
Configuration options passed when creating the checkout intent on your backend:
checkout_plugincheckout_optionsallow_editable_amountallowed_methodsapple_payenabled, disabledbank_accountdefault, enabled, disabledcarddefault, enabled, disabled, credit, debitgoogle_payenabled, disabledplaidenabled, disabledenable_sender_feedefault, enabled, disabled, card, bank_accountrequire_full_billing_addressshow_autopay_toggleshow_disclosureshow_keep_active_toggleshow_payment_method_previewpayment_templateamountattrsclearing_timinginstant, same_day, next_daydescriptionfunding_timingstandard, instant, rapidinvoice_allocationsorder_numberreceiveraccount_idmethod_idsenderaccount_idmethodaccount_defaultsfundingall, deposits, withdrawspayingall, payments, payoutsaccount_holderaccount_idbank_accountcurrencyUSD, CADbilling_addressaddress_line_1address_line_2citycountry_codepostal_codestate_provinceidtransfer_typesend_only, receive_only, two_waysourcekeyed, googlepay, applepay, checkstatusvalueauthorized, processedtransfersNext Steps
Enhance your checkout implementation
Create Customer Accounts
Create customer accounts to enable saved payment methods and faster checkout.
Handle Refunds
Process refunds and voids for cancellations and returns after payments complete.
Monitor Payment Events
Subscribe to webhook notifications to track payment status and automate order fulfillment.
Related articles
- Intents API Reference
- Transactions API Reference
- Payment Methods API Reference
- Checkout Link - Alternative hosted checkout flow