Jump to content

Extending user subscription? Removing time from user sub?


Derek Ta

Recommended Posts

Posted

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. 

Posted

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

Posted
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. 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...