Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification Callback locking transient. #51

Open
Icarleug opened this issue Oct 18, 2019 · 0 comments
Open

Notification Callback locking transient. #51

Icarleug opened this issue Oct 18, 2019 · 0 comments

Comments

@Icarleug
Copy link

If a customer fails the payment and tries again, and the rety also fails, the transient return and locks out the transaction until the transient times out.

In class-wc-gateway-mondido-hw.php, function notification_callback(), rows 510+

// Use transient to prevent multiple requests
if ( get_transient( 'mondido_transaction_' . $transaction_id . $status ) !== false ) {
   $this->log( "[IPN] Payment confirmation rejected. Transaction ID: {$transaction_id}. Status: {$status}" );
   header( sprintf( '%s %s %s', 'HTTP/1.1', '200', 'OK' ), TRUE, '200' );
   echo "[IPN] Payment confirmation rejected. Transaction ID: {$transaction_id}. Status: {$status}";
   return;
}

Since the use of a return instead of a throw the transaction never unlocks.
Suggestion:

Add an unlock before the return.


// Unlock order processing
$this->unlock_order( $data['payment_ref'] );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant