Web: ProcessOut.js
Integrate and customize Dynamic Checkout using our client-side Javascript SDK
ProcessOut.js enables the integration of Dynamic Checkout on Web, by importing our SDK hosted on our CDN. After creating your Dynamic Checkout configuration using our Dashboard or API you can enable the end-to-end Dynamic Checkout payment flow by importing the script on your website.
To set up the Dynamic Checkout Web SDK you will need to retrieve these parameters from your application’s backend:
- Project ID
- Invoice ID
- Client secret (optional). The client secret is not required if you do not want to let users save and re-use payment methods.
Setup
To be able to use the Dynamic Checkout utilities from our Web SDK, you need to attach the ProcessOut.js script to your HTML file and create a HTML element that will act as the mounting point for Dynamic Checkout:
<div id="dynamic-checkout-container"></div>
<script src="https://js.processout.com/processout.js"></script>After linking the script your code will have access to the global ProcessOut instance. This will help you to set up ProcessOut Client using the invoice ID, project ID, and optionally the client secret:
const client = new ProcessOut.ProcessOut('{projectId}');
const dynamicCheckout = client.setupDynamicCheckout({
invoiceId: '{invoiceId}',
clientSecret: '{clientSecret}' // Optional.
});
dynamicCheckout.mount("#dynamic-checkout-container");After that you should see the Dynamic Checkout widget displayed on your website:

