@riosst100/pwa-marketplace 2.5.1 → 2.5.3
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/package.json +1 -1
- package/src/components/LiveChat/liveChat.js +1 -1
- package/src/components/ProductItem/index.js +1 -1
- package/src/components/RFQ/modalRfq.js +1 -1
- package/src/components/RFQPage/quoteDetail.js +1 -1
- package/src/components/RMAPage/RMACreate.js +1 -1
- package/src/components/RMAPage/RMADetail.js +1 -1
- package/src/components/SetsData/setsData.js +7 -27
- package/src/components/Xendit/summary.js +71 -0
- package/src/components/Xendit/summary.module.css +23 -0
- package/src/components/Xendit/xendit.js +348 -0
- package/src/components/Xendit/xendit.module.css +58 -0
- package/src/intercept.js +14 -0
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderSummary/orderSummary.js +1 -1
- package/src/overwrites/venia-ui/lib/components/CheckoutPage/PaymentInformation/paymentMethods.js +9 -0
- package/src/talons/Xendit/useXendit.js +574 -0
- package/src/talons/Xendit/xendit.js +165 -0
package/package.json
CHANGED
|
@@ -137,13 +137,13 @@ const SetsData = props => {
|
|
|
137
137
|
);
|
|
138
138
|
|
|
139
139
|
if (parseInt(products_count) > 0) {
|
|
140
|
-
setsResult.push(<li className='list-none'>
|
|
140
|
+
setsResult.push(<li key={index} className='list-none'>
|
|
141
141
|
<Link to={categoryUrl} className="hover_bg-darkblue-900 hover_text-white w-full block text-[14px] py-[2px] px-0">
|
|
142
142
|
{set_name} <span className='text-[12px]'>({products_count})</span>
|
|
143
143
|
</Link>
|
|
144
144
|
</li>)
|
|
145
145
|
} else {
|
|
146
|
-
setsResult.push(<li className='list-none'>
|
|
146
|
+
setsResult.push(<li key={index} className='list-none'>
|
|
147
147
|
<span className="text-[#8f8f8f] w-full block text-[14px] py-[2px] px-0">
|
|
148
148
|
{set_name} <span className='text-[12px]'>({products_count})</span>
|
|
149
149
|
</span>
|
|
@@ -264,26 +264,6 @@ const SetsData = props => {
|
|
|
264
264
|
<Fragment>
|
|
265
265
|
<StoreTitle>{title}</StoreTitle>
|
|
266
266
|
<Breadcrumbs categoryId={categoryId} currentFilter={activeFilters} customPage={shopby == "singles" ? "Mini-Figures" : title} />
|
|
267
|
-
{/* <ul className={classes.nav}>
|
|
268
|
-
<li className={classes.nav_item}>
|
|
269
|
-
<button
|
|
270
|
-
onClick={() => {
|
|
271
|
-
handleActiveTab('year')
|
|
272
|
-
}}
|
|
273
|
-
>
|
|
274
|
-
{activeTab == 'year' ? <b>{byYearTitle}</b> : byYearTitle}
|
|
275
|
-
</button>
|
|
276
|
-
</li>
|
|
277
|
-
<li className={classes.nav_item}>
|
|
278
|
-
<button
|
|
279
|
-
onClick={() => {
|
|
280
|
-
handleActiveTab('all')
|
|
281
|
-
}}
|
|
282
|
-
>
|
|
283
|
-
{activeTab == 'all' ? <b>{allSetsTitle}</b> : allSetsTitle}
|
|
284
|
-
</button>
|
|
285
|
-
</li>
|
|
286
|
-
</ul> */}
|
|
287
267
|
{shopby == "secret_lair" ? <>
|
|
288
268
|
<ul className={classes.nav}>
|
|
289
269
|
{availableYears.map((group, index) => (
|
|
@@ -297,7 +277,7 @@ const SetsData = props => {
|
|
|
297
277
|
</button>
|
|
298
278
|
</li>
|
|
299
279
|
))}
|
|
300
|
-
<li className={classes.nav_item}>
|
|
280
|
+
<li key={"all"} className={classes.nav_item}>
|
|
301
281
|
<button
|
|
302
282
|
onClick={() => {
|
|
303
283
|
handleActiveYear('')
|
|
@@ -321,7 +301,7 @@ const SetsData = props => {
|
|
|
321
301
|
</button>
|
|
322
302
|
</li>
|
|
323
303
|
))}
|
|
324
|
-
<li className={classes.nav_item}>
|
|
304
|
+
<li key={"all"} className={classes.nav_item}>
|
|
325
305
|
<button
|
|
326
306
|
onClick={() => {
|
|
327
307
|
handleActiveFilter('')
|
|
@@ -347,7 +327,7 @@ const SetsData = props => {
|
|
|
347
327
|
</button>
|
|
348
328
|
</li>
|
|
349
329
|
))}
|
|
350
|
-
<li className={classes.nav_item}>
|
|
330
|
+
<li key={'all'} className={classes.nav_item}>
|
|
351
331
|
<button
|
|
352
332
|
onClick={() => {
|
|
353
333
|
handleActive('all')
|
|
@@ -369,7 +349,7 @@ const SetsData = props => {
|
|
|
369
349
|
</button>
|
|
370
350
|
</li>
|
|
371
351
|
))}
|
|
372
|
-
{availableGroups && availableGroups.length ? <li className={classes.nav_item}>
|
|
352
|
+
{availableGroups && availableGroups.length ? <li key={'all'} className={classes.nav_item}>
|
|
373
353
|
<button
|
|
374
354
|
onClick={() => {
|
|
375
355
|
handleActive('all')
|
|
@@ -390,7 +370,7 @@ const SetsData = props => {
|
|
|
390
370
|
) : ''}
|
|
391
371
|
{shopby != "secret_lair" && <section className='single_list-indexing-container relative m-auto pt-5'>
|
|
392
372
|
{shopby != "secret_lair" && !activeFilter && activeTab != "year" && <ul className='flex gap-2 justify-center flex-wrap'>
|
|
393
|
-
<li>
|
|
373
|
+
<li key={'all'}>
|
|
394
374
|
<button
|
|
395
375
|
className={cn(
|
|
396
376
|
'rounded-md border border-solid border-gray-100 p-2 min-w-[28px]',
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormattedMessage } from 'react-intl';
|
|
3
|
+
import { shape, string, func } from 'prop-types';
|
|
4
|
+
|
|
5
|
+
import { useSummary } from '@magento/peregrine/lib/talons/CheckoutPage/PaymentInformation/useSummary';
|
|
6
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
+
|
|
8
|
+
import defaultClasses from './summary.module.css';
|
|
9
|
+
import LoadingIndicator from '@magento/venia-ui/lib/components/LoadingIndicator';
|
|
10
|
+
import summaryPayments from '@magento/venia-ui/lib/components/CheckoutPage/PaymentInformation/summaryPaymentCollection';
|
|
11
|
+
|
|
12
|
+
const Summary = props => {
|
|
13
|
+
const { classes: propClasses, onEdit } = props;
|
|
14
|
+
const classes = useStyle(defaultClasses, propClasses);
|
|
15
|
+
|
|
16
|
+
const talonProps = useSummary();
|
|
17
|
+
|
|
18
|
+
const { isLoading, selectedPaymentMethod } = talonProps;
|
|
19
|
+
|
|
20
|
+
if (isLoading && !selectedPaymentMethod) {
|
|
21
|
+
return (
|
|
22
|
+
<LoadingIndicator classes={{ root: classes.loading }}>
|
|
23
|
+
<FormattedMessage
|
|
24
|
+
id={'checkoutPage.loadingPaymentInformation'}
|
|
25
|
+
defaultMessage={'Fetching Payment Information'}
|
|
26
|
+
/>
|
|
27
|
+
</LoadingIndicator>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const hasCustomSummaryComp = Object.keys(summaryPayments).includes(
|
|
32
|
+
selectedPaymentMethod.code
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
if (hasCustomSummaryComp) {
|
|
36
|
+
const SummaryPaymentMethodComponent =
|
|
37
|
+
summaryPayments[selectedPaymentMethod.code];
|
|
38
|
+
return <SummaryPaymentMethodComponent onEdit={onEdit} />;
|
|
39
|
+
} else {
|
|
40
|
+
return (
|
|
41
|
+
<div className={classes.root}>
|
|
42
|
+
<div className={classes.heading_container}>
|
|
43
|
+
<h5 className={classes.heading}>
|
|
44
|
+
<FormattedMessage
|
|
45
|
+
id={'checkoutPage.paymentInformation'}
|
|
46
|
+
defaultMessage={'Payment Information'}
|
|
47
|
+
/>
|
|
48
|
+
</h5>
|
|
49
|
+
</div>
|
|
50
|
+
<div className={classes.card_details_container}>
|
|
51
|
+
<span className={classes.payment_details}>
|
|
52
|
+
{selectedPaymentMethod.title}
|
|
53
|
+
</span>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export default Summary;
|
|
61
|
+
|
|
62
|
+
Summary.propTypes = {
|
|
63
|
+
classes: shape({
|
|
64
|
+
root: string,
|
|
65
|
+
heading_container: string,
|
|
66
|
+
heading: string,
|
|
67
|
+
card_details_container: string,
|
|
68
|
+
payment_details: string
|
|
69
|
+
}),
|
|
70
|
+
onEdit: func.isRequired
|
|
71
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: gap-xs from global;
|
|
3
|
+
composes: grid from global;
|
|
4
|
+
composes: p-md from global;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.heading_container {
|
|
8
|
+
composes: grid from global;
|
|
9
|
+
composes: grid-cols-1 from global;
|
|
10
|
+
composes: grid-flow-col from global;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.heading {
|
|
14
|
+
composes: font-semibold from global;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.card_details_container {
|
|
18
|
+
composes: gap-2xs from global;
|
|
19
|
+
composes: grid from global;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.payment_details {
|
|
23
|
+
}
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import React, { useMemo, useCallback } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { bool, func, shape, string } from 'prop-types';
|
|
4
|
+
import { useXendit } from '@riosst100/src/talons/Xendit/useXendit';
|
|
5
|
+
|
|
6
|
+
import { isRequired } from '@magento/venia-ui/lib/util/formValidators';
|
|
7
|
+
import Country from '@magento/venia-ui/lib/components/Country';
|
|
8
|
+
import Region from '@magento/venia-ui/lib/components/Region';
|
|
9
|
+
import Postcode from '@magento/venia-ui/lib/components/Postcode';
|
|
10
|
+
import Checkbox from '@magento/venia-ui/lib/components/Checkbox';
|
|
11
|
+
import Field from '@magento/venia-ui/lib/components/Field';
|
|
12
|
+
import TextInput from '@magento/venia-ui/lib/components/TextInput';
|
|
13
|
+
import BrainTreeDropin from './brainTreeDropIn';
|
|
14
|
+
import LoadingIndicator from '@magento/venia-ui/lib/components/LoadingIndicator';
|
|
15
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
16
|
+
|
|
17
|
+
import defaultClasses from './xendit.module.css';
|
|
18
|
+
import FormError from '@magento/venia-ui/lib/components/FormError';
|
|
19
|
+
import GoogleReCaptcha from '@magento/venia-ui/lib/components/GoogleReCaptcha';
|
|
20
|
+
|
|
21
|
+
const STEP_DESCRIPTIONS = [
|
|
22
|
+
{ defaultMessage: 'Loading Payment', id: 'checkoutPage.step0' },
|
|
23
|
+
{
|
|
24
|
+
defaultMessage: 'Checking Credit Card Information',
|
|
25
|
+
id: 'checkoutPage.step1'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
defaultMessage: 'Checking Credit Card Information',
|
|
29
|
+
id: 'checkoutPage.step2'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
defaultMessage: 'Checking Credit Card Information',
|
|
33
|
+
id: 'checkoutPage.step3'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
defaultMessage: 'Saved Credit Card Information Successfully',
|
|
37
|
+
id: 'checkoutPage.step4'
|
|
38
|
+
}
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The initial view for the Braintree payment method.
|
|
43
|
+
*/
|
|
44
|
+
const Xendit = props => {
|
|
45
|
+
const {
|
|
46
|
+
classes: propClasses,
|
|
47
|
+
onPaymentSuccess: onSuccess,
|
|
48
|
+
onPaymentReady: onReady,
|
|
49
|
+
onPaymentError: onError,
|
|
50
|
+
resetShouldSubmit,
|
|
51
|
+
shouldSubmit
|
|
52
|
+
} = props;
|
|
53
|
+
const { formatMessage } = useIntl();
|
|
54
|
+
|
|
55
|
+
const classes = useStyle(defaultClasses, propClasses);
|
|
56
|
+
|
|
57
|
+
const talonProps = useXendit({
|
|
58
|
+
onSuccess,
|
|
59
|
+
onReady,
|
|
60
|
+
onError,
|
|
61
|
+
shouldSubmit,
|
|
62
|
+
resetShouldSubmit
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const {
|
|
66
|
+
errors,
|
|
67
|
+
shouldRequestPaymentNonce,
|
|
68
|
+
onPaymentError,
|
|
69
|
+
onPaymentSuccess,
|
|
70
|
+
onPaymentReady,
|
|
71
|
+
isBillingAddressSame,
|
|
72
|
+
isLoading,
|
|
73
|
+
/**
|
|
74
|
+
* `stepNumber` depicts the state of the process flow in credit card
|
|
75
|
+
* payment flow.
|
|
76
|
+
*
|
|
77
|
+
* `0` No call made yet
|
|
78
|
+
* `1` Billing address mutation intiated
|
|
79
|
+
* `2` Braintree nonce requsted
|
|
80
|
+
* `3` Payment information mutation intiated
|
|
81
|
+
* `4` All mutations done
|
|
82
|
+
*/
|
|
83
|
+
stepNumber,
|
|
84
|
+
initialValues,
|
|
85
|
+
shippingAddressCountry,
|
|
86
|
+
shouldTeardownDropin,
|
|
87
|
+
resetShouldTeardownDropin,
|
|
88
|
+
recaptchaWidgetProps
|
|
89
|
+
} = talonProps;
|
|
90
|
+
|
|
91
|
+
const creditCardComponentClassName = isLoading
|
|
92
|
+
? classes.credit_card_root_hidden
|
|
93
|
+
: classes.credit_card_root;
|
|
94
|
+
|
|
95
|
+
const billingAddressFieldsClassName = isBillingAddressSame
|
|
96
|
+
? classes.billing_address_fields_root_hidden
|
|
97
|
+
: classes.billing_address_fields_root;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Instead of defining classes={root: classes.FIELD_NAME}
|
|
101
|
+
* we are using useMemo to only do it once (hopefully).
|
|
102
|
+
*/
|
|
103
|
+
const fieldClasses = useMemo(() => {
|
|
104
|
+
return [
|
|
105
|
+
'first_name',
|
|
106
|
+
'last_name',
|
|
107
|
+
'country',
|
|
108
|
+
'street1',
|
|
109
|
+
'street2',
|
|
110
|
+
'city',
|
|
111
|
+
'region',
|
|
112
|
+
'postal_code',
|
|
113
|
+
'phone_number'
|
|
114
|
+
].reduce((acc, fieldName) => {
|
|
115
|
+
acc[fieldName] = { root: classes[fieldName] };
|
|
116
|
+
|
|
117
|
+
return acc;
|
|
118
|
+
}, {});
|
|
119
|
+
}, [classes]);
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* These 2 functions are wrappers around the `isRequired` function
|
|
123
|
+
* of `formValidators`. They perform validations only if the
|
|
124
|
+
* billing address is different from shipping address.
|
|
125
|
+
*
|
|
126
|
+
* We write this function in `venia-ui` and not in the `peregrine` talon
|
|
127
|
+
* because it references `isRequired` which is a `venia-ui` function.
|
|
128
|
+
*/
|
|
129
|
+
const isFieldRequired = useCallback((value, { isBillingAddressSame }) => {
|
|
130
|
+
if (isBillingAddressSame) {
|
|
131
|
+
/**
|
|
132
|
+
* Informed validator functions return `undefined` if
|
|
133
|
+
* validation is `true`
|
|
134
|
+
*/
|
|
135
|
+
return undefined;
|
|
136
|
+
} else {
|
|
137
|
+
return isRequired(value);
|
|
138
|
+
}
|
|
139
|
+
}, []);
|
|
140
|
+
|
|
141
|
+
const stepTitle = STEP_DESCRIPTIONS[stepNumber].defaultMessage
|
|
142
|
+
? formatMessage({
|
|
143
|
+
id: STEP_DESCRIPTIONS[stepNumber].id,
|
|
144
|
+
defaultMessage: STEP_DESCRIPTIONS[stepNumber].defaultMessage
|
|
145
|
+
})
|
|
146
|
+
: formatMessage({
|
|
147
|
+
id: 'checkoutPage.loadingPayment',
|
|
148
|
+
defaultMessage: 'Loading Payment'
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
const loadingIndicator = isLoading ? (
|
|
152
|
+
<LoadingIndicator>{stepTitle}</LoadingIndicator>
|
|
153
|
+
) : null;
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<div className={classes.root} data-cy="Xendit-root">
|
|
157
|
+
<div className={creditCardComponentClassName}>
|
|
158
|
+
<FormError
|
|
159
|
+
allowErrorMessages
|
|
160
|
+
classes={{ root: classes.formErrorContainer }}
|
|
161
|
+
errors={Array.from(errors.values())}
|
|
162
|
+
/>
|
|
163
|
+
<div className={classes.dropin_root}>
|
|
164
|
+
<BrainTreeDropin
|
|
165
|
+
onError={onPaymentError}
|
|
166
|
+
onReady={onPaymentReady}
|
|
167
|
+
onSuccess={onPaymentSuccess}
|
|
168
|
+
shouldRequestPaymentNonce={shouldRequestPaymentNonce}
|
|
169
|
+
shouldTeardownDropin={shouldTeardownDropin}
|
|
170
|
+
resetShouldTeardownDropin={resetShouldTeardownDropin}
|
|
171
|
+
/>
|
|
172
|
+
</div>
|
|
173
|
+
<div
|
|
174
|
+
data-cy="Xendit-AddressCheck-root"
|
|
175
|
+
className={classes.address_check}
|
|
176
|
+
>
|
|
177
|
+
<Checkbox
|
|
178
|
+
data-cy="PaymentInformation-billingAddressSame"
|
|
179
|
+
field="isBillingAddressSame"
|
|
180
|
+
label={formatMessage({
|
|
181
|
+
id: 'checkoutPage.billingAddressSame',
|
|
182
|
+
defaultMessage:
|
|
183
|
+
'Billing address same as shipping address'
|
|
184
|
+
})}
|
|
185
|
+
initialValue={initialValues.isBillingAddressSame}
|
|
186
|
+
/>
|
|
187
|
+
</div>
|
|
188
|
+
<div
|
|
189
|
+
data-cy="Xendit-billingAddressFields"
|
|
190
|
+
className={billingAddressFieldsClassName}
|
|
191
|
+
>
|
|
192
|
+
<Field
|
|
193
|
+
id="firstName"
|
|
194
|
+
classes={fieldClasses.first_name}
|
|
195
|
+
label={formatMessage({
|
|
196
|
+
id: 'global.firstName',
|
|
197
|
+
defaultMessage: 'First Name'
|
|
198
|
+
})}
|
|
199
|
+
>
|
|
200
|
+
<TextInput
|
|
201
|
+
data-cy="Xendit-billingAddress-firstname"
|
|
202
|
+
id="firstName"
|
|
203
|
+
field="firstName"
|
|
204
|
+
validate={isFieldRequired}
|
|
205
|
+
initialValue={initialValues.firstName}
|
|
206
|
+
/>
|
|
207
|
+
</Field>
|
|
208
|
+
<Field
|
|
209
|
+
id="lastName"
|
|
210
|
+
classes={fieldClasses.last_name}
|
|
211
|
+
label={formatMessage({
|
|
212
|
+
id: 'global.lastName',
|
|
213
|
+
defaultMessage: 'Last Name'
|
|
214
|
+
})}
|
|
215
|
+
>
|
|
216
|
+
<TextInput
|
|
217
|
+
data-cy="Xendit-billingAddress-lastname"
|
|
218
|
+
id="lastName"
|
|
219
|
+
field="lastName"
|
|
220
|
+
validate={isFieldRequired}
|
|
221
|
+
initialValue={initialValues.lastName}
|
|
222
|
+
/>
|
|
223
|
+
</Field>
|
|
224
|
+
<Country
|
|
225
|
+
data-cy="Xendit-billingAddress-country"
|
|
226
|
+
classes={fieldClasses.country}
|
|
227
|
+
validate={isFieldRequired}
|
|
228
|
+
initialValue={
|
|
229
|
+
/**
|
|
230
|
+
* If there is no initial value to start with
|
|
231
|
+
* use the country from shipping address.
|
|
232
|
+
*/
|
|
233
|
+
initialValues.country || shippingAddressCountry
|
|
234
|
+
}
|
|
235
|
+
/>
|
|
236
|
+
<Field
|
|
237
|
+
id="street1"
|
|
238
|
+
classes={fieldClasses.street1}
|
|
239
|
+
label={formatMessage({
|
|
240
|
+
id: 'global.streetAddress',
|
|
241
|
+
defaultMessage: 'Street Address'
|
|
242
|
+
})}
|
|
243
|
+
>
|
|
244
|
+
<TextInput
|
|
245
|
+
data-cy="Xendit-billingAddress-street1"
|
|
246
|
+
id="street1"
|
|
247
|
+
field="street1"
|
|
248
|
+
validate={isFieldRequired}
|
|
249
|
+
initialValue={initialValues.street1}
|
|
250
|
+
/>
|
|
251
|
+
</Field>
|
|
252
|
+
<Field
|
|
253
|
+
id="street2"
|
|
254
|
+
classes={fieldClasses.street2}
|
|
255
|
+
label={formatMessage({
|
|
256
|
+
id: 'global.streetAddress2',
|
|
257
|
+
defaultMessage: 'Street Address 2'
|
|
258
|
+
})}
|
|
259
|
+
optional={true}
|
|
260
|
+
>
|
|
261
|
+
<TextInput
|
|
262
|
+
data-cy="Xendit-billingAddress-street2"
|
|
263
|
+
id="street2"
|
|
264
|
+
field="street2"
|
|
265
|
+
initialValue={initialValues.street2}
|
|
266
|
+
/>
|
|
267
|
+
</Field>
|
|
268
|
+
<Field
|
|
269
|
+
id="city"
|
|
270
|
+
classes={fieldClasses.city}
|
|
271
|
+
label={formatMessage({
|
|
272
|
+
id: 'global.city',
|
|
273
|
+
defaultMessage: 'City'
|
|
274
|
+
})}
|
|
275
|
+
>
|
|
276
|
+
<TextInput
|
|
277
|
+
data-cy="Xendit-billingAddress-city"
|
|
278
|
+
id="city"
|
|
279
|
+
field="city"
|
|
280
|
+
validate={isFieldRequired}
|
|
281
|
+
initialValue={initialValues.city}
|
|
282
|
+
/>
|
|
283
|
+
</Field>
|
|
284
|
+
<Region
|
|
285
|
+
data-cy="Xendit-billingAddress-region"
|
|
286
|
+
classes={fieldClasses.region}
|
|
287
|
+
initialValue={initialValues.region}
|
|
288
|
+
validate={isFieldRequired}
|
|
289
|
+
fieldInput={'region[label]'}
|
|
290
|
+
fieldSelect={'region[region_id]'}
|
|
291
|
+
optionValueKey={'id'}
|
|
292
|
+
/>
|
|
293
|
+
<Postcode
|
|
294
|
+
data-cy="Xendit-billingAddress-postcode"
|
|
295
|
+
classes={fieldClasses.postal_code}
|
|
296
|
+
validate={isFieldRequired}
|
|
297
|
+
initialValue={initialValues.postcode}
|
|
298
|
+
/>
|
|
299
|
+
<Field
|
|
300
|
+
id="phoneNumber"
|
|
301
|
+
classes={fieldClasses.phone_number}
|
|
302
|
+
label={formatMessage({
|
|
303
|
+
id: 'global.phoneNumber',
|
|
304
|
+
defaultMessage: 'Phone Number'
|
|
305
|
+
})}
|
|
306
|
+
>
|
|
307
|
+
<TextInput
|
|
308
|
+
data-cy="Xendit-billingAddress-phoneNumber"
|
|
309
|
+
id="phoneNumber"
|
|
310
|
+
field="phoneNumber"
|
|
311
|
+
validate={isFieldRequired}
|
|
312
|
+
initialValue={initialValues.phoneNumber}
|
|
313
|
+
/>
|
|
314
|
+
</Field>
|
|
315
|
+
</div>
|
|
316
|
+
<GoogleReCaptcha {...recaptchaWidgetProps} />
|
|
317
|
+
</div>
|
|
318
|
+
{loadingIndicator}
|
|
319
|
+
</div>
|
|
320
|
+
);
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
export default Xendit;
|
|
324
|
+
|
|
325
|
+
Xendit.propTypes = {
|
|
326
|
+
classes: shape({
|
|
327
|
+
root: string,
|
|
328
|
+
dropin_root: string,
|
|
329
|
+
billing_address_fields_root: string,
|
|
330
|
+
first_name: string,
|
|
331
|
+
last_name: string,
|
|
332
|
+
city: string,
|
|
333
|
+
region: string,
|
|
334
|
+
postal_code: string,
|
|
335
|
+
phone_number: string,
|
|
336
|
+
country: string,
|
|
337
|
+
street1: string,
|
|
338
|
+
street2: string,
|
|
339
|
+
address_check: string,
|
|
340
|
+
credit_card_root: string,
|
|
341
|
+
credit_card_root_hidden: string
|
|
342
|
+
}),
|
|
343
|
+
shouldSubmit: bool.isRequired,
|
|
344
|
+
onPaymentSuccess: func,
|
|
345
|
+
onPaymentReady: func,
|
|
346
|
+
onPaymentError: func,
|
|
347
|
+
resetShouldSubmit: func.isRequired
|
|
348
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
}
|
|
3
|
+
|
|
4
|
+
.credit_card_root {
|
|
5
|
+
composes: visible from global;
|
|
6
|
+
composes: opacity-100 from global;
|
|
7
|
+
transition-delay: 64ms;
|
|
8
|
+
transition-duration: 384ms;
|
|
9
|
+
transition-property: opacity, visbility;
|
|
10
|
+
transition-timing-function: var(--venia-global-anim-standard);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.credit_card_root_hidden {
|
|
14
|
+
composes: h-0 from global;
|
|
15
|
+
composes: invisible from global;
|
|
16
|
+
composes: opacity-0 from global;
|
|
17
|
+
composes: overflow-hidden from global;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.dropin_root {
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.billing_address_fields_root {
|
|
24
|
+
composes: gap-x-xs from global;
|
|
25
|
+
composes: gap-y-sm from global;
|
|
26
|
+
composes: grid from global;
|
|
27
|
+
composes: px-0 from global;
|
|
28
|
+
composes: py-xs from global;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.billing_address_fields_root_hidden {
|
|
32
|
+
composes: h-0 from global;
|
|
33
|
+
composes: invisible from global;
|
|
34
|
+
composes: opacity-0 from global;
|
|
35
|
+
composes: overflow-hidden from global;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.formErrorContainer {
|
|
39
|
+
composes: pt-sm from global;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.first_name,
|
|
43
|
+
.last_name {
|
|
44
|
+
composes: col-end-span2 from global;
|
|
45
|
+
|
|
46
|
+
composes: lg_col-end-span1 from global;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.country,
|
|
50
|
+
.street1,
|
|
51
|
+
.street2,
|
|
52
|
+
.address_check,
|
|
53
|
+
.city,
|
|
54
|
+
.region,
|
|
55
|
+
.postal_code,
|
|
56
|
+
.phone_number {
|
|
57
|
+
composes: col-end-span2 from global;
|
|
58
|
+
}
|
package/src/intercept.js
CHANGED
|
@@ -220,4 +220,18 @@ module.exports = targets => {
|
|
|
220
220
|
routesArray.push(...routes);
|
|
221
221
|
return routesArray;
|
|
222
222
|
});
|
|
223
|
+
|
|
224
|
+
targets.of('@magento/venia-ui').checkoutPagePaymentTypes.tap(checkoutPagePaymentTypes =>
|
|
225
|
+
checkoutPagePaymentTypes.add({
|
|
226
|
+
paymentCode: 'xendit',
|
|
227
|
+
importPath: '@riosst100/pwa-marketplace/src/components/Xendit/xendit.js'
|
|
228
|
+
})
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
// targets.of('@magento/venia-ui').summaryPagePaymentTypes.tap(summaryPagePaymentTypes =>
|
|
232
|
+
// summaryPagePaymentTypes.add({
|
|
233
|
+
// paymentCode: 'xendit',
|
|
234
|
+
// importPath: '@riosst100/pwa-marketplace/src/components/Xendit/summary.js'
|
|
235
|
+
// })
|
|
236
|
+
// );
|
|
223
237
|
};
|