View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007168 | module PayPal | module PayPal - sub | public | 2020-08-20 16:15 | 2020-09-22 10:04 |
Reporter | michael_keiluweit | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 6.2.0 | ||||
Fixed in Version | Patch for 5.3 | ||||
Summary | 0007168: The method Caller::validateResponse only catches ACK failures, but not internal service errors. | ||||
Description | The PayPal module has the method \OxidEsales\PayPalModule\Core\Caller::validateResponse to check if the server responded with an "Failure" for the array key "ACK". Not only that there are more situations which could (should/must?) checked and documented (https://developer.paypal.com/docs/nvp-soap-api/NVPAPIOverview/#respond-to-an-nvp-response), but there could be the case the server sends a INTERNAL_SERVICE_ERROR or SERVICE_UNAVAILABLE (https://developer.paypal.com/docs/api/reference/api-responses/#http-status-codes). Writing the other error cases to the log are useful for the developers to trace down what happend in most of the cases. Also it should be considered to mark the payment of the order as not paid yet, as the PayPal Service returned an error. The transaction should be checked manually. Examples: Response from PayPal [2020-08-06 13:37:18] SESS ID: $sid array ( '{____"name":_"INTERNAL_SERVICE_ERROR",____"message":_"An_internal_service_error_has_occurred",____"debugId":_"$debugId",____"links":_' => array ( '{ "href": "https://developer.paypal.com/docs/api/overview/#error", "rel": "information_link" }' => '', ),) Response from PayPal [2020-07-15 17:55:04] SESS ID: $sid array ( '{____"name":_"SERVICE_UNAVAILABLE",____"message":_"Service_Unavailable",____"debugId":_"$debugId",____"links":_' => array ( '{ "href": "https://developer.paypal.com/docs/api/overview/#error", "rel": "information_link" }' => '', ),) The method I talked about: protected function validateResponse($response) { if ('Failure' == $response['ACK']) { $exception = oxNew(PayPalResponseException::class, $response['L_LONGMESSAGE0'], $response['L_ERRORCODE0']); throw $exception; } }https://github.com/OXID-eSales/paypal/blob/master/Core/Caller.php#L170 | ||||
Tags | No tags attached. | ||||