Open gwalshington opened 7 years ago
Hi @gwalshington
can you please point a webhook to /koudoku/webhooks
on your app?
Koudoku should then handle this via this code: https://github.com/andrewculver/koudoku/blob/master/config/initializers/stripe_event.rb#L22
If not, please add a #cancel
method to your subscription_owner
class
@yas4891 any idea of what that webhook should look like? I have a similar problem and in my routes.rb file I have this, and it obviously isn't working. Any help is greatly appreciated!
post '/koudoku/webhooks' => "controller#my_method"
@amloelxer
You don't need to add a controller to handle this. You just point the webhook in to /koudoku/webhooks
via the Stripe Dashboard.
Then you follow the instructions here: https://github.com/andrewculver/koudoku#webhooks
If you need further help, let me know!
@yas4891 ahh that makes a lot more sense. I added the webhook of https://www.mywebsite.com/koudoku/webhooks
and got a success on the stripe side, but still have the active subscription in my database. Is there anyway to log that Koudoku has indeed received the hook?
You should see that from the logs of your webserver. On Heroku you can install Papertrail
Cheers, Christoph
On Tue, Jul 25, 2017 at 11:48 PM, Alexander Moller <notifications@github.com
wrote:
@yas4891 https://github.com/yas4891 ahh that makes a lot more sense. I added the webhook of 'https://www.mywebsite.com/koudoku/webhooks` and got a success on the stripe side, but still have the active subscription in my database. Is there anyway to log that Koudoku has indeed received the hook?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/andrewculver/koudoku/issues/178#issuecomment-317843697, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOUaD4hwZtHyt55kPG-LVPKffg6u_zpks5sRj-jgaJpZM4OEHUS .
@yas4891 thanks so much for your help! Sorry for all the novice questions. I'm new to web dev
@yas4891 one more question. When I respond to the webhook that cancels the payment (which I canceled from the stripe dashboard), I try to set my local subscription plan_id
to nil
and save it. Unfortunately when I do this, it tries to send the update remotely as well and obviously errors out because there is no active subscription on the stripe servers/dashboard once I cancel it. Is there way to do an update to my local db of subscriptions and not affect the ones in stripe?
Use update_attribute :plan_id, nil
instead
Cheers, Christoph
On Wed, Jul 26, 2017 at 11:09 PM, Alexander Moller <notifications@github.com
wrote:
@yas4891 https://github.com/yas4891 one more question. When I respond to the webhook that cancels the payment (which I canceled from the stripe dashboard), I try to set my local subscription plan_id to nil and save it. Unfortunately when I do this, it tries to send the update remotely as well and obviously errors out because there is no active subscription on the stripe servers/dashboard once I cancel it. Is there way to do an update to my local db of subscriptions and not affect the ones in stripe?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/andrewculver/koudoku/issues/178#issuecomment-318183405, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOUaAKvtpaR4nVJiPtGDXYOZr_WFtdIks5sR6rugaJpZM4OEHUS .
The issue:
When subscriptions are cancelled on Stripe's dashboard instead of in the rails app, Subscription in the database still has a plan_id present, which makes
This makes it appear on the views as if the subscription is still active. So when the user clicks cancel, there is an error. Then, I tried setting plan_id to nil manually in the console, and got the same error: