Derek Ta Posted September 6, 2017 Posted September 6, 2017 So basically I have a SaaS website that handles purchases through the commerce app and I would like to know how I would be able to extend the time of a customer's subscription. Sometimes I have issues with my software being unavailable so I would need to compensate my customers for downtime. Would it just be a simple MySql query to extend the timestamp stored in ps_expire in nexus_purchases? I also have issues with removing the time from the user's subscription since ps_active seems to still be set even though I set the expiration date to be a date in the past.
bfarber Posted September 6, 2017 Posted September 6, 2017 I would recommend using the \IPS\nexus\Purchase class for this. $purchase = \IPS\nexus\Purchase::load( $id ); $purchase->expire = \IPS\DateTime::ts( $timestamp ); $purchase->save(); Replace $id and $timestamp with correct values
Derek Ta Posted September 9, 2017 Author Posted September 9, 2017 On 9/6/2017 at 5:03 AM, bfarber said: I would recommend using the \IPS\nexus\Purchase class for this. $purchase = \IPS\nexus\Purchase::load( $id ); $purchase->expire = \IPS\DateTime::ts( $timestamp ); $purchase->save(); Replace $id and $timestamp with correct values Thank you for the response. I got my stuff working.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.