mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Provide a sensible flash message when CreditCard#destroy action fails
This commit is contained in:
@@ -22,8 +22,10 @@ module Spree
|
||||
def destroy
|
||||
if @credit_card.destroy
|
||||
flash[:success] = I18n.t(:card_has_been_removed, number: "x-#{@credit_card.last_digits}")
|
||||
redirect_to "/account#/cards"
|
||||
else
|
||||
flash[:error] = I18n.t(:card_could_not_be_removed)
|
||||
end
|
||||
redirect_to "/account#/cards"
|
||||
end
|
||||
|
||||
# Currently can only destroy the whole customer object
|
||||
|
||||
@@ -903,6 +903,7 @@ en:
|
||||
you_have_no_saved_cards: You haven't saved any cards yet
|
||||
saving_credit_card: Saving credit card...
|
||||
card_has_been_removed: "Your card has been removed (number: %{number})"
|
||||
card_could_not_be_removed: Sorry, the card could not be removed
|
||||
|
||||
ie_warning_headline: "Your browser is out of date :-("
|
||||
ie_warning_text: "For the best Open Food Network experience, we strongly recommend upgrading your browser:"
|
||||
|
||||
Reference in New Issue
Block a user