Advertisement
arie_cristianD

update stripe Subscriptions manualy

Jul 22nd, 2024
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 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.         $stripe_subs_id = 'sub_1PfXrlCucJeJRpKNZ8RomIRQ'; /* 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_stripe_subs_id', $stripe_subs_id );
  14.         update_user_option( $user_id, 'jpw_subs_type', 'stripe' );
  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