Move stripe sca gateway error messages to translatable keys

This commit is contained in:
luisramos0
2020-02-07 15:59:44 +00:00
committed by Luis Ramos
parent c0bf09131f
commit 08e729673f
2 changed files with 5 additions and 3 deletions

View File

@@ -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)

View File

@@ -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