File tree Expand file tree Collapse file tree 10 files changed +151
-22
lines changed
src/view/frontend/templates/component/payment Expand file tree Collapse file tree 10 files changed +151
-22
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,25 @@ use Magento\Framework\View\Element\Template;
16
16
</style>
17
17
<script>
18
18
(() => {
19
- window.addEventListener('checkout:payment:method-activate', event => {
19
+ window.addEventListener('checkout:payment:method-activate', async event => {
20
20
if (event.detail.method !== 'rvvup_APPLE_PAY') {
21
21
return;
22
22
}
23
23
24
- const component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
24
+ /*
25
+ This code finds the magewire component, but the workaround is required because the component may not be
26
+ immediately available when the script is executed. This is related to an issue in Hyva Checkout 1.3.0 or
27
+ later. This is currently the suggested workaround provided by Hyva:
28
+ https://gitlab.hyva.io/hyva-checkout/checkout/-/issues/418
29
+ */
30
+ let component;
31
+ try {
32
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
33
+ } catch (error) {
34
+ await Livewire.onLoad(() => {
35
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
36
+ });
37
+ }
25
38
hyvaCheckout.payment.activate('rvvup_APPLE_PAY', {
26
39
placeOrderViaJs() {
27
40
return document.querySelector('[wire\\:key="rvvup_APPLE_PAY"].active') !== null;
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ use Magento\Framework\View\Element\Template;
97
97
}
98
98
});
99
99
100
- window.addEventListener('checkout:payment:method-activate', event => {
100
+ window.addEventListener('checkout:payment:method-activate', async event => {
101
101
let placeOrderButton = getPlaceOrderButton();
102
102
const divId = "rvvup-apple-pay-button";
103
103
@@ -112,7 +112,20 @@ use Magento\Framework\View\Element\Template;
112
112
113
113
$applePaySelected = true;
114
114
115
- const component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
115
+ /*
116
+ This code finds the magewire component, but the workaround is required because the component may not be
117
+ immediately available when the script is executed. This is related to an issue in Hyva Checkout 1.3.0 or
118
+ later. This is currently the suggested workaround provided by Hyva:
119
+ https://gitlab.hyva.io/hyva-checkout/checkout/-/issues/418
120
+ */
121
+ let component;
122
+ try {
123
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
124
+ } catch (error) {
125
+ await Livewire.onLoad(() => {
126
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
127
+ });
128
+ }
116
129
hyvaCheckout.payment.activate('rvvup_APPLE_PAY', {
117
130
initialize() {
118
131
placeOrderButton.classList.add('rvvup_APPLE_PAY_place_order_button');
Original file line number Diff line number Diff line change @@ -29,13 +29,25 @@ use Magento\Framework\View\Element\Template;
29
29
});
30
30
});
31
31
32
- window.addEventListener('checkout:payment:method-activate', event => {
32
+ window.addEventListener('checkout:payment:method-activate', async event => {
33
33
if (event.detail.method !== 'rvvup_CARD') {
34
34
return;
35
35
}
36
36
37
- const component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
38
-
37
+ /*
38
+ This code finds the magewire component, but the workaround is required because the component may not be
39
+ immediately available when the script is executed. This is related to an issue in Hyva Checkout 1.3.0 or
40
+ later. This is currently the suggested workaround provided by Hyva:
41
+ https://gitlab.hyva.io/hyva-checkout/checkout/-/issues/418
42
+ */
43
+ let component;
44
+ try {
45
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
46
+ } catch (error) {
47
+ await Livewire.onLoad(() => {
48
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
49
+ });
50
+ }
39
51
hyvaCheckout.payment.activate('rvvup_CARD', {
40
52
initialize() {
41
53
ST = SecureTrading({
Original file line number Diff line number Diff line change @@ -12,12 +12,25 @@ use Magento\Framework\Escaper;
12
12
<div wire:ignore>
13
13
<script>
14
14
(() => {
15
- window.addEventListener('checkout:payment:method-activate', event => {
15
+ window.addEventListener('checkout:payment:method-activate', async event => {
16
16
if (event.detail.method !== 'rvvup_CARD') {
17
17
return;
18
18
}
19
19
20
- const component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
20
+ /*
21
+ This code finds the magewire component, but the workaround is required because the component may not be
22
+ immediately available when the script is executed. This is related to an issue in Hyva Checkout 1.3.0 or
23
+ later. This is currently the suggested workaround provided by Hyva:
24
+ https://gitlab.hyva.io/hyva-checkout/checkout/-/issues/418
25
+ */
26
+ let component;
27
+ try {
28
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
29
+ } catch (error) {
30
+ await Livewire.onLoad(() => {
31
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
32
+ });
33
+ }
21
34
hyvaCheckout.payment.activate('rvvup_CARD', {
22
35
placeOrderViaJs() {
23
36
return document.querySelector('[wire\\:key="rvvup_CARD"].active') !== null;
Original file line number Diff line number Diff line change 1
1
<?php
2
2
declare (strict_types=1 );
3
3
4
- use Magento \Framework \View \Element \Template ;
5
4
use Magento \Framework \Escaper ;
5
+ use Magento \Framework \View \Element \Template ;
6
6
7
7
/** @var Template $block */
8
8
/** @var Escaper $escaper */
@@ -12,12 +12,25 @@ use Magento\Framework\Escaper;
12
12
<div wire:ignore>
13
13
<script>
14
14
(() => {
15
- window.addEventListener('checkout:payment:method-activate', event => {
15
+ window.addEventListener('checkout:payment:method-activate', async event => {
16
16
if (event.detail.method !== 'rvvup_CLEARPAY') {
17
17
return;
18
18
}
19
19
20
- const component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
20
+ /*
21
+ This code finds the magewire component, but the workaround is required because the component may not be
22
+ immediately available when the script is executed. This is related to an issue in Hyva Checkout 1.3.0 or
23
+ later. This is currently the suggested workaround provided by Hyva:
24
+ https://gitlab.hyva.io/hyva-checkout/checkout/-/issues/418
25
+ */
26
+ let component;
27
+ try {
28
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
29
+ } catch (error) {
30
+ await Livewire.onLoad(() => {
31
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
32
+ });
33
+ }
21
34
hyvaCheckout.payment.activate('rvvup_CLEARPAY', {
22
35
23
36
placeOrderViaJs() {
Original file line number Diff line number Diff line change @@ -11,12 +11,25 @@ use Magento\Framework\Escaper;
11
11
<div wire:ignore>
12
12
<script>
13
13
(() => {
14
- window.addEventListener('checkout:payment:method-activate', event => {
14
+ window.addEventListener('checkout:payment:method-activate', async event => {
15
15
if (event.detail.method !== 'rvvup_CRYPTO') {
16
16
return;
17
17
}
18
18
19
- const component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
19
+ /*
20
+ This code finds the magewire component, but the workaround is required because the component may not be
21
+ immediately available when the script is executed. This is related to an issue in Hyva Checkout 1.3.0 or
22
+ later. This is currently the suggested workaround provided by Hyva:
23
+ https://gitlab.hyva.io/hyva-checkout/checkout/-/issues/418
24
+ */
25
+ let component;
26
+ try {
27
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
28
+ } catch (error) {
29
+ await Livewire.onLoad(() => {
30
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
31
+ });
32
+ }
20
33
hyvaCheckout.payment.activate('rvvup_CRYPTO', {
21
34
placeOrderViaJs() {
22
35
return document.querySelector('[wire\\:key="rvvup_CRYPTO"].active') !== null;
Original file line number Diff line number Diff line change @@ -11,12 +11,25 @@ use Magento\Framework\Escaper;
11
11
<div wire:ignore>
12
12
<script>
13
13
(() => {
14
- window.addEventListener('checkout:payment:method-activate', event => {
14
+ window.addEventListener('checkout:payment:method-activate', async event => {
15
15
if (event.detail.method !== 'rvvup_FAKE_PAYMENT_METHOD') {
16
16
return;
17
17
}
18
18
19
- const component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
19
+ /*
20
+ This code finds the magewire component, but the workaround is required because the component may not be
21
+ immediately available when the script is executed. This is related to an issue in Hyva Checkout 1.3.0 or
22
+ later. This is currently the suggested workaround provided by Hyva:
23
+ https://gitlab.hyva.io/hyva-checkout/checkout/-/issues/418
24
+ */
25
+ let component;
26
+ try {
27
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
28
+ } catch (error) {
29
+ await Livewire.onLoad(() => {
30
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
31
+ });
32
+ }
20
33
hyvaCheckout.payment.activate('rvvup_FAKE_PAYMENT_METHOD', {
21
34
placeOrderViaJs() {
22
35
return document.querySelector('[wire\\:key="rvvup_FAKE_PAYMENT_METHOD"].active') !== null;
Original file line number Diff line number Diff line change @@ -12,12 +12,25 @@ use Magento\Framework\Escaper;
12
12
<div wire:ignore>
13
13
<script>
14
14
(() => {
15
- window.addEventListener('checkout:payment:method-activate', event => {
15
+ window.addEventListener('checkout:payment:method-activate', async event => {
16
16
if (event.detail.method !== 'rvvup_GOOGLE_PAY') {
17
17
return;
18
18
}
19
19
20
- const component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
20
+ /*
21
+ This code finds the magewire component, but the workaround is required because the component may not be
22
+ immediately available when the script is executed. This is related to an issue in Hyva Checkout 1.3.0 or
23
+ later. This is currently the suggested workaround provided by Hyva:
24
+ https://gitlab.hyva.io/hyva-checkout/checkout/-/issues/418
25
+ */
26
+ let component;
27
+ try {
28
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
29
+ } catch (error) {
30
+ await Livewire.onLoad(() => {
31
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
32
+ });
33
+ }
21
34
hyvaCheckout.payment.activate('rvvup_GOOGLE_PAY', {
22
35
placeOrderViaJs() {
23
36
return document.querySelector('[wire\\:key="rvvup_GOOGLE_PAY"].active') !== null;
Original file line number Diff line number Diff line change @@ -12,12 +12,25 @@ use Magento\Framework\Escaper;
12
12
<div wire:ignore>
13
13
<script>
14
14
(() => {
15
- window.addEventListener('checkout:payment:method-activate', event => {
15
+ window.addEventListener('checkout:payment:method-activate', async event => {
16
16
if (event.detail.method !== 'rvvup_KLARNA') {
17
17
return;
18
18
}
19
19
20
- const component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
20
+ /*
21
+ This code finds the magewire component, but the workaround is required because the component may not be
22
+ immediately available when the script is executed. This is related to an issue in Hyva Checkout 1.3.0 or
23
+ later. This is currently the suggested workaround provided by Hyva:
24
+ https://gitlab.hyva.io/hyva-checkout/checkout/-/issues/418
25
+ */
26
+ let component;
27
+ try {
28
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
29
+ } catch (error) {
30
+ await Livewire.onLoad(() => {
31
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
32
+ });
33
+ }
21
34
hyvaCheckout.payment.activate('rvvup_KLARNA', {
22
35
placeOrderViaJs() {
23
36
return document.querySelector('[wire\\:key="rvvup_KLARNA"].active') !== null;
Original file line number Diff line number Diff line change @@ -12,12 +12,25 @@ use Magento\Framework\Escaper;
12
12
<div wire:ignore>
13
13
<script>
14
14
(() => {
15
- window.addEventListener('checkout:payment:method-activate', event => {
15
+ window.addEventListener('checkout:payment:method-activate', async event => {
16
16
if (event.detail.method !== 'rvvup_YAPILY') {
17
17
return;
18
18
}
19
19
20
- const component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
20
+ /*
21
+ This code finds the magewire component, but the workaround is required because the component may not be
22
+ immediately available when the script is executed. This is related to an issue in Hyva Checkout 1.3.0 or
23
+ later. This is currently the suggested workaround provided by Hyva:
24
+ https://gitlab.hyva.io/hyva-checkout/checkout/-/issues/418
25
+ */
26
+ let component;
27
+ try {
28
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
29
+ } catch (error) {
30
+ await Livewire.onLoad(() => {
31
+ component = Magewire.find('<?= $ escaper ->escapeJs ($ block ->getNameInLayout ()) ?> ');
32
+ });
33
+ }
21
34
hyvaCheckout.payment.activate('rvvup_YAPILY', {
22
35
placeOrderViaJs() {
23
36
return document.querySelector('[wire\\:key="rvvup_YAPILY"].active') !== null;
You can’t perform that action at this time.
0 commit comments