View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007380 | module PayPal Checkout | module PayPal checkout - sub | public | 2022-11-23 12:35 | 2022-12-14 14:31 |
Reporter | dominik_ziegler | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 2.2.2 / 1.2.2 | ||||
Fixed in Version | 2.2.3 / 1.2.3 | ||||
Summary | 0007380: Payment::doCreatePatchedOrder relies on successful order creation | ||||
Description | In 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; } | ||||
Tags | No tags attached. | ||||