Merge pull request #11730 from murjax/payment-save-flash-9048

Fix Stripe payment flash rendering issue
This commit is contained in:
Filipe
2023-11-17 11:51:42 +00:00
committed by GitHub
33 changed files with 15 additions and 50 deletions

View File

@@ -42,8 +42,9 @@ angular.module('admin.payments').factory 'Payment', (AdminStripeElements, curren
submit: =>
munged = @preprocess()
PaymentResource.create({order_id: munged.order_id}, munged, (response, headers, status)=>
$window.location.pathname = "/admin/orders/" + munged.order_id + "/payments"
PaymentResource.create({order_id: munged.order_id}, munged, (response, headers, status) ->
document.body.innerHTML = Object.values(response).join('')
$window.history.pushState({}, '', "/admin/orders/" + munged.order_id + "/payments")
, (response) ->
StatusMessage.display 'error', t("spree.admin.payments.source_forms.stripe.error_saving_payment")
)