PayPal Plus was an integrated payment solution for online merchants that bundled PayPal, direct debit, credit card, and invoice payment into a single module. PayPal Plus has since been replaced by the new PayPal Checkout. The integration has therefore been removed from the current software generation.
Existing uses of $wsPayPalPlus must be removed from all templates. As long as these template snippets are still included, the templates can no longer be compiled and therefore can no longer be published. All affected places must therefore be removed without replacement.
Data overview
To view the available PayPal Plus data, you can have it output in a JSON-like format. This is helpful to understand the structure and contents of the PayPal Plus settings or to debug errors.
This is done as follows (commented out so that the output is not displayed directly in the frontend):
<!--
{{= $wsPayPalPlus |json }}
-->
The output in the browser’s developer console could then look like this:
{
"approvalUrl": "",
"available": false,
"cancelUrl": "https://www.beispiel-shop.de/?ppp_action=cancel&wsPayment=paypal-plus&wsvc=View&view=checkout.htm",
"response": null,
"returnUrl": "https://www.beispiel-shop.de/?ppp_action=return&wsPayment=paypal-plus&wsvc=View&view=checkout.htm",
"sandbox": true
}
Examples of using PayPal Plus data
Check whether PayPal Plus was selected as the payment method.
In this example, the available payment methods are iterated and the name of the active payment method is checked.
{{ foreach $payment in $wsConfig.payments }}
{{ if $payment.id == "paypalPlus" and $wsCheckout.selectedPayment == $payment.id }}
PayPal Plus is the selected payment method
{{ /if }}
{{ /foreach }}
Use PayPal Plus variables in the script
In this example, the variable $wsPayPalPlus.approvalUrl is included in the script.
{{ foreach $payment in $wsConfig.payments }}
{{ if $payment.id == "paypalPlus" and $wsCheckout.selectedPayment == $payment.id }}
<script id="executePppScript" type="application/javascript">
{{ autoescape "js" }}
var ppp = PAYPAL.apps.PPP({
"approvalUrl": "{{= $wsPayPalPlus.approvalUrl }}",
...
});
{{ /autoescape }}
</script>
<div id="paypalPlusContainer"></div>
{{ /if }}
{{ /foreach }}
Check whether PayPal Plus sandbox mode is enabled.
The script checks whether sandbox mode is active in the configuration for testing purposes.
{{ foreach $payment in $wsConfig.payments }}
{{ if $payment.id == "paypalPlus" and $wsCheckout.selectedPayment == $payment.id }}
<script id="executePppScript" type="application/javascript">
{{ autoescape "js" }}
var ppp = PAYPAL.apps.PPP({
...
{{ if $wsPayPalPlus.sandbox }}
"mode":"sandbox"
{{ /if }}
});
{{ /autoescape }}
</script>
<div id="paypalPlusContainer"></div>
{{ /if }}
{{ /foreach }}