Skip to content

Commit

Permalink
Paypal Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
condor2 committed Jul 27, 2024
1 parent 86c8de3 commit 40f21d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions upload/admin/controller/extension/payment/paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
10 changes: 6 additions & 4 deletions upload/catalog/controller/extension/payment/paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down

0 comments on commit 40f21d5

Please sign in to comment.