> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# PPP- (PayPal PLUS)

> Embed the PayPal PLUS payment wall in the template: set the container, retrieve the approval URL for the PayPal script, pass the return addresses, and evaluate the response.

PayPal PLUS does not show the buyer a single payment method, but a whole wall of them: PayPal itself, direct debit, credit card, and purchase on invoice, all provided by PayPal. PayPal loads this wall as a separate area into the shop's page.

The `PPP-` tags provide the building blocks for this. They output the container into which PayPal inserts its wall, retrieve the address the PayPal script works with, and pass the two addresses to which PayPal sends the buyer back.

Guide: PayPal PLUS

## Setting the container for the payment wall

`PPP-PayPalMethodsDivContainerID` outputs the identifier of the area into which PayPal loads its payment wall. You create the area, PayPal fills it.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<div id="~PPP-PayPalMethodsDivContainerID~"></div>
```

> [!WARNING]
>
> The container must have been output at least once before the buyer is redirected to PayPal. The shop system remembers this output. If you leave out the container, the process lacks a prerequisite.

> [!NOTE]
>
> Create the area empty and without a fixed height. The PayPal script inserts everything else.

## Showing and hiding the wall

Two range tags control where the wall appears.

| Tag | Applies |
| - | - |
| `PPP-ShowPayPalMethodsAtPayDeliv` | on the payment and shipping method page, if PayPal PLUS is available |
| `PPP-ShowPayPalMethodsAtPlaceOrder` | on the order overview, if PayPal PLUS was selected |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{PPP-ShowPayPalMethodsAtPayDeliv}
   <div id="~PPP-PayPalMethodsDivContainerID~"></div>
{/PPP-ShowPayPalMethodsAtPayDeliv}

{!PPP-ShowPayPalMethodsAtPayDeliv}
   <p>PayPal PLUS steht für diese Bestellung nicht zur Verfügung.</p>
{/!PPP-ShowPayPalMethodsAtPayDeliv}
```

> [!WARNING]
>
> `PPP-ShowPayPalMethodsAtPayDeliv` works exclusively on the payment and shipping method page `ws_pay_deliv.htm`. On the order overview, it is treated as an invalid tag. The previous documentation mentions both pages; this is not correct. `PPP-ShowPayPalMethodsAtPlaceOrder` is responsible for the order overview.

> [!NOTE]
>
> `PPP-ShowPayPalMethodsAtPlaceOrder` only exists as a positive range tag. It ensures that the wall also appears once during quick ordering, where the buyer skips the payment and shipping method page.

> [!NOTE]
>
> When evaluating `PPP-ShowPayPalMethodsAtPayDeliv`, the shop system triggers the check of the available payment methods if it has not yet run. The range tag therefore reliably tells you whether PayPal PLUS is eligible for this basket at all.

## The information for the PayPal script

PayPal's script needs two pieces of information from the shop.

| Tag | Returns |
| - | - |
| `PPP-ApprovalURL` | the address of the process created at PayPal |
| `PPP-CountryCode` | the two-letter country code from the billing address |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{PPP-ApprovalURL}
   <script>
      var ppp = PAYPAL.apps.PPP({
         approvalUrl: "~PPP-ApprovalURL~",
         placeholder: "~PPP-PayPalMethodsDivContainerID~",
         country: "~PPP-CountryCode~"
      });
   </script>
{/PPP-ApprovalURL}
```

> [!WARNING]
>
> `PPP-ApprovalURL` is not a passive value. When it is evaluated, the shop system creates the process at PayPal and, if necessary, calculates the basket totals beforehand. Therefore, only place the tag where the wall is actually supposed to appear, not as a precaution on every page.

> [!NOTE]
>
> Placing it several times on the same page is harmless. The shop system only queries PayPal once per page request.

> [!NOTE]
>
> `PPP-CountryCode` always returns a value. If no country code can be determined from the billing address, the tag outputs `DE`. The range tag therefore always applies, and a negative range for it is never displayed. The previous documentation shows exactly this as an example.

## The return addresses

After the process at PayPal, the buyer returns to one of the two addresses. The shop system provides both ready-made, and you pass both to PayPal.

| Tag | Is called |
| - | - |
| `PPP-WSReturnURL` | after a successful process |
| `PPP-WSCancelURL` | after a cancellation |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<input type="hidden" name="return_url" value="~PPP-WSReturnURL~">
<input type="hidden" name="cancel_url" value="~PPP-WSCancelURL~">
```

> [!NOTE]
>
> Both are exclusively single tags. As a range tag, they are treated as an invalid tag.

## Evaluating the response from PayPal

`PPP-ResponseJSONHexCoded` returns PayPal's complete response for the completed process, hex-encoded for passing to the JSON interface. Through it, you can access individual values, for example the payment method actually used by PayPal.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{PPP-ResponseJSONHexCoded}
   ~EJD-SetRawDataHexCodedInput(~PPP-ResponseJSONHexCoded~)~
{/PPP-ResponseJSONHexCoded}
```

> [!NOTE]
>
> The tag is available on the order confirmation and in the confirmation email. Before that, the response is not yet available.

Reference: EJD- (JSON interface)

## The tags at a glance

| Tag | Single tag | Range tag | Negative range tag | Loop tag |
| - | - | - | - | - |
| `PPP-PayPalMethodsDivContainerID` | yes | – | – | – |
| `PPP-ShowPayPalMethodsAtPayDeliv` | – | yes | yes | – |
| `PPP-ShowPayPalMethodsAtPlaceOrder` | – | yes | – | – |
| `PPP-ApprovalURL` | yes | yes | yes | – |
| `PPP-CountryCode` | yes | yes | yes | – |
| `PPP-WSReturnURL` | yes | – | – | – |
| `PPP-WSCancelURL` | yes | – | – | – |
| `PPP-ResponseJSONHexCoded` | yes | yes | yes | – |

`PPP-ShowPayPalMethodsAtPayDeliv` only applies on the payment and shipping method page, `PPP-ShowPayPalMethodsAtPlaceOrder` only on the order overview. `PPP-ResponseJSONHexCoded` belongs on the order confirmation and in the confirmation email. The two return addresses are permitted on all templates, the other tags on both pages of the payment process.

## Related topics

* Guide: PayPal PLUS
* Reference: PAY- (Displaying and selecting payment methods)
* Reference: PPC- (PayPal Checkout)
* Reference: EJD- (JSON interface)


## Related topics

- [payment - Payment methods](https://dokumentation.websale.de/en/konfiguration/payment-zahlungsmethoden.md)
- [Materials: PayPal country lists](https://dokumentation.websale.de/en/v8s/materialien/materialien-paypal-laenderlisten.md)
- [Payment methods](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/shopkonfiguration-shop-config/zahlungsarten.md)
- [PPC- (PayPal Checkout)](https://dokumentation.websale.de/en/v8s/referenz/tags/ppc-paypal-checkout.md)
- [$wsPayPalCheckout - PayPal](https://dokumentation.websale.de/en/frontend/referenz/module/wspaypalcheckout.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.