Capture payment only if intent setting is capture

This commit is contained in:
dinamiko 2021-10-20 10:40:46 +02:00
parent 0ea8a77359
commit 6649a362f6

View file

@ -173,7 +173,10 @@ trait ProcessPaymentTrait {
if ( $tokens ) {
$this->logger->info( "Payment for subscription parent order #{$order_id} was saved correctly." );
$this->authorized_payments_processor->capture_authorized_payment( $wc_order );
if ( $this->config->has( 'intent' ) && strtoupper( (string) $this->config->get( 'intent' ) ) === 'CAPTURE' ) {
$this->authorized_payments_processor->capture_authorized_payment( $wc_order );
}
$this->session_handler->destroy_session_data();
return array(