Skip to content

Commit

Permalink
Merge pull request #126 from chrisgan/master
Browse files Browse the repository at this point in the history
Reduce number of log entries made by check_paytrail_response method. …
  • Loading branch information
loueranta-paytrail authored Jan 11, 2024
2 parents 7078599 + 9782cd8 commit 023030e
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,14 +574,21 @@ public function check_paytrail_response() {
$order_id = filter_input(INPUT_GET, 'order_id');
$reference = filter_input(INPUT_GET, 'checkout-reference');

if (!$reference && !$refund_callback && !$refund_unique_id) {
$this->log('Paytrail: check_paytrail_response, no reference found for reference: ' . $reference, 'debug');
if (!$status && !$reference && !$refund_callback && !$refund_unique_id) {
//no log to reduce number of log entries
return;
}
if (!$status && !$refund_callback && !$refund_unique_id) {
$this->log('Paytrail: check_paytrail_response, no status found. ' . $reference, 'debug');

if (!$reference && $status && !$refund_callback && !$refund_unique_id) {
$this->log('Paytrail: check_paytrail_response, no reference found for status: ' . $status, 'debug');
return;
}

if (!$status && $reference && !$refund_callback && !$refund_unique_id) {
$this->log('Paytrail: check_paytrail_response, no status found for reference ' . $reference, 'debug');
return;
}

$sleepTime = rand(0, 3);
$sleepTimeCallback = rand(3, 6);

Expand Down Expand Up @@ -936,7 +943,7 @@ public function process_payment( $order_id) {
} else {
$this->log('Paytrail: Token value: ' . print_r($token, true), 'debug');
}

} else {
$this->log('Paytrail: init PaymentRequest', 'debug');
$payment = new PaymentRequest();
Expand Down

0 comments on commit 023030e

Please sign in to comment.