mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-14 04:04:23 +00:00
mark payment failed after failed authorization
This commit is contained in:
@@ -46,6 +46,8 @@ class ProcessPaymentIntent
|
||||
Result.new(ok: false, error: I18n.t("payment_could_not_complete"))
|
||||
end
|
||||
rescue Stripe::StripeError => e
|
||||
payment.failed_authorization
|
||||
payment.clear_authorization_url
|
||||
Result.new(ok: false, error: e.message)
|
||||
end
|
||||
|
||||
|
||||
@@ -171,8 +171,8 @@ describe Spree::OrdersController, type: :controller do
|
||||
expect(response.status).to eq 200
|
||||
expect(flash[:error]).to eq("#{I18n.t('payment_could_not_process')}. error message")
|
||||
payment.reload
|
||||
expect(payment.cvv_response_message).to eq("https://stripe.com/redirect")
|
||||
expect(payment.state).to eq("requires_authorization")
|
||||
expect(payment.cvv_response_message).to be nil
|
||||
expect(payment.state).to eq("failed")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ describe ProcessPaymentIntent do
|
||||
|
||||
it "does not complete the payment" do
|
||||
service.call!
|
||||
expect(payment.reload.state).to eq("requires_authorization")
|
||||
expect(payment.reload.state).to eq("failed")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user