diff --git a/upload/admin/controller/extension/payment/paypal.php b/upload/admin/controller/extension/payment/paypal.php index 64e5e834..6ce082fd 100644 --- a/upload/admin/controller/extension/payment/paypal.php +++ b/upload/admin/controller/extension/payment/paypal.php @@ -3021,6 +3021,7 @@ public function capturePayment() { $transaction_id = $paypal_order_info['transaction_id']; $currency_code = $paypal_order_info['currency_code']; $order_status_id = 0; + $transaction_status = ''; $_config = new Config(); $_config->load('paypal'); diff --git a/upload/catalog/controller/extension/payment/paypal.php b/upload/catalog/controller/extension/payment/paypal.php index 254c1129..33598666 100644 --- a/upload/catalog/controller/extension/payment/paypal.php +++ b/upload/catalog/controller/extension/payment/paypal.php @@ -993,7 +993,7 @@ public function createOrder() { $tax_total = number_format($tax_total * $currency_value, $decimal_place, '.', ''); $order_total = number_format($item_total + $tax_total, $decimal_place, '.', ''); - if ($page_code == 'checkout') { + if ($page_code == 'checkout' && isset($order_info)) { $discount_total = 0; $handling_total = 0; $shipping_total = 0; @@ -1029,7 +1029,7 @@ public function createOrder() { 'value' => $tax_total ); - if ($page_code == 'checkout') { + if ($page_code == 'checkout' && isset($shipping_total) && isset($handling_total) && isset($discount_total) && isset($order_info) && isset($shipping_info)) { $amount_info['breakdown']['shipping'] = array( 'currency_code' => $currency_code, 'value' => $shipping_total @@ -1053,11 +1053,11 @@ public function createOrder() { $paypal_order_info['purchase_units'][0]['items'] = $item_info; $paypal_order_info['purchase_units'][0]['amount'] = $amount_info; - if ($page_code == 'checkout') { + if ($page_code == 'checkout' && isset($order_info)) { $paypal_order_info['purchase_units'][0]['description'] = 'Your order ' . $order_info['order_id']; $paypal_order_info['purchase_units'][0]['invoice_id'] = $order_info['order_id'] . '_' . date('Ymd_His'); - if ($this->cart->hasShipping()) { + if ($this->cart->hasShipping() && isset($shipping_info)) { $paypal_order_info['purchase_units'][0]['shipping'] = $shipping_info; } } @@ -3771,6 +3771,7 @@ public function callback() { $order_status_id = 0; $transaction_status = ''; $payment_method = 'card'; + $paypal_order_data = []; if (!$this->cart->hasShipping()) { $seller_protection_status = 'NOT_ELIGIBLE'; @@ -3875,6 +3876,7 @@ public function callback() { $order_status_id = 0; $transaction_status = ''; $payment_method = 'card'; + $paypal_order_data = []; if (!$this->cart->hasShipping()) { $seller_protection_status = 'NOT_ELIGIBLE';