mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Log order status in payment captured webhook checker
This commit is contained in:
parent
fcf9b6b19e
commit
fff6c84e91
2 changed files with 9 additions and 3 deletions
|
@ -218,7 +218,8 @@ class PayUponInvoiceGateway extends WC_Payment_Gateway {
|
|||
time() + ( 5 * MINUTE_IN_SECONDS ),
|
||||
'woocommerce_paypal_payments_check_pui_payment_captured',
|
||||
array(
|
||||
'order_id' => $order_id,
|
||||
'wc_order_id' => $order_id,
|
||||
'order_id' => $order->id(),
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -235,8 +235,13 @@ class WCGatewayModule implements ModuleInterface {
|
|||
|
||||
add_action(
|
||||
'woocommerce_paypal_payments_check_pui_payment_captured',
|
||||
function ( int $order_id ) {
|
||||
$wc_order = wc_get_order( $order_id );
|
||||
function ( int $wc_order_id, string $order_id ) use ( $c ) {
|
||||
$order_endpoint = $c->get( 'api.endpoint.order' );
|
||||
$logger = $c->get( 'woocommerce.logger.woocommerce' );
|
||||
$order = $order_endpoint->order( $order_id );
|
||||
$logger->info( 'Checking payment captured webhook, order status: ' . $order->status() );
|
||||
|
||||
$wc_order = wc_get_order( $wc_order_id );
|
||||
if ( ! is_a( $wc_order, WC_Order::class ) || $wc_order->get_status() !== 'on-hold' ) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue