mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 18:00:15 +08:00
add vault token to orders and check them for getting transaction id
This commit is contained in:
parent
c21bbf38f1
commit
85bcd0a454
4 changed files with 30 additions and 17 deletions
|
@ -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 );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue