Advertisement
arie_cristianD

update the paypal subscription status manually

Aug 8th, 2024
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. add_action(
  2.     'admin_init',
  3.     function () {
  4.  
  5.         $user_id        = 10235; /* user_id */
  6.         $date_end       = 1721785801; /* subs end period in timestamp */
  7.         $paypal_sub_id = 'xxxxxxxxxxxxxx'; /* Subscriptions ID */
  8.  
  9.         $expired = new DateTime();
  10.         $expired = $expired->setTimestamp( $date_end );
  11.         $expired = $expired->setTimezone( new DateTimeZone( 'UTC' ) );
  12.         $expired = $expired->format( 'Y-m-d H:i:s' );
  13.         update_user_option( $user_id, 'jpw_paypal_subs_id', $paypal_sub_id );
  14.         update_user_option( $user_id, 'jpw_subs_type', 'paypal' );
  15.         update_user_option( $user_id, 'jpw_subscribe_status', 'ACTIVE' );
  16.         update_user_option( $user_id, 'jpw_expired_date', $expired );
  17.     }
  18. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement