mdavenpo

May 31st, 2023 03:36 AM

hiya, sorry for what may be another silly question, or if this has been asked prior. (i couldnt find it being asked prior).

Essentially im trying to impliment a token on user subscription, that being for example when user signs up for basic plan, they get 1 token for the period (eg a month). I have the token system attached to the user table and i have the token being spent within the application, but i cant find the event for when the subscription payment is successful, to then add the logic to increase token by 1 or x number.

Thank you in advance for any guidance.

bobbyiliev

May 31st, 2023 03:43 AM

Hi there,

Not a silly question at all!

What you could do is to use the Paddle Webhooks. At the moment there is no method to handle the subscription_payment_succeeded event:

SubscriptionController.php#L54-L55C23

But what you could do is extend the SubscriptionController and add a method for that Paddle webhook that would trigger your logic for increasing the credits amount every time a user has a successful payment.

For more information on the Paddle webhooks check out the docs here:

Working with Paddle webhooks

When configuring this in PAddle, in the input for the URL add your_wave_domain.com/paddle/webhook. Then make sure to select the subscription events so that they get triggered.

Hope that this helps! Let me know if you have any questions!

Best,

Bobby

mdavenpo

May 31st, 2023 03:51 AM

Thank you for the quick reply, i will give that a go :) thank you so much for your help.

Report
1
bobbyiliev

May 31st, 2023 04:06 AM

No worries at all! Let me know how it goes!