$wsStripe module, you can retrieve payment information related to Stripe. It provides the configuration data for the Stripe.js integration as well as status information about the current payment process. In this section, you will learn how to initialize Stripe in the frontend and evaluate the payment status.
Module overview
Example / excerpt of$wsStripe
"ƒ()" denotes a function.
Variables and methods overview
| Name | Type | Description |
|---|---|---|
configuration | map | Map with Stripe configuration data. |
publishableKey | string | Public Stripe key for the integration in the frontend. |
targetAccount | string | Stripe Connected Account ID (for platform payments). |
paymentCanceled | bool | true if the payment was canceled. |
paymentFailed | bool | true if the payment failed. |
paymentPending | bool | true if the payment is still pending. |
createCustomerSession() | map | Creates a Stripe Customer Session for the currently logged-in customer. |
Templates
The$wsStripe module is typically used in the checkout area,in particular on the payment page. The configuration data is required to
initialize the Stripe.js object in the frontend.
Variables
$wsStripe.configuration
Returns the Stripe configuration data. Used to initialize the Stripe object in the frontend.$wsStripe.configuration.publishableKey
Returns the public Stripe key. This key is required to initialize Stripe.js in the browser and is safe to use in the frontend.$wsStripe.configuration.targetAccount
Returns the Stripe Connected Account ID. Only required for platform or marketplace payments, when payments are forwarded to a connected account.$wsStripe.paymentCanceled
Returnstrue if the payment was canceled.
$wsStripe.paymentFailed
Returnstrue if the payment failed.
$wsStripe.paymentPending
Returnstrue if the payment is still pending.
Methods
$wsStripe.createCustomerSession()
Creates a Stripe Customer Session for the currently logged-in customer. The session enables secure access to stored payment methods and customer data directly in the frontend. Signature$wsStripe.createCustomerSession()
Return valuemap - Customer Session object with the following attributes:
| Attribute | Type | Description |
|---|---|---|
| client_secret | string | Secret key for secure access to the customer. |
| components | object | Configuration for enabled Stripe components. |
| customer | string | ID of the customer for whom the session was created. |
| expires_at | timestamp | Time at which the session expires. |
Actions
No actions are available for$wsStripe.
