Skip to content

Commit

Permalink
Fix error thrown after redirect to checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt75 committed Mar 11, 2024
1 parent ef7f93d commit a7d8185
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion _dev/js/front/src/api/ps-checkout.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ export class PsCheckoutApi extends BaseClass {
if (isJsonResponse) {
if (false === response.ok || response.status >= 400) {
return response.json().then((response) => {
if (actions?.restart && response.body && 85 === response.body.error.code) {
if (
actions?.restart &&
response.body &&
85 === response.body.error.code
) {
return actions.restart();
}

Expand Down Expand Up @@ -221,6 +225,8 @@ export class PsCheckoutApi extends BaseClass {
window.location.href = new URL(
this.config.checkoutCheckoutUrl
).toString();

return;
}

throw new Error(this.$('checkout.form.error.label'));
Expand Down

0 comments on commit a7d8185

Please sign in to comment.