• Resolved noxdralock

    (@noxdralock)


    Hi, I’d like to know which hook I can use to run every time a subscription is automatically renewed.

    What I want to do is generate a coupon code for my shop (not for a PMS plan) every time a user subscribes to a plan, but also when a subscription is automatically renewed. For the first subscription, I managed to do that by using the “pms_payment_update” hook. But it does not seem to run when a subscription auto-renews. Is there a way to do so?

    Thanks for your answer. Cheers.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Georgian Cocora

    (@raster02)

    Hello @noxdralock,

    Are you using Stripe for payments? If so, you can search for this action: pms_cron_after_processing_member_subscription

    It gives you the subscription and payment as parameters and it runs every time the plugin is automatically renewing a subscription.

    This type of payment should be detected through pms_payment_update as well. You need to look for a status change from pending to completed and the type should be subscription_recurring_payment

    Let me know if you have further questions!

    Regards.

    Thread Starter noxdralock

    (@noxdralock)

    Hi @raster02,

    Perfect thanks a lot ! I’ll try that.

    In the meantime, is there a way to test recurring payments without having to wait for at least a day? I tried changing the next payment date directly in the database but it did not work. I guess a cron job is created when subscribing for the first time to a plan ? So is there a way to override this?

    Thanks. Cheers.

    • This reply was modified 10 months, 1 week ago by noxdralock.
    Plugin Author Georgian Cocora

    (@raster02)

    Hello @noxdralock,

    This works only for Stripe currently but you can change the Next Payment Date by going to the Members List -> Edit Member -> Edit Subscription and then at the bottom you’ll find this date inside the Subscription Billing Schedule metabox.

    To test, you can set the date in the past then just run the cron job manually. There are multiple plugins on the repository which can help you with that, you can choose one. Then just search for this action and run it manually: pms_cron_process_member_subscriptions_payments

    Hope this helps!

    Regards.

    Thread Starter noxdralock

    (@noxdralock)

    Hi,

    perfect thank you a lot! Everything works perfectly !

    Cheers !

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Hook for auto renewal’ is closed to new replies.