Skip to content

Commit

Permalink
Restored Paypal fixes for phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
condor2 committed Feb 27, 2024
1 parent d9c77fb commit 5a72706
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions upload/catalog/controller/extension/payment/paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,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;
Expand Down Expand Up @@ -829,7 +829,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'] = [
'currency_code' => $currency_code,
'value' => $shipping_total
Expand All @@ -853,11 +853,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;
}
}
Expand Down

0 comments on commit 5a72706

Please sign in to comment.