Merge pull request #933 from woocommerce/PCP-954-compatibility-with-wc-high-performance-order-storage

Compatibility with WC High-Performance Order Storage
This commit is contained in:
Emili Castells 2022-11-02 16:34:58 +01:00 committed by GitHub
commit 933cede8d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 32 additions and 8 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 );
}