View Issue Details

IDProjectCategoryView StatusLast Update
0007380module PayPal Checkoutmodule PayPal checkout - subpublic2022-11-29 09:35
Reporterdominik_ziegler 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version2.2.2 / 1.2.2 
Target VersionFixed in Version 
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

There are no notes attached to this issue.