tbcooney
Joined 8/1/2019
tbcooney said over 5 years ago on Payment Gateway Basics with Stripe :
I think the way that Stripe handles Subscriptions and Customers has changed recently, where `Stripe::Subscriptions.create` no longer requires the source, but must be passed to `Stripe::Customers.create` instead. I'm having trouble creating the `stripe_customer` method because of this (since the token must be passed to where ever the Customer is being created. Any chance you code shed some insight on this?

tbcooney said over 5 years ago on Payment Gateway Basics with Stripe :
Gotchya...thanks for the quick reply man! I'll rollback my custom `stripe_customer` approach to follow yours, creating a customer from the email, and try to create the `source` after as you outlined above.

tbcooney said over 5 years ago on Payment Gateway Basics with Stripe :
Also, I like the idea of using an idempotent key, since we don't have the single-use guarantee that comes with a token generated by Stripe.js. Are you passing your idempotency key through the user's browser via the payment form and back into your controller? Not sure how to set this up exactly but I think it would help alleviate accidental double clicks along with any network hiccups

tbcooney said over 5 years ago on More on Stripe and Subscriptions :
Extending this logic to the `Resubscriptions` controller, you may find something like ``` subscription = current_company.stripe_customer.subscriptions.first Stripe::Subscription.update( subscription.id, { cancel_at_period_end: false } ) ```