@rebilly/instruments 3.5.0-beta.0 → 3.6.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/index.min.js +3 -3
- package/package.json +1 -1
- package/src/events/index.js +1 -0
- package/src/functions/mount/index.js +5 -1
- package/src/style/components/accordion.js +13 -0
- package/src/style/components/button.js +1 -1
- package/src/style/payment-instruments/payment-instrument.js +12 -0
- package/src/views/common/iframe/base-iframe.js +2 -1
- package/src/views/method-selector/express-methods/apple-pay.js +9 -4
package/package.json
CHANGED
package/src/events/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import kebabCase from 'lodash.kebabcase';
|
|
|
2
2
|
import BaseEvent from './base-event';
|
|
3
3
|
|
|
4
4
|
const events = {
|
|
5
|
+
dataReady: new BaseEvent('data-ready'),
|
|
5
6
|
instrumentReady: new BaseEvent('instrument-ready'),
|
|
6
7
|
purchaseCompleted: new BaseEvent('purchase-completed'),
|
|
7
8
|
setupCompleted: new BaseEvent('setup-completed')
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { mountSummary } from '../../views/summary';
|
|
3
3
|
import { mountMethodSelector } from '../../views/method-selector';
|
|
4
4
|
import { fetchData } from './fetch-data';
|
|
5
|
+
import Events from '../../events';
|
|
5
6
|
import setupElement from './setup-element';
|
|
6
7
|
import setupStorefront from './setup-storefront';
|
|
7
8
|
import setupOptions from './setup-options';
|
|
@@ -96,9 +97,12 @@ export async function mount({
|
|
|
96
97
|
// Setup state
|
|
97
98
|
state.options = setupOptions({ options });
|
|
98
99
|
state.storefront = setupStorefront({ options });
|
|
100
|
+
|
|
99
101
|
state.mainStyle = await setupStyles({ options });
|
|
102
|
+
|
|
100
103
|
state.data = await fetchData({ state });
|
|
101
|
-
|
|
104
|
+
Events.dataReady.dispatch(state.data);
|
|
105
|
+
|
|
102
106
|
state.options.themeFramepay = await setupFramepayTheme({ state, options });
|
|
103
107
|
state.i18n = setupI18n({ state });
|
|
104
108
|
|
|
@@ -124,4 +124,17 @@ export const accordion = () => `
|
|
|
124
124
|
background: var(--rebilly-colorText);
|
|
125
125
|
opacity: 1;
|
|
126
126
|
}
|
|
127
|
+
|
|
128
|
+
@media screen and (max-width: 600px) {
|
|
129
|
+
.rebilly-instruments-accordion-summary .rebilly-instruments-accordion-brands figure:nth-child(2),
|
|
130
|
+
.rebilly-instruments-accordion-summary .rebilly-instruments-accordion-brands figure:nth-child(3) {
|
|
131
|
+
display: none;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@media screen and (max-width: 480px) {
|
|
136
|
+
.rebilly-instruments-accordion-summary .rebilly-instruments-accordion-brands {
|
|
137
|
+
display: none;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
127
140
|
`;
|
|
@@ -40,4 +40,16 @@ export const paymentInstrument = () => `
|
|
|
40
40
|
.rebilly-instruments-payment-instrument-exp {
|
|
41
41
|
color: var(--rebilly-colorMutedText);
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
@media screen and (max-width: 480px) {
|
|
45
|
+
.rebilly-instruments-payment-instrument-exp {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media screen and (max-width: 320px) {
|
|
51
|
+
.rebilly-instruments-payment-instrument-brand {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
43
55
|
`;
|
|
@@ -43,7 +43,8 @@ export default class BaseIframe {
|
|
|
43
43
|
model: this.model
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
component.frame.setAttribute('allowpaymentrequest',
|
|
46
|
+
component.frame.setAttribute('allowpaymentrequest', true);
|
|
47
|
+
component.frame.setAttribute('loading', 'lazy');
|
|
47
48
|
component.frame.setAttribute('allow', 'payment');
|
|
48
49
|
return component;
|
|
49
50
|
}
|
|
@@ -40,13 +40,18 @@ export default function mountApplePay({
|
|
|
40
40
|
container.style.height = digitalWallet.applePayDisplayOptions.buttonHeight;
|
|
41
41
|
|
|
42
42
|
if (!Rebilly.initialized) {
|
|
43
|
-
|
|
44
|
-
publishableKey: state.options.publishableKey,
|
|
45
|
-
organizationId: state.options.organizationId,
|
|
43
|
+
const options = {
|
|
46
44
|
transactionData: digitalWallet.transactionData,
|
|
47
45
|
methods: state.data.readyToPay,
|
|
48
46
|
applePay: digitalWallet.applePayDisplayOptions,
|
|
49
|
-
|
|
47
|
+
organizationId: state.options.organizationId
|
|
48
|
+
}
|
|
49
|
+
if (state.options.jwt && !state.options.publishableKey) {
|
|
50
|
+
options.jwt = state.options.jwt;
|
|
51
|
+
} else {
|
|
52
|
+
options.publishableKey = state.options.publishableKey;
|
|
53
|
+
}
|
|
54
|
+
Rebilly.initialize(options);
|
|
50
55
|
} else {
|
|
51
56
|
mountApplePayButton();
|
|
52
57
|
updateBtnStyling();
|