$wsPayPalCheckout
Mit dem $wsPayPalCheckout Modul können Sie PayPal-Zahlungsdaten dynamisch im Frontend verwenden. Es unterstützt verschiedene Zahlungsmethoden wie PayPal Express Checkout, Google Pay und Apple Pay. In diesem Abschnitt erfahren Sie, wie Sie den Zahlungsstatus abfragen und die Payment-Daten für die Integration nutzen können.
Inhaltsverzeichnis
- 1 Modulübersicht
- 2 Templates
- 3 Variablen
- 3.1 $wsPayPalCheckout.integrationDate
- 3.2 $wsPayPalCheckout.status
- 3.3 $wsPayPalCheckout.paymentCanceled
- 3.4 $wsPayPalCheckout.paymentFailed
- 3.5 $wsPayPalCheckout.paymentDeclined
- 3.6 $wsPayPalCheckout.expressCheckout
- 3.7 $wsPayPalCheckout.expressCheckoutGooglePay
- 3.8 $wsPayPalCheckout.expressCheckoutApplePay
- 3.9 $wsPayPalCheckout.googlePay
- 3.10 $wsPayPalCheckout.applePay
- 4 Methoden
- 5 Aktionen
Modulübersicht
Beispiel / Ausschnitt über $wsPayPalCheckout
{{= $wsPayPalCheckout | json }}
JSON-Ausgabe
{
"integrationDate": "...",
"status": "...",
"paymentCanceled": false,
"paymentFailed": false,
"paymentDeclined": false,
"expressCheckout": false,
"expressCheckoutGooglePay": false,
"expressCheckoutApplePay": false,
"googlePay": {
"paymentData": "...",
"transactionInfo": {
"countryCode": "...",
"currencyCode": "...",
"displayItems": [...],
"totalPrice": "...",
"totalPriceLabel": "...",
"totalPriceStatus": "..."
}
},
"applePay": {
"billingContact": { },
"brandName": "...",
"payLineItems": [...],
"paymentData": "...",
"shippingOptions": [...]
},
"loadData": "ƒ()"
}Anmerkung: ƒ() kennzeichnet eine Funktion.
Variablen und Methoden in der Übersicht
Variable | Rückgabe-Typ | Beschreibung |
|---|---|---|
| string | Gibt das PayPal Checkout Integrationsdatum aus. |
| string | Gibt den aktuellen Payment-Status der Session aus. |
| bool | Gibt an, ob die Zahlung abgebrochen wurde. |
| bool | Gibt an, ob die Zahlung fehlgeschlagen ist. |
| bool | Gibt an, ob die Zahlung abgelehnt wurde. |
| bool | Gibt an, ob PayPal Express Checkout möglich ist. |
| bool | Gibt an, ob Google Pay Express möglich ist. |
| bool | Gibt an, ob Apple Pay Express möglich ist. |
| map | Gibt Google-Pay-spezifische Daten aus. |
| map | Gibt Apple-Pay-spezifische Daten aus. |
| map | Lädt alle Payment-Daten für PayPal Checkout. |
Templates
Das $wsPayPalCheckout Modul wird typischerweise im Checkout-Bereich verwendet, insbesondere auf der Zahlungsseite und der Bestellbestätigung. Die PayPal-Buttons können auch auf Produktseiten oder im Warenkorb für Express-Checkout eingebunden werden.
Variablen
$wsPayPalCheckout.integrationDate
Gibt das Integrationsdatum der PayPal-Anbindung aus.
Integrationsdatum: {{= $wsPayPalCheckout.integrationDate }}$wsPayPalCheckout.status
Gibt den Status der PayPal-Zahlung aus(leer, wenn kein Zahlungsvorgang aktiv).
Status: {{= $wsPayPalCheckout.status }}$wsPayPalCheckout.paymentCanceled
Gibt true aus, wenn der Kunde die Zahlung abgebrochen hat.
{{ if $wsPayPalCheckout.paymentCanceled }}
// Zahlung wurde abgebrochen
{{ /if }}$wsPayPalCheckout.paymentFailed
Gibt true aus, wenn ein technischer Fehler bei der Zahlung aufgetreten ist.
{{ if $wsPayPalCheckout.paymentFailed }}
// Zahlung ist fehlgeschlagen
{{ /if }}$wsPayPalCheckout.paymentDeclined
Gibt true aus, wenn die Zahlung von PayPal oder der Bank abgelehnt wurde.
{{ if $wsPayPalCheckout.paymentDeclined }}
// Zahlung wurde abgelehnt
{{ /if }}
$wsPayPalCheckout.expressCheckout
Gibt an, ob PayPal Express Checkout möglich ist.
{{ if $wsPayPalCheckout.expressCheckout }}
// PayPal Express Checkout anzeigen
{{ /if }}
$wsPayPalCheckout.expressCheckoutGooglePay
Gibt an, ob Google Pay Express möglich ist.
{{ if $wsPayPalCheckout.expressCheckoutGooglePay }}
// Google Pay anzeigen
{{ /if }}
$wsPayPalCheckout.expressCheckoutApplePay
Gibt an, ob Apple Pay Express möglich ist.
{{ if $wsPayPalCheckout.expressCheckoutApplePay }}
// Apple Pay anzeigen
{{ /if }}
$wsPayPalCheckout.googlePay
Gibt eine Map mit Google Pay spezifischen Inhalten aus.
Google-Pay-Daten: {{= $wsPayPalCheckout.googlePay }}
$wsPayPalCheckout.applePay
Gibt eine Map mit Apple Pay spezifischen Daten aus.
Apple-Pay-Daten: {{= $wsPayPalCheckout.applePay }}
Methoden
$wsPayPalCheckout.loadData()
Lädt alle Payment-Daten für PayPal Checkout. Gibt null zurück, wenn kein aktiver Zahlungsvorgang vorhanden ist.
Signatur$wsPayPalCheckout.loadData(expressCheckout)
RückgabeMap - Map mit Payment-Daten oder null.
Parameter
Name | Typ | Pflicht | Beschreibung |
|---|---|---|---|
| bool | nein |
|
Beispiel, das die Payment-Daten lädt.
{{ var $myPaypalDataVariable = $wsPayPalCheckout.loadData() }}
{{ if $myPaypalDataVariable }}
// Payment-Daten verfügbar
{{ /if }}
Mit Verwendung der Funktion $wsPayPalCheckout.loadData() stehen verschiedene Variablen zur Verfügung, um Payment-Daten abzurufen und auszugeben. Nachfolgend eine Übersicht, welche Variablen verfügbar sind.
Payment-Daten (Rückgabe von $wsPayPalCheckout.loadData() )
Zunächst ist es notwendig, die Map mit den Payment-Daten, wie im obigen Beispiel dargestellt, einer lokalen Variable zuzuweisen. Diese kann anschließend an verschiedenen Stellen im Template verwendet werden.
JSON-Ausgabe der Variablen
{
"sandbox": true/false,
"merchantId": "...",
"payerId": "...",
"clientId": "...",
"paymentType": "paypal",
"languageCode": "...",
"intent": "capture",
"approvalUrl": "...",
"cancelUrl": "...",
"errorUrl": "...",
"expressApprovalUrl": "...",
"getClientToken": "ƒ()",
"orderId": "...",
"googlePay": { ... },
"applePay": { ... }
}
Variablen in der Übersicht
Allgemeine Eigenschaften:
Variable | Typ | Beschreibung |
|---|---|---|
| bool | Gibt an, ob der Sandbox-Modus (Testmodus für Zahlungsarten) aktiv ist. |
| string | PayPal Merchant-ID. |
| string | PayPal Payer-ID. |
| string | PayPal Client-ID. |
| string | Zahlungstyp (Standard: “ |
| string | Sprachcode. |
| string | URL für die Payment-Bestätigung. |
| string | URL bei Abbruch der Zahlung. |
| string | URL bei aufgetretenen Fehlern. |
| string | URL bei erfolgreicher Express-Zahlung. |
| function | Funktion, die den Client-Token für die PayPal-SDK-Integration zurückgibt. |
| string | PayPal Order-ID der aktuellen Transaktion. |
Eigenschaften von Google Pay und Apple Pay
Google Pay:
Variable | Typ | Beschreibung |
|---|---|---|
| string | Antwortdaten von Google Pay (unverarbeitet). |
| map | Map mit Transaktionsinfos von Google Pay. |
Apple Pay:
Variable | Typ | Beschreibung |
|---|---|---|
| array | Versandoptionen. |
| map | Rechnungsadresse. |
| array | Apple Pay Positionen. |
| string | Markenname. |
| string | Antwortdaten von Apple Pay (unverarbeitet). |
Aktionen
Für $wsPayPalCheckout stehen keine Aktionen zur Verfügung.