Skip to content

Commit

Permalink
Added Lint warning fix for Paypal
Browse files Browse the repository at this point in the history
  • Loading branch information
condor2 committed Feb 29, 2024
1 parent 3f69987 commit f538907
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions upload/catalog/controller/extension/payment/paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function index() {
if ($this->config->get('paypal_status') && $this->config->get('paypal_client_id') && $this->config->get('paypal_secret') && !$this->callback() && !$this->webhook() && !$this->cron() && $agree_status) {
$this->load->language('extension/payment/paypal');

$_config = new Config();
$_config = new \Config();
$_config->load('paypal');

$config_setting = $_config->get('paypal_setting');
Expand Down Expand Up @@ -111,7 +111,7 @@ public function index() {
public function modal() {
$this->load->language('extension/payment/paypal');

$_config = new Config();
$_config = new \Config();
$_config->load('paypal');

$config_setting = $_config->get('paypal_setting');
Expand Down Expand Up @@ -201,7 +201,7 @@ public function getData() {
$this->load->model('localisation/country');
$this->load->model('checkout/order');

$_config = new Config();
$_config = new \Config();
$_config->load('paypal');

$config_setting = $_config->get('paypal_setting');
Expand Down Expand Up @@ -804,7 +804,7 @@ public function createOrder() {
}

if (!$errors) {
$_config = new Config();
$_config = new \Config();
$_config->load('paypal');

$config_setting = $_config->get('paypal_setting');
Expand Down Expand Up @@ -863,7 +863,7 @@ public function createOrder() {
$item_info[] = [
'name' => $product['name'],
'sku' => $product['model'],
'url' => $this->url->link('product/product', 'product_id=' . $product['product_id'], true),
'url' => $this->url->link('product/product', 'product_id = ' . $product['product_id'], true),
'quantity' => $product['quantity'],
'unit_amount' => [
'currency_code' => $currency_code,
Expand Down Expand Up @@ -901,7 +901,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 @@ -937,7 +937,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 @@ -961,11 +961,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 Expand Up @@ -1438,6 +1438,7 @@ public function approveOrder() {
$card_nice_type = (!empty($this->request->post['card_nice_type']) ? $this->request->post['card_nice_type'] : '');
$card_last_digits = '';
$card_expiry = '';
$paypal_order_data = [];

if (!$this->cart->hasShipping()) {
$seller_protection_status = 'NOT_ELIGIBLE';
Expand Down Expand Up @@ -1569,6 +1570,7 @@ public function approveOrder() {
$card_nice_type = (!empty($this->request->post['card_nice_type']) ? $this->request->post['card_nice_type'] : '');
$card_last_digits = '';
$card_expiry = '';
$paypal_order_data = [];

if (!$this->cart->hasShipping()) {
$seller_protection_status = 'NOT_ELIGIBLE';
Expand Down Expand Up @@ -2451,7 +2453,7 @@ public function completeOrder() {

$order_data['order_id'] = $this->session->data['order_id'];

$_config = new Config();
$_config = new \Config();
$_config->load('paypal');

$config_setting = $_config->get('paypal_setting');
Expand Down Expand Up @@ -2837,6 +2839,7 @@ public function completeOrder() {
$card_nice_type = '';
$card_last_digits = '';
$card_expiry = '';
$paypal_order_data = [];

if (!$this->cart->hasShipping()) {
$seller_protection_status = 'NOT_ELIGIBLE';
Expand Down

0 comments on commit f538907

Please sign in to comment.