From 08e729673fe5a9538dad0fcbc65dfa86388966f5 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Fri, 7 Feb 2020 15:59:44 +0000 Subject: [PATCH] Move stripe sca gateway error messages to translatable keys --- app/models/spree/gateway/stripe_sca.rb | 4 ++-- config/locales/en.yml | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/spree/gateway/stripe_sca.rb b/app/models/spree/gateway/stripe_sca.rb index dcc585ff5a..65ee527317 100644 --- a/app/models/spree/gateway/stripe_sca.rb +++ b/app/models/spree/gateway/stripe_sca.rb @@ -34,7 +34,7 @@ module Spree def purchase(money, creditcard, gateway_options) payment_intent_id = payment_intent(creditcard, gateway_options) unless payment_intent_id - return failed_activemerchant_billing_response("No Pending Payment Found") + return failed_activemerchant_billing_response(I18n.t(:no_pending_payments)) end payment_intent_response = Stripe::PaymentIntent.retrieve(payment_intent_id, @@ -45,7 +45,7 @@ module Spree message) end if payment_intent_response.status != 'requires_capture' - return failed_activemerchant_billing_response("Invalid PaymentIntent status.") + return failed_activemerchant_billing_response(I18n.t(:invalid_payment_state)) end options = basic_options(gateway_options) diff --git a/config/locales/en.yml b/config/locales/en.yml index 25af1defa2..fb59f0f086 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -275,7 +275,9 @@ en: none: None notes: Notes error: Error - processing_payment: Processing payment... + processing_payment: "Processing payment..." + no_pending_payments: "No pending payments" + invalid_payment_state: "Invalid Payment state" filter_results: Filter Results quantity: Quantity pick_up: Pick up