add vault token to orders and check them for getting transaction id

This commit is contained in:
Daniel Hüsken 2025-02-26 09:50:40 +01:00
parent c21bbf38f1
commit 85bcd0a454
No known key found for this signature in database
GPG key ID: 9F732DA37FA709E8
4 changed files with 30 additions and 17 deletions

View file

@ -430,6 +430,7 @@ class CreditCardGateway extends \WC_Payment_Gateway_CC {
foreach ( $tokens as $token ) {
if ( $token->get_id() === (int) $card_payment_token_for_free_trial ) {
$wc_order->payment_complete();
$wc_order->add_payment_token( $token );
return $this->handle_payment_success( $wc_order );
}
}
@ -475,6 +476,7 @@ class CreditCardGateway extends \WC_Payment_Gateway_CC {
$order = $this->order_endpoint->order( $create_order->id );
$wc_order->update_meta_data( PayPalGateway::INTENT_META_KEY, $order->intent() );
$wc_order->add_payment_token( $token );
if ( $order->intent() === 'AUTHORIZE' ) {
$order = $this->order_endpoint->authorize( $order );