Check for PayPal order existence

This commit is contained in:
Narek Zakarian 2024-02-06 17:05:36 +04:00
parent 704bc9cbf0
commit a383a1a166
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7

View file

@ -108,6 +108,10 @@ class WCGatewayModule implements ModuleInterface {
}
$order = $c->get( 'session.handler' )->order();
if ( ! $order ) {
return;
}
$fraud = $capture->fraud_processor_response();
if ( $fraud ) {
$this->handle_fraud( $fraud, $order, $wc_order );
@ -122,6 +126,10 @@ class WCGatewayModule implements ModuleInterface {
'woocommerce_paypal_payments_order_authorized',
function ( WC_Order $wc_order, Authorization $authorization ) use ( $c ) {
$order = $c->get( 'session.handler' )->order();
if ( ! $order ) {
return;
}
$fraud = $authorization->fraud_processor_response();
if ( $fraud ) {
$this->handle_fraud( $fraud, $order, $wc_order );