|
29 | 29 | use PaypalAddons\classes\API\Model\WebhookEvent; |
30 | 30 | use PaypalAddons\classes\Constants\WebhookHandler; |
31 | 31 | use PaypalAddons\classes\Webhook\WebhookEventHandler; |
32 | | -use PaypalAddons\services\ServicePaypalOrder; |
33 | 32 | use PaypalPPBTlib\Extensions\ProcessLogger\ProcessLoggerHandler; |
34 | 33 |
|
35 | 34 | if (!defined('_PS_VERSION_')) { |
|
41 | 40 | */ |
42 | 41 | class PaypalWebhookhandlerModuleFrontController extends PaypalAbstarctModuleFrontController |
43 | 42 | { |
44 | | - /** @var ServicePaypalOrder */ |
45 | | - protected $servicePaypalOrder; |
46 | | - |
47 | 43 | /** @var array */ |
48 | 44 | protected $requestData; |
49 | 45 |
|
@@ -85,7 +81,7 @@ public function run() |
85 | 81 | if ($this->webhookEventHandler->handle($webhookEvent)) { |
86 | 82 | header('HTTP/1.1 200 OK'); |
87 | 83 | } else { |
88 | | - header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500); |
| 84 | + header($_SERVER['SERVER_PROTOCOL'] . ' 422 Unprocessable Content', true, 422); |
89 | 85 | } |
90 | 86 | } else { |
91 | 87 | $paypalOrder = $this->initPaypalOrder($this->getRequest()); |
@@ -193,7 +189,7 @@ protected function initPaypalOrder($requestData) |
193 | 189 | if (false == empty($event->getResource()->supplementary_data->related_ids->order_id)) { |
194 | 190 | $paymentId = $event->getResource()->supplementary_data->related_ids->order_id; |
195 | 191 |
|
196 | | - return $this->servicePaypalOrder->getPaypalOrderByPaymentId($paymentId); |
| 192 | + return $this->module->getPaypalOrderService()->getPaypalOrderByPaymentId($paymentId); |
197 | 193 | } |
198 | 194 |
|
199 | 195 | return new PaypalOrder(); |
|
0 commit comments