Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for setting PaymentIntent status directly upon creation #778

Open
basicallydan opened this issue May 28, 2021 · 1 comment
Open

Comments

@basicallydan
Copy link

While using stripe-ruby-mock I tried to create a PaymentIntent with a status of requires_action to mimic being mid-flow of a 3D Secure process. It always ended up as 'succeeded' though.

Stripe::PaymentIntent.create(
  amount: amount,
  currency: 'usd',
  payment_method_types: ['card'],
  customer: user.customer,
  invoice: stripe_invoice.id,
  status: 'requires_action'
)

I had a look at the source code and realised that a specific amount is needed to set the status, 3184. There are other numbers for other statuses. What is the reason for status only being set indirectly via amount? I'd like to propose either allowing status to be set directly, or that the amount thing is documented somewhere other than spec to make it clearer. I'm happy to contribute some time to do or help do either one of these things.

Thanks for the hard work on this great library! I use it almost daily :)

@base10
Copy link

base10 commented Jun 10, 2021

This feels like the sort of thing it'd be helpful to have a StripeMock.prepare_payment_intent(:insufficient_funds) or similar for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants