View Issue Details

IDProjectCategoryView StatusLast Update
0007380module PayPal Checkoutmodule PayPal checkout - subpublic2022-12-14 14:31
Reporterdominik_ziegler Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.2.2 / 1.2.2 
Fixed in Version2.2.3 / 1.2.3 
Summary0007380: Payment::doCreatePatchedOrder relies on successful order creation
DescriptionIn the method doCreatePatchedOrder an order is created. The response of the order creation call then is used to patch this order.
However, when the first request fails due to whatever reasons, the response does not contain a valid PayPal Order ID. Therefore, $paypalOrderId gets an empty string and the method doPatchPayPalOrder attempts to patch a non-existing order, which results in a HTTP 404 Not Found error (because the order ID is missing). There shouldn't be a PATCH request if the creation of the order was not successful.
Additional Information- es -

vendor/oxid-solution-catalysts/paypal-module/src/service/Payment.php

    public function doCreatePatchedOrder(
        EshopModelBasket $basket
    ): array {
        // PatchOrders access an OrderCall that has taken place before.
        // For this reason, the payPalPartnerAttributionId does not have
        // to be transmitted again in the case of a PatchCall
        $response = $this->doCreatePayPalOrder(
            $basket,
            Constants::PAYPAL_ORDER_INTENT_CAPTURE,
            OrderRequestFactory::USER_ACTION_CONTINUE,
            null,
            null,
            '',
            '',
            '',
            null,
            null,
            false
        );

        $paypalOrderId = $response->id ?: '';
        $status = $response->status ?: '';

        $this->doPatchPayPalOrder(
            $basket,
            $paypalOrderId
        );

        $return = [
            'id' => $paypalOrderId,
            'status' => $status
        ];

        return $return;
    }
TagsNo tags attached.

Activities

[email protected]

2022-12-13 18:28

manager   ~0014952

ready for review