pay-rails / pay

Payments for Ruby on Rails apps
https://github.com/pay-rails/pay
MIT License
1.96k stars 313 forks source link

Hardcoded payment_method_types #376

Closed doutatsu closed 2 years ago

doutatsu commented 3 years ago

Correct me if I am wrong, but looking into the source code, payment_method_types is hardcoded to card. Is there no way to provide additional payment types? If not, is there a chance that ability would be added any time soon?

excid3 commented 3 years ago

Just pass in that option to override it.

But yes, currently only cards will be saved. I'll be adding a PaymentMethod model when I get back from vacation so we can store more options.

doutatsu commented 3 years ago

Ah, I am blind, you can override them, my bad. Thanks for letting me know!

excid3 commented 3 years ago

Made some good progress on this in the v3 branch. Tested all the different options I could from Stripe and Braintree.

cjavilla-stripe commented 2 years ago

We can actually remove payment_method_types now as it's optional. If it's not passed, the Checkout Session will dynamically present the payment method types that are configured in the Stripe dashboard.

doutatsu commented 2 years ago

Yup, I was thinking of Pay when I read the latest update. This really should have been there from day one - will make life so much easier

excid3 commented 2 years ago

Going to close this now that we've updated the Stripe Checkout helpers to not include them any longer and the Pay Charge / Subscription models support all the other payment methods. 👍

clemoun commented 2 years ago

Hello,

Sorry for the beginner's question but Stripe is telling me "We've detected that you are not using Automatic Payment Methods" which means (if I'm correct) that payment_method_types still defaults to ["card"] in my app.

I first installed Pay in december on my app and this issue was fixed by @cjavdev in january : how do I get the latest version of Pay in my rails app ? To this day, my Gemfile says gem 'pay', '~> 3.0'

excid3 commented 2 years ago

Use it from master.

clemoun commented 2 years ago

Sorry but do you mean from the github branch master ? I didn't even know there was a way to use it from anything else than master.

My Rails app is running on Heroku, it accepts payments, everything works OK except for this message I get from Stripe (in production) on my Stripe Dashboard if I go to Settings > payment methods

Screenshot from 2022-04-19 16-17-18

The Stripe link then sends to https://stripe.com/docs/payments/dashboard-payment-methods#section-opt