diff --git a/lib/stripe_mock/request_handlers/payment_intents.rb b/lib/stripe_mock/request_handlers/payment_intents.rb index a993ac1d2..3309e4879 100644 --- a/lib/stripe_mock/request_handlers/payment_intents.rb +++ b/lib/stripe_mock/request_handlers/payment_intents.rb @@ -20,6 +20,7 @@ def new_payment_intent(route, method_url, params, headers) status = case params[:amount] when 3184 then 'requires_action' when 3178 then 'requires_payment_method' + when 3055 then 'requires_capture' else 'succeeded' end diff --git a/spec/shared_stripe_examples/payment_intent_examples.rb b/spec/shared_stripe_examples/payment_intent_examples.rb index eacf062d2..8f6993eab 100644 --- a/spec/shared_stripe_examples/payment_intent_examples.rb +++ b/spec/shared_stripe_examples/payment_intent_examples.rb @@ -36,6 +36,16 @@ expect(payment_intent.last_payment_error.message).to eq('Not enough funds.') end + it "creates a requires_payment_method stripe payment_intent when amount matches 3055" do + payment_intent = Stripe::PaymentIntent.create(amount: 3055, currency: "usd") + + expect(payment_intent.id).to match(/^test_pi/) + expect(payment_intent.amount).to eq(3055) + expect(payment_intent.currency).to eq('usd') + expect(payment_intent.metadata.to_hash).to eq({}) + expect(payment_intent.status).to eq('requires_capture') + end + describe "listing payment_intent" do before do 3.times do