Paypal Checkout als Gast (API Call)

Hallo,
Ich möchte Shopware ausschließlich über die API verwenden. Beim einarbeiten stecke ich nun leider fest. Ich habe erfolgreich einen Einkaufswagen erstellt, ein Produkt hineingelegt, und eine Bestellung als Gast getätigt und habe nun das Order Objekt inklusive ID und möchte mit checkout/{orderID}/Pay den Paypal bezahlungsprozess starten. Ich bekomme allerdings folgende Fehlermeldung “CHECKOUT__ASYNC_PAYMENT_PROCESS_INTERRUPTED”  “The asynchronous payment process was interrupted due to the following error: Customer is not logged in.” Ist das einstellbar das man als Gast zahlen kann oder ist das mit Paypal garnicht möglich?
 

Hallo,

auch wenn du als Gast eine Bestellung machst, sollte sich normalerweise ein Kunde am SalesChannelContext befinden. Bist du dir sicher, dass du den richtigen Token mitsendest, wenn du die /pay Route aufrufst? Wie sieht die Antwort von /checkout/guest-order aus und wie rufst du dann die /pay Methode auf?

Viele Grüße aus Schöppingen

cool Michael Telgmann

Danke Michael für die Antwort
Hier ist die Antwort vom Guest-Order:

{
  "data": {
    "orderNumber": "10012",
    "currencyId": "b7d2554b0ce847cd82f3ac9bd1c0dfca",
    "currencyFactor": 1,
    "salesChannelId": "98432def39fc4789b33213a56b8c944d",
    "billingAddressId": "1e829f3c5f114426a52070468f998a17",
    "orderDateTime": "2019-10-08T11:14:02+00:00",
    "orderDate": "2019-10-08T00:00:00+00:00",
    "price": {
      "netPrice": 0.01,
      "totalPrice": 0.01,
      "calculatedTaxes": [
        {
          "tax": 0,
          "taxRate": 19,
          "price": 0.01,
          "extensions": []
        }
      ],
      "taxRules": [
        {
          "taxRate": 19,
          "percentage": 100,
          "extensions": []
        }
      ],
      "positionPrice": 0.01,
      "taxStatus": "gross",
      "extensions": []
    },
    "amountTotal": 0.01,
    "amountNet": 0.01,
    "positionPrice": 0.01,
    "taxStatus": "gross",
    "shippingCosts": {
      "unitPrice": 0,
      "quantity": 1,
      "totalPrice": 0,
      "calculatedTaxes": [
        {
          "tax": 0,
          "taxRate": 19,
          "price": 0,
          "extensions": []
        }
      ],
      "taxRules": [
        {
          "taxRate": 19,
          "percentage": 100,
          "extensions": []
        }
      ],
      "referencePrice": null,
      "extensions": []
    },
    "shippingTotal": 0,
    "orderCustomer": {
      "email": "max@musterman.io",
      "orderId": "d1e0916fc5144985b293cf5fb381ee83",
      "salutationId": "82842fa5fcf64e6b98febdb2288ac5dc",
      "firstName": "Max",
      "lastName": "Mustermann",
      "title": null,
      "company": null,
      "customerNumber": "10013",
      "customerId": "ec12935ea7394259b96e1bd9ce78900e",
      "customer": null,
      "salutation": null,
      "order": null,
      "customFields": null,
      "_uniqueIdentifier": "8a4ab9a3e8704f838827fe8d5df62efd",
      "versionId": "0fa91ce3e96a4bc2be4bd9ce752c3425",
      "translated": [],
      "createdAt": "2019-10-08T11:14:02+00:00",
      "updatedAt": null,
      "extensions": {
        "internal_mapping_storage": {
          "_uniqueIdentifier": null,
          "versionId": null,
          "translated": [],
          "createdAt": null,
          "updatedAt": null,
          "extensions": []
        }
      },
      "id": "8a4ab9a3e8704f838827fe8d5df62efd",
      "orderVersionId": "0fa91ce3e96a4bc2be4bd9ce752c3425"
    },
    "currency": null,
    "languageId": "e5512cf459ca463dafdffb8b377bb455",
    "language": null,
    "salesChannel": null,
    "addresses": [
      {
        "countryId": "715c574ba58743db8de8d60c2b30e7bb",
        "countryStateId": null,
        "salutationId": "82842fa5fcf64e6b98febdb2288ac5dc",
        "firstName": "Max",
        "lastName": "Mustermann",
        "street": "vogelstraße",
        "zipcode": "30167",
        "city": "hannover",
        "company": null,
        "department": null,
        "title": null,
        "vatId": null,
        "phoneNumber": null,
        "additionalAddressLine1": null,
        "additionalAddressLine2": null,
        "country": {
          "name": "Germany",
          "iso": "DE",
          "position": 1,
          "taxFree": false,
          "active": true,
          "shippingAvailable": true,
          "iso3": "DEU",
          "displayStateInRegistration": false,
          "forceStateInRegistration": false,
          "states": null,
          "translations": null,
          "orderAddresses": null,
          "customerAddresses": null,
          "salesChannelDefaultAssignments": null,
          "salesChannels": null,
          "customFields": null,
          "_uniqueIdentifier": "715c574ba58743db8de8d60c2b30e7bb",
          "versionId": null,
          "translated": {
            "name": "Germany",
            "customFields": []
          },
          "createdAt": "2019-10-07T07:22:31+00:00",
          "updatedAt": null,
          "extensions": {
            "internal_mapping_storage": {
              "_uniqueIdentifier": null,
              "versionId": null,
              "translated": [],
              "createdAt": null,
              "updatedAt": null,
              "extensions": []
            }
          },
          "id": "715c574ba58743db8de8d60c2b30e7bb"
        },
        "countryState": null,
        "order": null,
        "salutation": null,
        "orderDeliveries": null,
        "orderId": "d1e0916fc5144985b293cf5fb381ee83",
        "customFields": null,
        "_uniqueIdentifier": "1e829f3c5f114426a52070468f998a17",
        "versionId": "0fa91ce3e96a4bc2be4bd9ce752c3425",
        "translated": [],
        "createdAt": "2019-10-08T11:14:02+00:00",
        "updatedAt": null,
        "extensions": [],
        "id": "1e829f3c5f114426a52070468f998a17",
        "orderVersionId": "0fa91ce3e96a4bc2be4bd9ce752c3425"
      }
    ],
    "deliveries": null,
    "lineItems": null,
    "transactions": null,
    "deepLinkCode": "_pDd-cmNdUUki4xxubTaJVchNwT4kuPb",
    "autoIncrement": 39,
    "stateMachineState": {
      "name": "Open",
      "technicalName": "open",
      "stateMachineId": "3f584e8671114a8f86927ce745c71a2b",
      "stateMachine": null,
      "fromStateMachineTransitions": null,
      "toStateMachineTransitions": null,
      "translations": null,
      "orders": null,
      "orderTransactions": null,
      "orderDeliveries": null,
      "fromStateMachineHistoryEntries": null,
      "toStateMachineHistoryEntries": null,
      "customFields": null,
      "_uniqueIdentifier": "be8eab463189413280395e840dbbc7d4",
      "versionId": null,
      "translated": {
        "name": "Open",
        "customFields": []
      },
      "createdAt": "2019-10-07T07:22:31+00:00",
      "updatedAt": null,
      "extensions": {
        "internal_mapping_storage": {
          "_uniqueIdentifier": null,
          "versionId": null,
          "translated": [],
          "createdAt": null,
          "updatedAt": null,
          "extensions": []
        }
      },
      "id": "be8eab463189413280395e840dbbc7d4"
    },
    "stateId": "be8eab463189413280395e840dbbc7d4",
    "customFields": null,
    "documents": null,
    "tags": null,
    "_uniqueIdentifier": "d1e0916fc5144985b293cf5fb381ee83",
    "versionId": "0fa91ce3e96a4bc2be4bd9ce752c3425",
    "translated": [],
    "createdAt": "2019-10-08T11:14:02+00:00",
    "updatedAt": null,
    "extensions": [],
    "id": "d1e0916fc5144985b293cf5fb381ee83",
    "billingAddressVersionId": "0fa91ce3e96a4bc2be4bd9ce752c3425"
  }
}

Danach rufe ich die

sales-channel-api/v1/checkout/order/d1e0916fc5144985b293cf5fb381ee83/pay

auf mit dem selben sw-context-token wie vorher beim Order Call (Nochmal geprüft steht im Anfragen Header)
MFG Christian

Hallo Christian,

ich konnte das Verhalten nachstellen und werde das morgen genauer untersuchen.

Viele Grüße aus Schöppingen

cool Michael Telgmann

1 „Gefällt mir“

Hallo Christian,

ich habe für das Problem mal ein Ticket erstellt Shopware Issuetracker Dort kannst du den Status tracken. Ich habe auch schon einen Fix für das Problem gefunden. Das Problem sollte also bald behoben sein. 

Viele Grüße aus Schöppingen

cool Michael Telgmann

Hallo Michael, Hallo CVDH,

suche eine ganz ähnliche Lösung, der Aufbau ist wie bei CVDH (siehe Initial Post), allerdings ist bei mir der Kunde eingeloggt. 
Beim Aufruf der Sales-Channel-API* Zahlungsmehtode  POST  /sales-channel-api/v1/checkout/order/{orderId}/pay kommt die Fehlermeldung:

code: "CHECKOUT__ASYNC_PAYMENT_PROCESS_INTERRUPTED"
detail: "The asynchronous payment process was interrupted due to the following error"
errorMessage: "Required setting 'ClientId' is missing or invalid"
status: "400"
title: "Bad Request"
length: 1

Woher kommt die ClientId?
Und wie kann diese der Zahlungsmethode mitgeben werden?

Mit freundlichem Gruß, mii
* Shopware 6 Doku: https://docs.shopware.com/en/shopware-platform-dev-en/api/sales-channel-cart-api?category=shopware-platform-dev-en/api

Hallo mii,

du musst natürlich zuerst die Settings für das PayPal Plugin über den Admin konfigurieren. Du findest nach der Installation des PayPal Plugins einen neuen Reiter “Plugins”, wenn du auf Einstellungen klickst. Hier findest du weitere Infos: https://docs.shopware.com/de/shopware-6-de/plugins/paypal

Viele Grüße aus Schöppingen

 Michael Telgmann

1 „Gefällt mir“

Der Fehler tritt seid Update auf 6.2.0 Wieder auf

Hallo,

könntest du dafür ein Ticket aufmachen? https://issues.shopware.com/

Viele Grüße aus Schöppingen

cool Michael Telgmann