mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Replace wp update post meta to wc update meta
This commit is contained in:
parent
37d5cae924
commit
5e42704dbc
5 changed files with 19 additions and 7 deletions
|
@ -175,9 +175,9 @@ class SubscriptionModule implements ModuleInterface {
|
|||
try {
|
||||
$tokens = $payment_token_repository->all_for_user_id( $subscription->get_customer_id() );
|
||||
if ( $tokens ) {
|
||||
$subscription_id = $subscription->get_id();
|
||||
$latest_token_id = end( $tokens )->id() ? end( $tokens )->id() : '';
|
||||
update_post_meta( $subscription_id, 'payment_token_id', $latest_token_id, true );
|
||||
$subscription->update_meta_data( 'payment_token_id', $latest_token_id );
|
||||
$subscription->save();
|
||||
}
|
||||
} catch ( RuntimeException $error ) {
|
||||
$message = sprintf(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue