activemerchant / active_merchant

Active Merchant is a simple payment abstraction library extracted from Shopify. The aim of the project is to feel natural to Ruby users and to abstract as many parts as possible away from the user to offer a consistent interface across all supported gateways.
http://activemerchant.org
MIT License
4.54k stars 2.5k forks source link

undefined local variable or method `payment' for #<ActiveMerchant::Billing::StripePaymentIntentsGateway:0x00007fba147d0098> #3341

Open waaux opened 5 years ago

waaux commented 5 years ago

I am getting this message undefined local variable or method `payment' when I am trying to store the customer credit card information using the new Stripe Payment Intents Gateway.

I am doing this: response = provider.store(creditcard, options)

where creditcard is the credit card information from the user.

waaux commented 5 years ago

https://github.com/activemerchant/active_merchant/blob/master/lib/active_merchant/billing/gateways/stripe_payment_intents.rb#L133

In this line should be: super(payment_method, options) instead of super(payment, options) ???

davideghz commented 5 years ago

hi @waaux yes, it's definitely as you suggest, we fixed it as well like that in our app.

OT: we are also trying to use the new Stripe's Payment Intents Gateway API with Stripe's Element and spree_gateway; how do you handle 3DS redirects? we think to keep the "old" suggested flow with form submission, then implement the required webhooks and handling all redirects for 3DS from the backend, passing the webhook's return_url

waaux commented 5 years ago

Hi @davideghz As you suggested I will use the old flow with flow submission and follow this Stripe tutorial to handle 3DS. Link: https://stripe.com/docs/payments/3d-secure-iframe

How did you fix this problem from your app? Did you use _decorator file???

davideghz commented 5 years ago

How did you fix this problem from your app? Did you use _decorator file???

we "vendorized" the gem and fixed it directly, waiting for your PR to be merged :)

we are still having hard time in handling 3ds redirects tho