Simple Dynamic Checkout implementation
Additional data
Use additionalData to pass gateway-specific parameters to Dynamic Checkout. These values are attached to the redirection URL as additional_data[...] query parameters, allowing you to provide extra information required by a given payment method.
const dynamicCheckout = client.setupDynamicCheckout({
invoiceId: '{invoiceId}',
additionalData: {
'paypal-rest': {
issuer_id: "1234",
},
everypay: {
customer_email: "[email protected]"
}
},
});Event System
Dynamic Checkout dispatches browser events on every important step of the payment. This enables you to react on them however you like. To react to events, you need to add event listeners. For example:
window.addEventListener("processout_dynamic_checkout_payment_success", function (event) {
console.log(event.detail);
});Event reference
| Event name | When it fires |
|---|---|
processout_dynamic_checkout_loading | Widget starts fetching invoice details |
processout_dynamic_checkout_ready | Payment methods rendered; widget is interactive |
processout_dynamic_checkout_invoice_fetching_error | Invoice fetch fails |
processout_dynamic_checkout_no_dynamic_checkout_configuration | Invoice has no payment_methods configured |
processout_dynamic_checkout_payment_submitted | Shopper clicks the pay button |
processout_dynamic_checkout_payment_pending | Payment awaits asynchronous completion (e.g. bank redirect) |
processout_dynamic_checkout_payment_success | Payment completes successfully |
processout_dynamic_checkout_payment_error | Payment fails at any stage |
processout_dynamic_checkout_payment_cancelled | Shopper cancels the payment (e.g. closes redirect popup) |
processout_dynamic_checkout_google_pay_load_error | Google Pay SDK fails to initialize |
processout_dynamic_checkout_apple_pay_new_session | Apple Pay session is created |
processout_dynamic_checkout_apple_pay_session_error | Apple Pay session creation fails |
processout_dynamic_checkout_apple_pay_authorized_post_process | Apple Pay post-authorization processing starts |
processout_dynamic_checkout_delete_payment_method_success | Saved payment method deleted successfully |
processout_dynamic_checkout_delete_payment_method_error | Saved payment method deletion fails |
Event payloads
All events include a common set of fields. Additional fields are listed per event.
Common fields (present in every event)
| Field | Type | Description |
|---|---|---|
invoice_id | string | ID of the invoice being paid |
payment_method_name | string | null | Technical identifier of the payment method (e.g. "card", "apple_pay", "google_pay", or the APM gateway name). null for lifecycle events not tied to a specific method. |
payment_method_display_name | string | null | Human-readable name of the payment method (e.g. "Apple Pay", "Visa"). null for lifecycle events not tied to a specific method. |
return_url | string | null | The invoice's return_url, or null if not set. |
processout_dynamic_checkout_loading
processout_dynamic_checkout_loadingFired when the widget starts fetching invoice details. payment_method_name and payment_method_display_name are always null.
No additional fields.
processout_dynamic_checkout_ready
processout_dynamic_checkout_readyFired when payment methods have been rendered and the widget is ready for interaction. payment_method_name and payment_method_display_name are always null.
No additional fields.
processout_dynamic_checkout_invoice_fetching_error
processout_dynamic_checkout_invoice_fetching_errorFired when the invoice cannot be fetched.
| Field | Type | Description |
|---|---|---|
error_type | string | null | Error code or type string |
error_message | string | null | Human-readable error description |
processout_dynamic_checkout_no_dynamic_checkout_configuration
processout_dynamic_checkout_no_dynamic_checkout_configurationFired when the fetched invoice has no payment_methods configured.
No additional fields beyond common fields.
processout_dynamic_checkout_payment_submitted
processout_dynamic_checkout_payment_submittedFired immediately when the shopper clicks the pay button, before any network request.
| Field | Type | Description |
|---|---|---|
customer_token_id | string (optional) | Present when the shopper is paying with a saved payment method |
processout_dynamic_checkout_payment_success
processout_dynamic_checkout_payment_successFired when the payment completes successfully.
| Field | Type | Description |
|---|---|---|
card_id | string (optional) | Tokenized card ID; present for card payments |
customer_token_id | string (optional) | Customer token created or used during this payment |
authorized | boolean (optional) | true if the transaction was authorized (funds reserved) |
captured | boolean (optional) | true if the transaction was captured (funds settled) |
processout_dynamic_checkout_payment_error
processout_dynamic_checkout_payment_errorFired when the payment fails at any stage.
| Field | Type | Description |
|---|---|---|
error_type | string | null | Error code (e.g. "card.declined", "transaction.invalid-status") |
error_message | string | null | Human-readable error description |
card_id | string (optional) | Tokenized card ID if tokenization succeeded before the failure |
customer_token_id | string (optional) | Customer token if one exists for this attempt |
transaction_status | string (optional) | Transaction status at time of failure (e.g. "failed", "voided") |
authorized | boolean (optional) | true if the transaction reached an authorized state before failing |
captured | boolean (optional) | true if the transaction reached a captured state before failing |
processout_dynamic_checkout_payment_cancelled
processout_dynamic_checkout_payment_cancelledFired when the shopper cancels the payment flow (e.g. closes the APM redirect popup).
| Field | Type | Description |
|---|---|---|
tab_closed | boolean (optional) | true if the shopper dismissed the payment by closing the redirect tab or popup |
processout_dynamic_checkout_payment_pending
processout_dynamic_checkout_payment_pendingFired when the payment is submitted but awaits asynchronous confirmation (e.g. bank redirect, push notification).
| Field | Type | Description |
|---|---|---|
card_id | string (optional) | Tokenized card ID; present for card payments |
customer_token_id | string (optional) | Customer token created or used during this payment |
authorized | boolean (optional) | true if the transaction was authorized at the time of the pending state |
captured | boolean (optional) | true if the transaction was captured at the time of the pending state |
processout_dynamic_checkout_google_pay_load_error
processout_dynamic_checkout_google_pay_load_errorFired when the Google Pay SDK fails to initialize or when isReadyToPay rejects. payment_method_name is always "google_pay".
| Field | Type | Description |
|---|---|---|
error_type | string | null | Error code from the Google Pay SDK |
error_message | string | null | Error description |
processout_dynamic_checkout_apple_pay_new_session
processout_dynamic_checkout_apple_pay_new_sessionFired when an Apple Pay session is successfully created. payment_method_name is always "apple_pay".
No additional fields beyond common fields.
processout_dynamic_checkout_apple_pay_session_error
processout_dynamic_checkout_apple_pay_session_errorFired when Apple Pay session creation fails. payment_method_name is always "apple_pay".
| Field | Type | Description |
|---|---|---|
error_type | string | null | Error code from the Apple Pay SDK |
error_message | string | null | Error description |
processout_dynamic_checkout_apple_pay_authorized_post_process
processout_dynamic_checkout_apple_pay_authorized_post_processFired after the shopper authorizes the Apple Pay payment but before the SDK calls session.completePayment. Use this to show an intermediate loading state. payment_method_name is always "apple_pay".
No additional fields beyond common fields.
processout_dynamic_checkout_delete_payment_method_success
processout_dynamic_checkout_delete_payment_method_successFired when a saved payment method is successfully deleted by the shopper.
No additional fields beyond common fields.
processout_dynamic_checkout_delete_payment_method_error
processout_dynamic_checkout_delete_payment_method_errorFired when a saved payment method deletion fails.
| Field | Type | Description |
|---|---|---|
error_type | string | null | Error code |
error_message | string | null | Error description |
Localization
You can localize all of the text displayed in Dynamic Checkout widget by passing the locale property when setting up Dynamic Checkout:
const dynamicCheckout = client.setupDynamicCheckout({
invoiceId: '{invoiceId}',
clientSecret: '{clientSecret}',
locale: 'pl'
});The currently supported locales are de, en, es, fr, it, ja, ko, pl and pt. Please get in touch with your ProcessOut account manager to request support for new locales.
Customization
You can configure some behavioural aspects and the theme of the widget by passing additional arguments when setting up Dynamic Checkout:
const config = {
invoiceId: '{invoiceId}',
clientSecret: '{clientSecret}',
payButtonText: "Pay now",
// ...
};
const theme = {
payButtonColor: "red",
payButtonTextColor: "white"
};
const dynamicCheckout = client.setupDynamicCheckout(config, theme);Supported configuration properties:
| Property | Description | Data type |
|---|---|---|
payButtonText | Change the payment method's pay button text | Text |
enforceSavePaymentMethod | Enforces saving a payment method when client secret is provided | Boolean (true/false) |
hideSavedPaymentMethods | Hides the customer's saved payment methods section | Boolean (true/false) |
cvcLabel , cvcPlaceholder | Change the label and placeholder of the CVC input field | Text |
Supported theme properties:
| Property | Description | Format |
|---|---|---|
payButtonColor | Background color of the submit button | CSS color |
payButtonTextColor | Text color of the submit button | CSS color |
Updated 2 days ago
After the payment is successfully authorized you can proceed to capture the payment on your server.
