Skip to main content
With the $wsPayPalCheckout module, you can use PayPal payment data dynamically in the frontend. It supports various payment methods such as PayPal Express Checkout, Google Pay, and Apple Pay. This section explains how to query the payment status and how to use the payment data for the integration.

Module overview

Example / excerpt of $wsPayPalCheckout
JSON output
Note: ƒ() denotes a function. Variables and methods at a glance

Templates

The $wsPayPalCheckout module is typically used in the checkout area, in particular on the payment page and the order confirmation. The PayPal buttons can also be embedded on product pages or in the basket for express checkout.

Variables

$wsPayPalCheckout.integrationDate

Returns the integration date of the PayPal connection.

$wsPayPalCheckout.status

Returns the status of the PayPal payment (empty if no payment process is active).

$wsPayPalCheckout.paymentCanceled

Returns true if the customer canceled the payment.

$wsPayPalCheckout.paymentFailed

Returns true if a technical error occurred during the payment.

$wsPayPalCheckout.paymentDeclined

Returns true if the payment was declined by PayPal or the bank.

$wsPayPalCheckout.expressCheckout

Indicates whether PayPal Express Checkout is possible (expressCheckoutAllow active and order value greater than 0).

$wsPayPalCheckout.expressCheckoutGooglePay

Indicates whether Google Pay Express is possible (expressCheckoutGooglePayAllow active and order value greater than 0).

$wsPayPalCheckout.expressCheckoutApplePay

Indicates whether Apple Pay Express is possible (expressCheckoutApplePayAllow active and order value greater than 0).

$wsPayPalCheckout.googlePay

Returns a map with Google Pay-specific content.

$wsPayPalCheckout.applePay

Returns a map with Apple Pay-specific data.

$wsPayPalCheckout.clientMetadataId

Returns the client metadata ID for the PayPal SDK integration (e.g. for the data-client-metadata-id attribute when embedding the SDK script). The value corresponds to the first 32 characters of the session ID.

Methods

$wsPayPalCheckout.loadData()

Loads the payment data for the PayPal Checkout integration (SDK parameters, URLs, order ID). Returns null when no PayPal payment process is currently active — i.e. no PayPal Checkout payment method is selected or available. Signature
$wsPayPalCheckout.loadData(expressCheckout)
Return value
Map — map with payment data or null.
Parameters Example that loads the payment data.
Example for Express Checkout (e.g. in the basket, before a payment method has been selected):
When you use the $wsPayPalCheckout.loadData() function, various variables become available to retrieve and output payment data. Below is an overview of the available variables.

Payment data (return value of $wsPayPalCheckout.loadData())

First, the map with the payment data — as shown in the example above — has to be assigned to a local variable. It can then be used at various places in the template. JSON output of the variables
Variables at a glance
googlePay and applePay are not part of the loadData() return value. These maps are available directly on the module: $wsPayPalCheckout.googlePay and $wsPayPalCheckout.applePay.

Actions

The PayPal Checkout plugin registers five actions. They are intended for the JavaScript integration of the PayPal SDK callbacks: they are invoked via POST (create the action as usual with $wsActions.create(...) and send wsact/wscsrf along) and — unlike classic form actions — respond directly with JSON.
The error texts of these actions (e.g. requestEmpty for an empty payload) are controlled via the configuration nodes actions.updateApplePay and actions.updateGooglePay.