Replace wp update post meta to wc update meta

This commit is contained in:
dinamiko 2022-10-24 12:35:31 +02:00
parent 37d5cae924
commit 5e42704dbc
5 changed files with 19 additions and 7 deletions

View file

@ -277,7 +277,8 @@ class CardButtonGateway extends \WC_Payment_Gateway {
if ( $this->subscription_helper->has_subscription( $order_id ) && $this->subscription_helper->is_subscription_change_payment() ) {
$saved_paypal_payment = filter_input( INPUT_POST, 'saved_paypal_payment', FILTER_SANITIZE_STRING );
if ( $saved_paypal_payment ) {
update_post_meta( $order_id, 'payment_token_id', $saved_paypal_payment );
$wc_order->update_meta_data( 'payment_token_id', $saved_paypal_payment );
$wc_order->save();
return $this->handle_payment_success( $wc_order );
}

View file

@ -425,7 +425,8 @@ class PayPalGateway extends \WC_Payment_Gateway {
if ( $this->subscription_helper->has_subscription( $order_id ) && $this->subscription_helper->is_subscription_change_payment() ) {
$saved_paypal_payment = filter_input( INPUT_POST, 'saved_paypal_payment', FILTER_SANITIZE_STRING );
if ( $saved_paypal_payment ) {
update_post_meta( $order_id, 'payment_token_id', $saved_paypal_payment );
$wc_order->update_meta_data( 'payment_token_id', $saved_paypal_payment );
$wc_order->save();
return $this->handle_payment_success( $wc_order );
}