Provide better context for EveryPay / Banklink payment state alerts

This commit is contained in:
Karl Erik Õunapuu 2020-02-04 21:11:30 +02:00
parent 2645654aef
commit 37e7def669
2 changed files with 10 additions and 4 deletions

View file

@ -29,14 +29,13 @@ class Registrar
@payment_order.complete_transaction @payment_order.complete_transaction
if @payment_order.invoice.paid? if @payment_order.invoice.paid?
flash[:notice] = t(:pending_applied) flash[:notice] = t('.payment_successful')
else else
# flash[:alert] = t(:something_wrong) flash[:alert] = t('.successful_payment_backend_error')
flash[:alert] = 'We fucked up'
end end
else else
@payment_order.create_failure_report @payment_order.create_failure_report
flash[:alert] = t(:something_wrong) flash[:alert] = t('.payment_not_received')
end end
redirect_to registrar_invoice_path(@payment_order.invoice) redirect_to registrar_invoice_path(@payment_order.invoice)
end end

View file

@ -0,0 +1,7 @@
en:
registrar:
payments:
back:
payment_successful: 'Thank you! Payment received successfully.'
successful_payment_backend_error: 'We received your payment, but something went wrong on our side. Please contact us via email or phone.'
payment_not_received: 'Payment was unsuccessful. Please make sure you have enough funds on your account and try again.'