mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Do not capture if wc order already processing
This commit is contained in:
parent
5d7de0a212
commit
78286b0542
1 changed files with 5 additions and 1 deletions
|
@ -103,6 +103,11 @@ class PaymentTokenChecker {
|
|||
* @return void
|
||||
*/
|
||||
public function check_and_update( int $order_id, int $customer_id ):void {
|
||||
$wc_order = wc_get_order( $order_id );
|
||||
if ( $wc_order->get_status() === 'processing' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$tokens = $this->payment_token_repository->all_for_user_id( $customer_id );
|
||||
if ( $tokens ) {
|
||||
try {
|
||||
|
@ -116,7 +121,6 @@ class PaymentTokenChecker {
|
|||
|
||||
$this->logger->error( "Payment for subscription parent order #{$order_id} was not saved on PayPal." );
|
||||
|
||||
$wc_order = wc_get_order( $order_id );
|
||||
$order = $this->get_order( $wc_order );
|
||||
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue