Skip to content

Commit

Permalink
Temporary solution for "Loading payment form" spinner not resolving o…
Browse files Browse the repository at this point in the history
…n checkout payment form reload
  • Loading branch information
rhoerr committed Mar 27, 2024
1 parent 6cbfcec commit 8729d5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Magewire/Payment/Authnetcim.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Authnetcim extends Form implements EvaluationInterface
'billing_address_saved' => 'Loading payment form',
'billing_address_submitted' => 'Loading payment form',
'getNewCard' => 'Updating payment data',
'initHostedForm' => 'Loading payment form',
// 'initHostedForm' => 'Loading payment form',
'paymentCcCid' => 'Updating payment data',
'selectedCard' => 'Updating payment selection',
'submitTransaction' => 'Processing payment',
Expand Down
5 changes: 5 additions & 0 deletions view/frontend/templates/checkout/hosted/scripts.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ $code = $escaper->escapeJs($block->getData('method_code'));

window.addEventListener('message', this.handleCommunication.bind(this));
document.addEventListener('checkout:payment:method-activate', this.toggleOrderButton.bind(this));
document.removeEventListener('<?= $code ?>InitHostedForm', this.loadHostedForm.bind(this));
document.addEventListener('<?= $code ?>InitHostedForm', this.loadHostedForm.bind(this));
this.$watch('selectedCard', this.changeSelectedCard.bind(this));

Expand Down Expand Up @@ -84,6 +85,10 @@ $code = $escaper->escapeJs($block->getData('method_code'));
}
},
loadHostedForm: function(event) {
if ($el.isConnected === false) {
return;
}

let data = event.detail;

var iframe = $el.querySelector('iframe');
Expand Down

0 comments on commit 8729d5f

Please sign in to comment.