@rebilly/instruments 3.12.3-beta.0 → 3.13.2-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/README.md +1 -1
- package/dist/index.js +43 -66
- package/dist/index.min.js +43 -66
- package/package.json +3 -6
- package/src/functions/destroy.js +8 -2
- package/src/functions/mount/fetch-data.js +9 -2
- package/src/functions/mount/index.js +15 -10
- package/src/functions/mount/mount.spec.js +10 -11
- package/src/functions/mount/setup-framepay-theme.js +30 -72
- package/src/functions/mount/setup-options.js +2 -2
- package/src/functions/mount/{setup-styles.js → setup-styles-vars.js} +9 -7
- package/src/functions/purchase.js +2 -5
- package/src/functions/setup.js +3 -6
- package/src/functions/show.js +2 -2
- package/src/functions/show.spec.js +4 -4
- package/src/functions/update.spec.js +4 -3
- package/src/instance.js +4 -1
- package/src/loader/index.js +57 -33
- package/src/storefront/index.js +2 -5
- package/src/storefront/payment-instruments.js +7 -0
- package/src/style/base/__snapshots__/theme.spec.js.snap +136 -220
- package/src/style/base/default-theme.js +187 -14
- package/src/style/base/index.js +487 -79
- package/src/style/base/theme.js +3 -4
- package/src/style/base/theme.spec.js +2 -3
- package/src/style/index.js +4 -24
- package/src/style/utils/color-values.js +1 -1
- package/src/style/utils/minifyCss.js +14 -0
- package/src/views/common/iframe/base-iframe.js +3 -2
- package/src/views/common/iframe/event-listeners.js +12 -9
- package/src/views/common/iframe/method-iframe.js +3 -1
- package/src/views/common/iframe/modal-iframe.js +4 -2
- package/src/views/common/iframe/view-iframe.js +3 -1
- package/src/views/confirmation.js +12 -7
- package/src/views/errors.js +95 -0
- package/src/views/method-selector/express-methods.js +51 -0
- package/src/views/method-selector/generate-framepay-config.js +54 -0
- package/src/views/method-selector/generate-framepay-config.spec.js +195 -0
- package/src/views/method-selector/get-payment-methods.js +0 -1
- package/src/views/method-selector/index.js +45 -58
- package/src/views/method-selector/method-selector.spec.js +1 -1
- package/src/views/method-selector/mount-express-methods.js +66 -26
- package/src/views/modal.js +1 -1
- package/src/views/result.js +3 -3
- package/src/views/summary.js +24 -190
- package/tests/mocks/storefront-api-mock.js +48 -27
- package/src/style/browserslist.js +0 -1
- package/src/style/components/accordion.js +0 -140
- package/src/style/components/address.js +0 -55
- package/src/style/components/button.js +0 -117
- package/src/style/components/divider.js +0 -39
- package/src/style/components/forms/checkbox.js +0 -75
- package/src/style/components/forms/field.js +0 -56
- package/src/style/components/forms/form.js +0 -18
- package/src/style/components/forms/input.js +0 -77
- package/src/style/components/forms/label.js +0 -55
- package/src/style/components/forms/radio.js +0 -80
- package/src/style/components/forms/select.js +0 -86
- package/src/style/components/forms/validation.js +0 -72
- package/src/style/components/icons.js +0 -13
- package/src/style/components/index.js +0 -39
- package/src/style/components/loader.js +0 -41
- package/src/style/components/methods.js +0 -97
- package/src/style/components/overlay.js +0 -24
- package/src/style/helpers/index.js +0 -54
- package/src/style/payment-instruments/content.js +0 -8
- package/src/style/payment-instruments/index.js +0 -14
- package/src/style/payment-instruments/payment-card.js +0 -27
- package/src/style/payment-instruments/payment-instrument-list.js +0 -44
- package/src/style/payment-instruments/payment-instrument.js +0 -55
- package/src/style/utils/remove-empty-null.js +0 -10
- package/src/style/vendor/framepay.js +0 -28
- package/src/style/vendor/postmate.js +0 -18
- package/src/style/views/confirmation.js +0 -26
- package/src/style/views/index.js +0 -16
- package/src/style/views/method-selector.js +0 -11
- package/src/style/views/modal.js +0 -91
- package/src/style/views/result.js +0 -52
- package/src/style/views/summary.js +0 -118
- package/src/views/__snapshots__/summary.spec.js.snap +0 -246
- package/src/views/method-selector/express-methods/apple-pay.js +0 -92
- package/src/views/method-selector/express-methods/index.js +0 -25
- package/src/views/method-selector/mount-methods.js +0 -178
- package/src/views/summary.spec.js +0 -145
|
@@ -1,41 +1,81 @@
|
|
|
1
1
|
import mountExpressMethod from './express-methods';
|
|
2
|
-
import
|
|
2
|
+
import {generateFramepayConfig} from './generate-framepay-config'
|
|
3
3
|
import { getMethodData } from './get-method-data';
|
|
4
|
+
import Events from '../../events';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const browserIsSafari = () => window.ApplePaySession;
|
|
7
|
+
|
|
8
|
+
export async function mountExpressMethods({
|
|
6
9
|
state,
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
methods,
|
|
11
|
+
container
|
|
9
12
|
}) {
|
|
10
|
-
|
|
11
|
-
// Any DOM operation (innerHTML, append, etc) done on the parent div (EXPRESS_METHODS_CONTAINER) in between
|
|
12
|
-
// the two Postmate's instantiation (1 parent, 1 child) will cause the parent <-> child handshake to fail
|
|
13
|
-
EXPRESS_METHODS.forEach((expressMethod) => {
|
|
13
|
+
const methodIds = methods.map((expressMethod) => {
|
|
14
14
|
const { METHOD_ID } = getMethodData(expressMethod);
|
|
15
|
+
return METHOD_ID
|
|
16
|
+
});
|
|
17
|
+
const {Rebilly} = window;
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
if(!Rebilly?.initialized) {
|
|
20
|
+
await Rebilly?.initialize(
|
|
21
|
+
generateFramepayConfig({
|
|
22
|
+
state,
|
|
23
|
+
methodIds
|
|
24
|
+
})
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
methodIds.forEach((id) => {
|
|
29
|
+
// filter out apple pay unless in safari
|
|
30
|
+
if (id === 'apple-pay' && !browserIsSafari()) return
|
|
31
|
+
|
|
32
|
+
container.innerHTML += `
|
|
33
|
+
<div class="rebilly-instruments-${id}-method"></div>
|
|
18
34
|
`;
|
|
35
|
+
mountExpressMethod({
|
|
36
|
+
state,
|
|
37
|
+
id,
|
|
38
|
+
});
|
|
19
39
|
});
|
|
20
40
|
|
|
41
|
+
// HOTFIX: Hardcoded, use env variables in the future
|
|
42
|
+
const redirectUrl = state.options.apiMode === 'sandbox'
|
|
43
|
+
? 'https://forms-sandbox.secure-payments.app/approval-url?close=true'
|
|
44
|
+
: 'https://forms.secure-payments.app/approval-url?close=true';
|
|
45
|
+
|
|
46
|
+
Rebilly?.on('token-ready', (token) => {
|
|
47
|
+
const instrumentReadyPayload = {
|
|
48
|
+
websiteId: state.options.websiteId,
|
|
49
|
+
billingAddress: token.billingAddress,
|
|
50
|
+
redirectUrl,
|
|
51
|
+
_raw: token
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
if (state.data?.isShippingRequired) {
|
|
55
|
+
if (token.shippingAddress) {
|
|
56
|
+
instrumentReadyPayload.deliveryAddress = token.shippingAddress;
|
|
57
|
+
} else {
|
|
58
|
+
instrumentReadyPayload.deliveryAddress = instrumentReadyPayload.billingAddress;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
21
61
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
62
|
+
if (Array.isArray(instrumentReadyPayload.billingAddress?.emails)) {
|
|
63
|
+
const email = instrumentReadyPayload.billingAddress.emails
|
|
64
|
+
.find(e => e.label === 'main')
|
|
25
65
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
METHOD_ID,
|
|
30
|
-
METHOD_TYPE,
|
|
31
|
-
EXPRESS_METHODS,
|
|
32
|
-
EXPRESS_METHODS_CONTAINER
|
|
33
|
-
});
|
|
34
|
-
} else {
|
|
35
|
-
mountExpressMethod({
|
|
36
|
-
state,
|
|
37
|
-
METHOD_ID
|
|
38
|
-
})
|
|
66
|
+
if (email?.value) {
|
|
67
|
+
instrumentReadyPayload.billingAddress.email = email.value;
|
|
68
|
+
}
|
|
39
69
|
}
|
|
70
|
+
if (Array.isArray(instrumentReadyPayload.deliveryAddress?.emails)) {
|
|
71
|
+
const email = instrumentReadyPayload.deliveryAddress.emails
|
|
72
|
+
.find(e => e.label === 'main')
|
|
73
|
+
|
|
74
|
+
if (email?.value) {
|
|
75
|
+
instrumentReadyPayload.deliveryAddress.email = email.value;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
Events.instrumentReady.dispatch(instrumentReadyPayload);
|
|
40
80
|
});
|
|
41
81
|
}
|
package/src/views/modal.js
CHANGED
|
@@ -46,7 +46,7 @@ export async function mountModal({
|
|
|
46
46
|
modalContainer.classList.add('is-visible');
|
|
47
47
|
}, 240);
|
|
48
48
|
state.loader.addDOMElement({ section: 'modal', el: modalContent });
|
|
49
|
-
state.loader.startLoading({ section: 'modal', id:
|
|
49
|
+
state.loader.startLoading({ section: 'modal', id: name });
|
|
50
50
|
|
|
51
51
|
const injectedModel = {
|
|
52
52
|
options: state.options,
|
package/src/views/result.js
CHANGED
|
@@ -5,7 +5,7 @@ export async function mountResult({ payload, state }) {
|
|
|
5
5
|
const resultContainerClassName = 'rebilly-instruments-result';
|
|
6
6
|
replaceContent(state.form, `<div class="${resultContainerClassName}"></div>`);
|
|
7
7
|
|
|
8
|
-
state.loader.startLoading({ id: 'result' });
|
|
8
|
+
state.loader.startLoading({ id: 'rebilly-instruments-result' });
|
|
9
9
|
state.loader.stopLoading({ id: 'express-purchase' });
|
|
10
10
|
|
|
11
11
|
const container = document.querySelector(`.${resultContainerClassName}`);
|
|
@@ -13,7 +13,7 @@ export async function mountResult({ payload, state }) {
|
|
|
13
13
|
|
|
14
14
|
const model = {
|
|
15
15
|
options: state.options,
|
|
16
|
-
|
|
16
|
+
mainStyleVars: state.mainStyleVars,
|
|
17
17
|
[state.options.transactionType]: payload
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -27,5 +27,5 @@ export async function mountResult({ payload, state }) {
|
|
|
27
27
|
loader: state.loader
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
state.iframeComponents.push(iframe);
|
|
30
|
+
state.iframeComponents.form.push(iframe);
|
|
31
31
|
}
|
package/src/views/summary.js
CHANGED
|
@@ -1,200 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { fetchData } from '../functions/mount/fetch-data';
|
|
1
|
+
import { ViewIframe } from './common/iframe';
|
|
2
|
+
import { fetchSummary } from '../storefront/summary';
|
|
4
3
|
|
|
5
|
-
export function
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const {
|
|
12
|
-
items: optionItems = []
|
|
13
|
-
} = state.options;
|
|
14
|
-
const hasThumbnails = optionItems?.some((optionItem) => optionItem.thumbnail);
|
|
15
|
-
const { thumbnail = null } = optionItems.find(
|
|
16
|
-
(optionItem) => optionItem.planId === lineItem.planId
|
|
17
|
-
) || {};
|
|
18
|
-
|
|
19
|
-
const { name } = products.find(
|
|
20
|
-
(product) => product.id === lineItem.productId
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
return `
|
|
24
|
-
<div class="rebilly-instruments-summary-line-item">
|
|
25
|
-
${
|
|
26
|
-
hasThumbnails
|
|
27
|
-
? `
|
|
28
|
-
<figure class="rebilly-instruments-summary-line-item-figure">
|
|
29
|
-
${thumbnail ? `<img src="${thumbnail}" alt="${name}">` : ''}
|
|
30
|
-
</figure>
|
|
31
|
-
`
|
|
32
|
-
: ''
|
|
33
|
-
}
|
|
34
|
-
<div class="rebilly-instruments-summary-line-item-synopsis">
|
|
35
|
-
<p class="rebilly-instruments-summary-line-item-synopsis-title">${name}</p>
|
|
36
|
-
${
|
|
37
|
-
lineItem.description
|
|
38
|
-
? `
|
|
39
|
-
<p class="rebilly-instruments-summary-line-item-synopsis-description">${lineItem.description}</p>
|
|
40
|
-
`
|
|
41
|
-
: ''
|
|
42
|
-
}
|
|
43
|
-
</div>
|
|
44
|
-
<div class="rebilly-instruments-summary-line-item-price-breakdown">
|
|
45
|
-
<p class="rebilly-instruments-summary-line-item-price-breakdown-quantity">${
|
|
46
|
-
lineItem.quantity
|
|
47
|
-
}</p>
|
|
48
|
-
<svg class="rebilly-instruments-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
49
|
-
<path d="M12 10.5858l2.8284-2.8284c.3906-.3906 1.0237-.3906 1.4142 0 .3906.3905.3906 1.0236 0 1.4142L13.4142 12l2.8284 2.8284c.3906.3906.3906 1.0237 0 1.4142-.3905.3906-1.0236.3906-1.4142 0L12 13.4142l-2.8284 2.8284c-.3906.3906-1.0237.3906-1.4142 0-.3906-.3905-.3906-1.0236 0-1.4142L10.5858 12 7.7574 9.1716c-.3906-.3906-.3906-1.0237 0-1.4142.3905-.3906 1.0236-.3906 1.4142 0L12 10.5858z" fill-rule="nonzero"/>
|
|
50
|
-
</svg>
|
|
51
|
-
<p class="rebilly-instruments-summary-line-item-price-breakdown-unit-price">${formatCurrency(
|
|
52
|
-
lineItem.unitPrice,
|
|
53
|
-
currency
|
|
54
|
-
)}</p>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
`;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export function summaryBreakdownHTML({state, element}) {
|
|
61
|
-
const {
|
|
62
|
-
amount = null,
|
|
63
|
-
currency = null,
|
|
64
|
-
discountsAmount = null,
|
|
65
|
-
shippingAmount = null,
|
|
66
|
-
subtotalAmount = null,
|
|
67
|
-
taxAmount = null,
|
|
68
|
-
} = {
|
|
69
|
-
...state.data.amountAndCurrency,
|
|
70
|
-
...state.data.summaryItems
|
|
4
|
+
export async function mountSummary({ state }) {
|
|
5
|
+
const model = {
|
|
6
|
+
options: state.options,
|
|
7
|
+
data: state.data.toPostmatesModel(),
|
|
8
|
+
mainStyleVars: state.mainStyleVars,
|
|
71
9
|
};
|
|
10
|
+
const { paymentMethodsUrl } = state.options._computed;
|
|
72
11
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
{
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
i18n: 'summary.subTotal',
|
|
79
|
-
value: subtotalAmount,
|
|
80
|
-
show: true,
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
label: 'Discounts',
|
|
84
|
-
class: 'discounts',
|
|
85
|
-
i18n: 'summary.discounts',
|
|
86
|
-
value: discountsAmount,
|
|
87
|
-
show: discountsAmount > 0
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
label: 'Taxes',
|
|
91
|
-
class: 'taxes',
|
|
92
|
-
i18n: 'summary.taxes',
|
|
93
|
-
value: taxAmount,
|
|
94
|
-
show: true,
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
label: 'Shipping',
|
|
98
|
-
class: 'shipping',
|
|
99
|
-
i18n: 'summary.shipping',
|
|
100
|
-
value: shippingAmount,
|
|
101
|
-
show: state.data.isShippingRequired,
|
|
102
|
-
},
|
|
103
|
-
].filter(({value}) => value !== null)
|
|
104
|
-
.forEach(item => {
|
|
105
|
-
if (!table) {
|
|
106
|
-
table = document.createElement('table');
|
|
107
|
-
table.insertAdjacentHTML('beforeend', `
|
|
108
|
-
<colgroup>
|
|
109
|
-
<col>
|
|
110
|
-
<col>
|
|
111
|
-
</colgroup>
|
|
112
|
-
`);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (item.show) {
|
|
116
|
-
const row = document.createElement('tr');
|
|
117
|
-
row.setAttribute('class', `rebilly-instruments-summary-breakdown-${item.class}`)
|
|
118
|
-
row.insertAdjacentHTML('beforeend', `
|
|
119
|
-
<td data-rebilly-i18n="${item.i18n}">${item.label}</td>
|
|
120
|
-
<td>${formatCurrency(item.value, currency)}</td>
|
|
121
|
-
`);
|
|
122
|
-
table.appendChild(row);
|
|
123
|
-
}
|
|
12
|
+
const iframe = await new ViewIframe({
|
|
13
|
+
name: 'rebilly-instruments-summary',
|
|
14
|
+
url: `${paymentMethodsUrl}/summary`,
|
|
15
|
+
container: state.summary,
|
|
16
|
+
model
|
|
124
17
|
});
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const totalElement = document.createElement('div');
|
|
130
|
-
totalElement.setAttribute('class', 'rebilly-instruments-summary-breakdown-total');
|
|
131
|
-
totalElement.insertAdjacentHTML('beforeend', `
|
|
132
|
-
<p data-rebilly-i18n="summary.total">Total</p>
|
|
133
|
-
<p class="rebilly-instruments-summary-breakdown-total-amount">
|
|
134
|
-
<span class="rebilly-instruments-summary-breakdown-total-amount-currency">
|
|
135
|
-
${currency}
|
|
136
|
-
</span>
|
|
137
|
-
${formatCurrency(amount, currency)}
|
|
138
|
-
<p>
|
|
139
|
-
`);
|
|
140
|
-
element.appendChild(totalElement);
|
|
141
|
-
|
|
142
|
-
return element;
|
|
18
|
+
iframe.bindEventListeners({loader: state.loader});
|
|
19
|
+
state.iframeComponents.summary.push(iframe);
|
|
143
20
|
}
|
|
144
21
|
|
|
145
|
-
export async function
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
if (lineItems) {
|
|
151
|
-
const lineItemsElement = document.createElement('div');
|
|
152
|
-
lineItemsElement.setAttribute('class', 'rebilly-instruments-summary-line-items');
|
|
153
|
-
|
|
154
|
-
lineItems.forEach((lineItem) => {
|
|
155
|
-
lineItemsElement.insertAdjacentHTML('beforeend', lineItemHTML({ state, lineItem }));
|
|
156
|
-
});
|
|
157
|
-
contentContainer.appendChild(lineItemsElement);
|
|
22
|
+
export async function updateSummary({ state, instrument }) {
|
|
23
|
+
await fetchSummary({data: instrument, state});
|
|
24
|
+
const updateModel = {
|
|
25
|
+
data: state.data.toPostmatesModel(),
|
|
26
|
+
options: state.options
|
|
158
27
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
state.summary.appendChild(contentContainer);
|
|
165
|
-
state.summary.style.minHeight = '';
|
|
166
|
-
|
|
167
|
-
state.translate.translateItems();
|
|
168
|
-
state.loader.stopLoading({ section: 'summary', id: 'initSummary' });
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export async function updateSummary({ state, instrument = null }) {
|
|
172
|
-
state.loader.startLoading({ section: 'summary', id: 'initSummary' });
|
|
173
|
-
const { riskMetadata } = await collectData();
|
|
174
|
-
|
|
175
|
-
let summaryPayload;
|
|
176
|
-
|
|
177
|
-
if (instrument?.billingAddress) {
|
|
178
|
-
summaryPayload = {
|
|
179
|
-
billingAddress: instrument.billingAddress
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
state.data = await fetchData({
|
|
184
|
-
riskMetadata,
|
|
185
|
-
summaryPayload,
|
|
186
|
-
state
|
|
28
|
+
Object.values(state.iframeComponents).forEach(components => {
|
|
29
|
+
components.forEach(frame => {
|
|
30
|
+
frame.component.call('update', updateModel);
|
|
31
|
+
});
|
|
187
32
|
});
|
|
188
|
-
|
|
189
|
-
if (state.data.transaction && state.data.transaction?.type === 'setup') {
|
|
190
|
-
state.options.transactionType = 'setup';
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
const itemsContainer = state.summary.querySelector(
|
|
194
|
-
'.rebilly-instruments-content'
|
|
195
|
-
);
|
|
196
|
-
itemsContainer?.remove();
|
|
197
|
-
|
|
198
|
-
mountSummary({ state });
|
|
199
33
|
}
|
|
200
34
|
|
|
@@ -3,31 +3,52 @@ import {ok, get, post} from 'msw-when-then';
|
|
|
3
3
|
export const storefrontURL = '*/storefront';
|
|
4
4
|
|
|
5
5
|
export const initStoreFrontApiMocks = (when) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
6
|
+
const mocks = [
|
|
7
|
+
/* GET */
|
|
8
|
+
{
|
|
9
|
+
url: '/account',
|
|
10
|
+
method: get,
|
|
11
|
+
response: () => ok({})
|
|
12
|
+
}, {
|
|
13
|
+
url: '/plans',
|
|
14
|
+
method: get,
|
|
15
|
+
response: () => ok([])
|
|
16
|
+
}, {
|
|
17
|
+
url: '/products',
|
|
18
|
+
method: get,
|
|
19
|
+
response: () => ok([])
|
|
20
|
+
}, {
|
|
21
|
+
url: '/payment-instruments',
|
|
22
|
+
method: get,
|
|
23
|
+
response: () => ok([])
|
|
24
|
+
}, {
|
|
25
|
+
url: '/transactions/test-transaction-id',
|
|
26
|
+
method: get,
|
|
27
|
+
response: () => ok({})
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
/* POST */
|
|
31
|
+
{
|
|
32
|
+
url: '/ready-to-pay',
|
|
33
|
+
method: post,
|
|
34
|
+
response: () => ok([])
|
|
35
|
+
}, {
|
|
36
|
+
url: '/preview-purchase',
|
|
37
|
+
method: post,
|
|
38
|
+
response: () => ok({})
|
|
39
|
+
}, {
|
|
40
|
+
url: '/payment-instruments',
|
|
41
|
+
method: post,
|
|
42
|
+
response: () => ok([])
|
|
43
|
+
}, {
|
|
44
|
+
url: '/payment-instruments/*/setup',
|
|
45
|
+
method: post,
|
|
46
|
+
response: () => ok([])
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
mocks.forEach(api => {
|
|
51
|
+
const http = api.method(`${storefrontURL}${api.url}`)
|
|
52
|
+
when(http).thenReturn(api.response());
|
|
53
|
+
});
|
|
33
54
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const browserslist = ['> 1%', 'last 2 versions'];
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
// -----------------------------------------------------------------------------
|
|
2
|
-
// This file contains all styles related to the accordion component.
|
|
3
|
-
// -----------------------------------------------------------------------------
|
|
4
|
-
|
|
5
|
-
export const accordion = () => `
|
|
6
|
-
/* ACCORDION CLOSED */
|
|
7
|
-
.rebilly-instruments-accordion {
|
|
8
|
-
border: 1px solid var(--rebilly-colorMutedBorder);
|
|
9
|
-
padding: 0 calc(var(--rebilly-spacings-m) - var(--rebilly-spacings-2xs));
|
|
10
|
-
background: var(--rebilly-colorBackground);
|
|
11
|
-
transition: border 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
|
|
12
|
-
margin: var(--rebilly-spacings-s) 0;
|
|
13
|
-
border-radius: var(--rebilly-borderRadius);
|
|
14
|
-
overflow: hidden;
|
|
15
|
-
opacity: 0.7;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.rebilly-instruments-accordion:hover {
|
|
19
|
-
opacity: 1;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.rebilly-instruments-accordion:first-of-type {
|
|
23
|
-
margin-top: 0;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.rebilly-instruments-accordion:last-of-type {
|
|
27
|
-
margin-bottom: 0;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.rebilly-instruments-accordion .rebilly-instruments-accordion-summary::-webkit-details-marker {
|
|
31
|
-
display: none;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.rebilly-instruments-accordion .rebilly-instruments-accordion-summary {
|
|
35
|
-
cursor: pointer;
|
|
36
|
-
display: flex;
|
|
37
|
-
align-items: center;
|
|
38
|
-
list-style: none;
|
|
39
|
-
padding: calc(var(--rebilly-spacings-m) - var(--rebilly-spacings-s)) calc(var(--rebilly-spacings-m) - var(--rebilly-spacings-2xs));
|
|
40
|
-
margin: 0px calc(-1 * calc(var(--rebilly-spacings-m) - var(--rebilly-spacings-2xs)));
|
|
41
|
-
background: var(--rebilly-colorBackground);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.rebilly-instruments-accordion-summary .rebilly-instruments-accordion-summary-checkmark {
|
|
45
|
-
position: relative;
|
|
46
|
-
width: calc(var(--rebilly-spacings-m) - var(--rebilly-spacings-2xs));
|
|
47
|
-
height: calc(var(--rebilly-spacings-m) - var(--rebilly-spacings-2xs));
|
|
48
|
-
border-radius: 50%;
|
|
49
|
-
opacity: 0;
|
|
50
|
-
background: var(--rebilly-colorText);
|
|
51
|
-
margin-left: var(--rebilly-spacings-m);
|
|
52
|
-
transition: all 0.2s ease;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.rebilly-instruments-accordion-summary .rebilly-instruments-accordion-summary-checkmark::after {
|
|
56
|
-
content: '';
|
|
57
|
-
position: absolute;
|
|
58
|
-
border: solid var(--rebilly-colorBackground);
|
|
59
|
-
width: calc(var(--rebilly-spacings-xs) + var(--rebilly-spacings-2xs));
|
|
60
|
-
height: calc(var(--rebilly-spacings-xs) - var(--rebilly-spacings-2xs) + 2px);
|
|
61
|
-
border-width: 2px 2px 0 0;
|
|
62
|
-
border-radius: 2px;
|
|
63
|
-
top: 50%;
|
|
64
|
-
left: 50%;
|
|
65
|
-
transform: translateY(-60%) translateX(-50%) rotate(135deg);
|
|
66
|
-
transition: all 0.2s ease;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.rebilly-instruments-accordion-summary:hover .rebilly-instruments-accordion-summary-checkmark {
|
|
70
|
-
opacity: 0.5;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.rebilly-instruments-accordion .rebilly-instruments-accordion-summary > img {
|
|
74
|
-
margin-right: var(--rebilly-spacings-s);
|
|
75
|
-
height: auto;
|
|
76
|
-
max-width: 40px;
|
|
77
|
-
width: 100%;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.rebilly-instruments-accordion-summary .rebilly-instruments-accordion-title {
|
|
81
|
-
margin: 0;
|
|
82
|
-
font-weight: 500;
|
|
83
|
-
flex: 2;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.rebilly-instruments-accordion-summary .rebilly-instruments-accordion-brands {
|
|
87
|
-
display: inline-flex;
|
|
88
|
-
justify-content: flex-end;
|
|
89
|
-
align-items: center;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.rebilly-instruments-accordion-summary .rebilly-instruments-accordion-brands figure {
|
|
93
|
-
margin: auto;
|
|
94
|
-
padding: 0;
|
|
95
|
-
height: 26px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.rebilly-instruments-accordion-summary .rebilly-instruments-accordion-brands figure img {
|
|
99
|
-
width: auto;
|
|
100
|
-
height: 100%;
|
|
101
|
-
border-radius: var(--rebilly-borderRadius);
|
|
102
|
-
margin-right: var(--rebilly-spacings-xs);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.rebilly-instruments-accordion-summary .rebilly-instruments-accordion-brands span {
|
|
106
|
-
color: var(--rebilly-colorMutedText);
|
|
107
|
-
margin: 0 0 0 var(--rebilly-spacings-xs);
|
|
108
|
-
font-size: calc(var(--rebilly-fontSizeBase) * 0.875);
|
|
109
|
-
line-height: 1;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/* ACCORDION OPENED */
|
|
113
|
-
.rebilly-instruments-accordion[open] {
|
|
114
|
-
padding: 0 calc(var(--rebilly-spacings-m) - var(--rebilly-spacings-2xs)) calc(var(--rebilly-spacings-m) - var(--rebilly-spacings-2xs));
|
|
115
|
-
opacity: 1;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.rebilly-instruments-accordion[open] .rebilly-instruments-accordion-summary {
|
|
119
|
-
border-bottom: 1px solid var(--rebilly-colorMutedBorder);
|
|
120
|
-
margin-bottom: calc(var(--rebilly-spacings-m) - var(--rebilly-spacings-2xs));
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.rebilly-instruments-accordion[open] .rebilly-instruments-accordion-summary .rebilly-instruments-accordion-summary-checkmark {
|
|
124
|
-
background: var(--rebilly-colorText);
|
|
125
|
-
opacity: 1;
|
|
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
|
-
}
|
|
140
|
-
`;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// -----------------------------------------------------------------------------
|
|
2
|
-
// This file contains all styles related to the address component.
|
|
3
|
-
// -----------------------------------------------------------------------------
|
|
4
|
-
export const address = () => `
|
|
5
|
-
/**
|
|
6
|
-
* Address
|
|
7
|
-
*/
|
|
8
|
-
.rebilly-instruments-address {
|
|
9
|
-
margin: 0 0 var(--rebilly-spacings-base);
|
|
10
|
-
color: var(--rebilly-colorMutedText);
|
|
11
|
-
font-style: normal;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Address Name: Default
|
|
16
|
-
*/
|
|
17
|
-
.rebilly-instruments-address-name-default {
|
|
18
|
-
/* No style changes */
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Address Name: Combined
|
|
23
|
-
*/
|
|
24
|
-
.rebilly-instruments-address-name-combined {
|
|
25
|
-
/* No style changes */
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Address Name: Stacked
|
|
30
|
-
*/
|
|
31
|
-
.rebilly-instruments-address-name-stacked {
|
|
32
|
-
/* No style changes */
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Address Region: Default
|
|
37
|
-
*/
|
|
38
|
-
.rebilly-instruments-address-region-default {
|
|
39
|
-
/* No style changes */
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Address Region: Split
|
|
44
|
-
*/
|
|
45
|
-
.rebilly-instruments-address-region-split {
|
|
46
|
-
/* No style changes */
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Address Name: Stacked
|
|
51
|
-
*/
|
|
52
|
-
.rebilly-instruments-address-region-stacked {
|
|
53
|
-
/* No style changes */
|
|
54
|
-
}
|
|
55
|
-
`;
|