paymob-pixel-alpha 1.1.7 → 1.1.8
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 +100 -28
- package/main.js +72 -35
- package/package.json +1 -1
- package/styles.css +4 -0
package/README.md
CHANGED
|
@@ -30,9 +30,9 @@ Using jsDelivr:
|
|
|
30
30
|
<!-- Using unpkg:
|
|
31
31
|
|
|
32
32
|
```html
|
|
33
|
-
<link rel="stylesheet" href="https://unpkg.com/paymob-pixel
|
|
34
|
-
<link rel="stylesheet" href="https://unpkg.com/paymob-pixel
|
|
35
|
-
<script src="https://unpkg.com/paymob-pixel
|
|
33
|
+
<link rel="stylesheet" href="https://unpkg.com/paymob-pixel/styles.css">
|
|
34
|
+
<link rel="stylesheet" href="https://unpkg.com/paymob-pixel/main.css">
|
|
35
|
+
<script src="https://unpkg.com/paymob-pixel/main.js" type="module"></script>
|
|
36
36
|
``` -->
|
|
37
37
|
|
|
38
38
|
## Usage
|
|
@@ -166,30 +166,47 @@ The full list of functions is as follows:
|
|
|
166
166
|
console.log("====> onPaymentCancel")
|
|
167
167
|
},
|
|
168
168
|
customStyle: {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
169
|
+
HideCardIcons: true,
|
|
170
|
+
Direction: 'rtl',
|
|
171
|
+
Label_Text: {
|
|
172
|
+
cardLabel: "بيانات البطاقة"
|
|
173
|
+
},
|
|
174
|
+
Placeholder_Text: {
|
|
175
|
+
holderName: 'الاسم علي البطاقة',
|
|
176
|
+
cardNumber:'رقم البطاقة',
|
|
177
|
+
expiryDate:'سنة / شهر',
|
|
178
|
+
securityCode:'(CVV) الرمز الامني'
|
|
179
|
+
},
|
|
180
|
+
Error_Text: {
|
|
181
|
+
holderName: 'مطلوب اسم حامل البطاقة',
|
|
182
|
+
cardNumber: 'مطلوب رقم البطاقة',
|
|
183
|
+
expiryDate: 'مطلوب تاريخ انتهاء الصلاحية',
|
|
184
|
+
securityCode: 'مطلوب رمز CVV مكون من 3 أرقام'
|
|
185
|
+
},
|
|
186
|
+
Font_Family: 'monospace',
|
|
187
|
+
Font_Size_Label: '18',
|
|
188
|
+
Font_Size_Input_Fields: '18',
|
|
189
|
+
Font_Size_Payment_Button: '28',
|
|
190
|
+
Font_Weight_Label: 400,
|
|
191
|
+
Font_Weight_Input_Fields: 400,
|
|
192
|
+
Font_Weight_Payment_Button: 900,
|
|
193
|
+
Color_Container: '#b7ffe4',
|
|
194
|
+
Color_Border_Input_Fields: '#f00',
|
|
195
|
+
Color_Border_Payment_Button: '#f00',
|
|
196
|
+
Radius_Border: '50',
|
|
197
|
+
Color_Disabled: '#c153bf',
|
|
198
|
+
Color_Error: '#4a6',
|
|
199
|
+
Color_Primary: '#c153bf',
|
|
200
|
+
Color_Input_Fields: 'yellow',
|
|
201
|
+
Text_Color_For_Label: '#f00',
|
|
202
|
+
Text_Color_For_Payment_Button: '#f00',
|
|
203
|
+
Text_Color_For_Input_Fields: '#f00',
|
|
204
|
+
Color_For_Text_Placeholder: '#c153bf',
|
|
205
|
+
Width_of_Container: '100%',
|
|
206
|
+
Vertical_Padding: '50',
|
|
207
|
+
Vertical_Spacing_between_components: '8',
|
|
208
|
+
Container_Padding: '50'
|
|
209
|
+
}
|
|
193
210
|
});
|
|
194
211
|
};
|
|
195
212
|
</script>
|
|
@@ -207,6 +224,18 @@ The full list of functions is as follows:
|
|
|
207
224
|
# `Pixel Tokenization`
|
|
208
225
|
Use Pixel SDK for only card tokenization.
|
|
209
226
|
|
|
227
|
+
## Installing
|
|
228
|
+
|
|
229
|
+
### CDN
|
|
230
|
+
|
|
231
|
+
Using jsDelivr:
|
|
232
|
+
|
|
233
|
+
```html
|
|
234
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/paymob-pixel-alpha@latest/styles.css">
|
|
235
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/paymob-pixel-alpha@latest/main.css">
|
|
236
|
+
<script src="https://cdn.jsdelivr.net/npm/paymob-pixel-alpha@latest/main.js" type="module"></script>
|
|
237
|
+
```
|
|
238
|
+
|
|
210
239
|
## Usage
|
|
211
240
|
|
|
212
241
|
```js
|
|
@@ -225,7 +254,8 @@ The full list of properties is as follows:
|
|
|
225
254
|
| elementId | String | ID of the HTML element where the checkout pixel will be embedded. |
|
|
226
255
|
| supportedNetworks | Array | List of Supported networks. |
|
|
227
256
|
| hideCardHolderName | Boolean | If this option is set to false, will hide the card holder name input. |
|
|
228
|
-
| cardValidationChanged | Function | This Functionality will be processed whenever card validation status changed
|
|
257
|
+
| cardValidationChanged | Function | This Functionality will be processed whenever card validation status changed.|
|
|
258
|
+
| customStyle | Object | You can pass custom styles, for more details check the full example below.
|
|
229
259
|
|
|
230
260
|
## Functions
|
|
231
261
|
The full list of functions is as follows:
|
|
@@ -273,6 +303,48 @@ The full list of functions is as follows:
|
|
|
273
303
|
supportedNetworks: ['visa', 'mada'],
|
|
274
304
|
cardValidationChanged: (isValid) => {
|
|
275
305
|
console.log("Is valid ? ", isValid)
|
|
306
|
+
},
|
|
307
|
+
customStyle: {
|
|
308
|
+
HideCardIcons: true,
|
|
309
|
+
Direction: 'rtl',
|
|
310
|
+
Label_Text: {
|
|
311
|
+
cardLabel: "بيانات البطاقة"
|
|
312
|
+
},
|
|
313
|
+
Placeholder_Text: {
|
|
314
|
+
holderName: 'الاسم علي البطاقة',
|
|
315
|
+
cardNumber:'رقم البطاقة',
|
|
316
|
+
expiryDate:'سنة / شهر',
|
|
317
|
+
securityCode:'(CVV) الرمز الامني'
|
|
318
|
+
},
|
|
319
|
+
Error_Text: {
|
|
320
|
+
holderName: 'مطلوب اسم حامل البطاقة',
|
|
321
|
+
cardNumber: 'مطلوب رقم البطاقة',
|
|
322
|
+
expiryDate: 'مطلوب تاريخ انتهاء الصلاحية',
|
|
323
|
+
securityCode: 'مطلوب رمز CVV مكون من 3 أرقام'
|
|
324
|
+
},
|
|
325
|
+
Font_Family: 'monospace',
|
|
326
|
+
Font_Size_Label: '18',
|
|
327
|
+
Font_Size_Input_Fields: '18',
|
|
328
|
+
Font_Size_Payment_Button: '28',
|
|
329
|
+
Font_Weight_Label: 400,
|
|
330
|
+
Font_Weight_Input_Fields: 400,
|
|
331
|
+
Font_Weight_Payment_Button: 900,
|
|
332
|
+
Color_Container: '#b7ffe4',
|
|
333
|
+
Color_Border_Input_Fields: '#f00',
|
|
334
|
+
Color_Border_Payment_Button: '#f00',
|
|
335
|
+
Radius_Border: '50',
|
|
336
|
+
Color_Disabled: '#c153bf',
|
|
337
|
+
Color_Error: '#4a6',
|
|
338
|
+
Color_Primary: '#c153bf',
|
|
339
|
+
Color_Input_Fields: 'yellow',
|
|
340
|
+
Text_Color_For_Label: '#f00',
|
|
341
|
+
Text_Color_For_Payment_Button: '#f00',
|
|
342
|
+
Text_Color_For_Input_Fields: '#f00',
|
|
343
|
+
Color_For_Text_Placeholder: '#c153bf',
|
|
344
|
+
Width_of_Container: '100%',
|
|
345
|
+
Vertical_Padding: '50',
|
|
346
|
+
Vertical_Spacing_between_components: '8',
|
|
347
|
+
Container_Padding: '50'
|
|
276
348
|
}
|
|
277
349
|
})
|
|
278
350
|
// Submit Call
|
package/main.js
CHANGED
|
@@ -10127,12 +10127,14 @@ function FormInputViewTwo_FormInput(props) {
|
|
|
10127
10127
|
className: `bg-white box-border px-3 border border-solid ${borderStyleState === borderStyle_borderStyleConstants.RECTANGULAR && '!rounded-none'} flex justify-between gap-2 items-center w-full h-10 opacity-100 relative ${className != null ? className : ''}`,
|
|
10128
10128
|
style: customStyle != null && customStyle.input ? customStyle == null ? void 0 : customStyle.input : customStyle,
|
|
10129
10129
|
children: [icon && icon, /*#__PURE__*/(0,jsx_runtime.jsx)("input", Object.assign({
|
|
10130
|
+
dir: "ltr",
|
|
10130
10131
|
id: name,
|
|
10131
10132
|
name: name,
|
|
10132
10133
|
type: type,
|
|
10133
|
-
className: `py-3 text-left bg-transparent h-full w-full border-0
|
|
10134
|
+
className: `py-3 ${(customStyle == null ? void 0 : customStyle.direction) === 'rtl' ? 'text-right pl-4' : 'text-left pr-4'} bg-transparent h-full w-full border-0 box-border text-inherit focus:outline-none focus-visible:outline-none ${customInputStyle != null ? customInputStyle : ''} [&::placeholder]:text-[var(--placeholder-color)]`,
|
|
10134
10135
|
style: {
|
|
10135
|
-
'--placeholder-color': (customStyle == null || (_customStyle$placehol = customStyle.placeholder) == null ? void 0 : _customStyle$placehol.color) || '#667085'
|
|
10136
|
+
'--placeholder-color': (customStyle == null || (_customStyle$placehol = customStyle.placeholder) == null ? void 0 : _customStyle$placehol.color) || '#667085',
|
|
10137
|
+
direction: 'ltr'
|
|
10136
10138
|
},
|
|
10137
10139
|
value: value,
|
|
10138
10140
|
onChange: onChange,
|
|
@@ -18077,7 +18079,9 @@ function CardNumberViewTwo_CardNumber(props) {
|
|
|
18077
18079
|
maxLength,
|
|
18078
18080
|
cardType,
|
|
18079
18081
|
getCardLogo,
|
|
18080
|
-
customStyle
|
|
18082
|
+
customStyle,
|
|
18083
|
+
placeholder,
|
|
18084
|
+
hideCardIcons
|
|
18081
18085
|
} = props;
|
|
18082
18086
|
const {
|
|
18083
18087
|
t
|
|
@@ -18147,12 +18151,9 @@ function CardNumberViewTwo_CardNumber(props) {
|
|
|
18147
18151
|
}
|
|
18148
18152
|
}
|
|
18149
18153
|
}, []);
|
|
18150
|
-
|
|
18151
|
-
|
|
18152
|
-
|
|
18153
|
-
className: className,
|
|
18154
|
-
placeholder: t('CARD_NUMBER_PLACEHOLDER'),
|
|
18155
|
-
label: getCardLogo(cardType) === '' || noCardLogo ? /*#__PURE__*/_jsxs("span", {
|
|
18154
|
+
const getLabel = () => {
|
|
18155
|
+
if (hideCardIcons) return;
|
|
18156
|
+
return getCardLogo(cardType) === '' || noCardLogo ? /*#__PURE__*/_jsxs("span", {
|
|
18156
18157
|
className: "flex gap-1 items-center justify-end w-full h-full mobile:w-auto",
|
|
18157
18158
|
children: [currency === 'SAR' && /*#__PURE__*/_jsx("img", {
|
|
18158
18159
|
src: MadaIcon,
|
|
@@ -18182,7 +18183,14 @@ function CardNumberViewTwo_CardNumber(props) {
|
|
|
18182
18183
|
src: getCardLogo(cardType),
|
|
18183
18184
|
alt: cardType
|
|
18184
18185
|
})
|
|
18185
|
-
})
|
|
18186
|
+
});
|
|
18187
|
+
};
|
|
18188
|
+
return /*#__PURE__*/_jsx(FormInput, {
|
|
18189
|
+
formRegister: formRegister,
|
|
18190
|
+
name: 'number',
|
|
18191
|
+
className: className,
|
|
18192
|
+
placeholder: placeholder || t('CARD_NUMBER_PLACEHOLDER'),
|
|
18193
|
+
label: getLabel(),
|
|
18186
18194
|
error: error,
|
|
18187
18195
|
maxLength: maxLength,
|
|
18188
18196
|
inputMode: "numeric",
|
|
@@ -18200,13 +18208,14 @@ function ExpiryDate_ExpiryDate(props) {
|
|
|
18200
18208
|
maxLength,
|
|
18201
18209
|
disabled,
|
|
18202
18210
|
error,
|
|
18203
|
-
className
|
|
18211
|
+
className,
|
|
18212
|
+
placeholder
|
|
18204
18213
|
} = props;
|
|
18205
18214
|
return /*#__PURE__*/_jsx(FormInput, {
|
|
18206
18215
|
name: 'expiry',
|
|
18207
18216
|
error: error,
|
|
18208
18217
|
formRegister: formRegister,
|
|
18209
|
-
placeholder: 'MM/YY',
|
|
18218
|
+
placeholder: placeholder || 'MM/YY',
|
|
18210
18219
|
maxLength: maxLength,
|
|
18211
18220
|
customStyle: customStyle,
|
|
18212
18221
|
className: className,
|
|
@@ -19022,6 +19031,7 @@ function mobileCardFormViewTwo_MobileCard(props) {
|
|
|
19022
19031
|
|
|
19023
19032
|
|
|
19024
19033
|
function IframeCard(props) {
|
|
19034
|
+
var _iframeCustomStyles$c, _iframeCustomStyles$c2, _iframeCustomStyles$p, _iframeCustomStyles$c3, _iframeCustomStyles$c4, _iframeCustomStyles$p2, _iframeCustomStyles$c5, _iframeCustomStyles$c6, _iframeCustomStyles$p3;
|
|
19025
19035
|
const {
|
|
19026
19036
|
loading,
|
|
19027
19037
|
handleCardSubmit,
|
|
@@ -19043,6 +19053,7 @@ function IframeCard(props) {
|
|
|
19043
19053
|
const [tenure, setTenure] = useState('');
|
|
19044
19054
|
const [shouldSubmitData, setShouldSubmitData] = useState(false);
|
|
19045
19055
|
const [cardHolderError, setCardHolderError] = useState();
|
|
19056
|
+
const [cardIconsHidden, setCardIconsHidden] = useState(false);
|
|
19046
19057
|
const [cardHolderNameHidden, setCardHolderNameHidden] = useState(false);
|
|
19047
19058
|
const [currency, setCurrency] = useState('');
|
|
19048
19059
|
const [country, setCountry] = useState('');
|
|
@@ -19136,9 +19147,17 @@ function IframeCard(props) {
|
|
|
19136
19147
|
}
|
|
19137
19148
|
};
|
|
19138
19149
|
const handleCardStylesFromSDK = payload => {
|
|
19139
|
-
var _payload$options;
|
|
19150
|
+
var _payload$styling3, _payload$options;
|
|
19140
19151
|
if (payload.styling) {
|
|
19152
|
+
var _payload$styling;
|
|
19141
19153
|
setIframeCustomStyles(payload.styling);
|
|
19154
|
+
if ((_payload$styling = payload.styling) != null && (_payload$styling = _payload$styling.container) != null && _payload$styling.direction) {
|
|
19155
|
+
var _payload$styling2;
|
|
19156
|
+
document.documentElement.dir = (_payload$styling2 = payload.styling) == null || (_payload$styling2 = _payload$styling2.container) == null ? void 0 : _payload$styling2.direction;
|
|
19157
|
+
}
|
|
19158
|
+
}
|
|
19159
|
+
if ((_payload$styling3 = payload.styling) != null && _payload$styling3.hideCardIcons) {
|
|
19160
|
+
setCardIconsHidden(true);
|
|
19142
19161
|
}
|
|
19143
19162
|
if ((_payload$options = payload.options) != null && _payload$options['hideCardHolderName']) {
|
|
19144
19163
|
setCardHolderNameHidden(true);
|
|
@@ -19227,9 +19246,10 @@ function IframeCard(props) {
|
|
|
19227
19246
|
}
|
|
19228
19247
|
};
|
|
19229
19248
|
return /*#__PURE__*/_jsxs("div", {
|
|
19230
|
-
id: "iframe"
|
|
19231
|
-
|
|
19232
|
-
|
|
19249
|
+
id: "iframe",
|
|
19250
|
+
style: {
|
|
19251
|
+
direction: (iframeCustomStyles == null || (_iframeCustomStyles$c = iframeCustomStyles.container) == null ? void 0 : _iframeCustomStyles$c.direction) || 'ltr'
|
|
19252
|
+
},
|
|
19233
19253
|
className: "w-[calc(100%-1px)]",
|
|
19234
19254
|
children: [/*#__PURE__*/_jsx("div", {
|
|
19235
19255
|
children: /*#__PURE__*/_jsx(CardNumber, {
|
|
@@ -19242,9 +19262,12 @@ function IframeCard(props) {
|
|
|
19242
19262
|
className: `!rounded-b-none border-b-0 rounded-t-lg ${errors['number'] ? 'border-red-300' : 'border-gray-300'}`,
|
|
19243
19263
|
customStyle: {
|
|
19244
19264
|
input: iframeCustomStyles == null ? void 0 : iframeCustomStyles.input,
|
|
19245
|
-
placeholder: iframeCustomStyles == null ? void 0 : iframeCustomStyles.placeholder
|
|
19265
|
+
placeholder: iframeCustomStyles == null ? void 0 : iframeCustomStyles.placeholder,
|
|
19266
|
+
direction: iframeCustomStyles == null || (_iframeCustomStyles$c2 = iframeCustomStyles.container) == null ? void 0 : _iframeCustomStyles$c2.direction
|
|
19246
19267
|
},
|
|
19247
|
-
currency: currency
|
|
19268
|
+
currency: currency,
|
|
19269
|
+
placeholder: iframeCustomStyles == null || (_iframeCustomStyles$p = iframeCustomStyles.placeholderText) == null ? void 0 : _iframeCustomStyles$p.cardNumber,
|
|
19270
|
+
hideCardIcons: cardIconsHidden
|
|
19248
19271
|
})
|
|
19249
19272
|
}), /*#__PURE__*/_jsxs("div", {
|
|
19250
19273
|
className: "flex",
|
|
@@ -19253,22 +19276,27 @@ function IframeCard(props) {
|
|
|
19253
19276
|
error: errors['expiry'],
|
|
19254
19277
|
maxLength: EXPIRY_DATE_LENGTH,
|
|
19255
19278
|
expiryDate: getValues('expiry'),
|
|
19256
|
-
className: `${cardHolderNameHidden ? '!rounded-t-none !rounded-ee-none' : '!rounded-none'} ${errors['number'] ? 'border-t-red-300' : ''} ${errors['cvc'] ? 'border-r-red-300' : ''} ${errors['expiry'] ? 'border-red-300' : 'border-gray-300'} ${cardHolderError ? 'border-b-red-300' : ''}`,
|
|
19279
|
+
className: `${cardHolderNameHidden ? '!rounded-t-none !rounded-ee-none' : '!rounded-none'} ${errors['number'] ? 'border-t-red-300' : ''} ${errors['cvc'] ? (iframeCustomStyles == null || (_iframeCustomStyles$c3 = iframeCustomStyles.container) == null ? void 0 : _iframeCustomStyles$c3.direction) === 'rtl' ? 'border-l-red-300' : 'border-r-red-300' : ''} ${errors['expiry'] ? 'border-red-300' : 'border-gray-300'} ${cardHolderError ? 'border-b-red-300' : ''}`,
|
|
19257
19280
|
customStyle: {
|
|
19258
19281
|
input: iframeCustomStyles == null ? void 0 : iframeCustomStyles.input,
|
|
19259
|
-
placeholder: iframeCustomStyles == null ? void 0 : iframeCustomStyles.placeholder
|
|
19260
|
-
|
|
19282
|
+
placeholder: iframeCustomStyles == null ? void 0 : iframeCustomStyles.placeholder,
|
|
19283
|
+
direction: iframeCustomStyles == null || (_iframeCustomStyles$c4 = iframeCustomStyles.container) == null ? void 0 : _iframeCustomStyles$c4.direction
|
|
19284
|
+
},
|
|
19285
|
+
placeholder: iframeCustomStyles == null || (_iframeCustomStyles$p2 = iframeCustomStyles.placeholderText) == null ? void 0 : _iframeCustomStyles$p2.expiryDate
|
|
19261
19286
|
}), /*#__PURE__*/_jsx(CVV, {
|
|
19262
19287
|
formRegister: cvcRegister,
|
|
19263
19288
|
maxLength: cardType === CARD_TYPES.AMEX ? AMEX_CVV_LENGTH : CVV_LENGTH,
|
|
19264
19289
|
error: errors['cvc'],
|
|
19265
|
-
className: `${cardHolderNameHidden ? '!rounded-t-none !rounded-es-none' : '!rounded-none'}
|
|
19290
|
+
className: `${cardHolderNameHidden ? '!rounded-t-none !rounded-es-none' : '!rounded-none'}
|
|
19291
|
+
${(iframeCustomStyles == null || (_iframeCustomStyles$c5 = iframeCustomStyles.container) == null ? void 0 : _iframeCustomStyles$c5.direction) === 'rtl' ? 'border-r-0' : 'border-l-0'} ${errors['number'] ? 'border-t-red-300' : ''} ${errors['cvc'] ? 'border-red-300' : 'border-gray-300'} ${cardHolderError ? 'border-b-red-300' : ''}`,
|
|
19266
19292
|
cvv: getValues('cvc'),
|
|
19267
19293
|
customStyle: {
|
|
19268
19294
|
input: iframeCustomStyles == null ? void 0 : iframeCustomStyles.input,
|
|
19269
|
-
placeholder: iframeCustomStyles == null ? void 0 : iframeCustomStyles.placeholder
|
|
19295
|
+
placeholder: iframeCustomStyles == null ? void 0 : iframeCustomStyles.placeholder,
|
|
19296
|
+
direction: iframeCustomStyles == null || (_iframeCustomStyles$c6 = iframeCustomStyles.container) == null ? void 0 : _iframeCustomStyles$c6.direction
|
|
19270
19297
|
},
|
|
19271
|
-
isIframe: true
|
|
19298
|
+
isIframe: true,
|
|
19299
|
+
placeholder: iframeCustomStyles == null || (_iframeCustomStyles$p3 = iframeCustomStyles.placeholderText) == null ? void 0 : _iframeCustomStyles$p3.securityCode
|
|
19272
19300
|
})]
|
|
19273
19301
|
})]
|
|
19274
19302
|
});
|
|
@@ -19287,7 +19315,8 @@ function components_CardHolder_CardHolder(props) {
|
|
|
19287
19315
|
focusToPrevInput,
|
|
19288
19316
|
onChange,
|
|
19289
19317
|
onFocus,
|
|
19290
|
-
customStyle
|
|
19318
|
+
customStyle,
|
|
19319
|
+
placeholder
|
|
19291
19320
|
} = props;
|
|
19292
19321
|
const {
|
|
19293
19322
|
t
|
|
@@ -19331,7 +19360,7 @@ function components_CardHolder_CardHolder(props) {
|
|
|
19331
19360
|
};
|
|
19332
19361
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(InputViewTwo_InputViewTwo, {
|
|
19333
19362
|
name: 'name',
|
|
19334
|
-
placeholder: t('CARD_NAME_PLACEHOLDER'),
|
|
19363
|
+
placeholder: placeholder || t('CARD_NAME_PLACEHOLDER'),
|
|
19335
19364
|
onChange: handleChange,
|
|
19336
19365
|
onFocus: onFocus,
|
|
19337
19366
|
value: cardHolder,
|
|
@@ -20237,7 +20266,7 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
|
|
|
20237
20266
|
integrationType,
|
|
20238
20267
|
publicKey
|
|
20239
20268
|
}, ref) => {
|
|
20240
|
-
var _customStyle$containe, _customStyle$containe2, _customStyle$button, _customStyle$containe3;
|
|
20269
|
+
var _customStyle$containe, _customStyle$containe2, _customStyle$button, _customStyle$containe3, _customStyle$labelTex, _customStyle$placehol, _customStyle$errorTex, _customStyle$errorTex2, _customStyle$errorTex3, _customStyle$errorTex4;
|
|
20241
20270
|
const {
|
|
20242
20271
|
token,
|
|
20243
20272
|
amount,
|
|
@@ -20705,7 +20734,7 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
|
|
|
20705
20734
|
},
|
|
20706
20735
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
20707
20736
|
style: Object.assign({}, customStyle == null ? void 0 : customStyle.label),
|
|
20708
|
-
children:
|
|
20737
|
+
children: (customStyle == null || (_customStyle$labelTex = customStyle.labelText) == null ? void 0 : _customStyle$labelTex.cardLabel) || 'Card Information'
|
|
20709
20738
|
}), showCardModal && /*#__PURE__*/(0,jsx_runtime.jsx)("button", {
|
|
20710
20739
|
id: 'cancel-button',
|
|
20711
20740
|
className: "hover:!opacity-75",
|
|
@@ -20756,18 +20785,19 @@ const CardElement = /*#__PURE__*/(0,react.forwardRef)(({
|
|
|
20756
20785
|
focusToPrevInput: handleFocusToPrevInput,
|
|
20757
20786
|
customStyle: customStyle,
|
|
20758
20787
|
setErrors: setErrors,
|
|
20759
|
-
error: errors['name']
|
|
20788
|
+
error: errors['name'],
|
|
20789
|
+
placeholder: customStyle == null || (_customStyle$placehol = customStyle.placeholderText) == null ? void 0 : _customStyle$placehol.holderName
|
|
20760
20790
|
}), (errors['number'] || errors['name'] || errors['cvc'] || errors['expiry']) && /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
20761
20791
|
style: customStyle == null ? void 0 : customStyle.error,
|
|
20762
20792
|
className: "my-2 text-sm text-red-600 list-disc list-inside list-item:text-red-600",
|
|
20763
20793
|
children: [errors['number'] && /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
20764
|
-
children: errors['number']
|
|
20794
|
+
children: (customStyle == null || (_customStyle$errorTex = customStyle.errorText) == null ? void 0 : _customStyle$errorTex.cardNumber) || errors['number']
|
|
20765
20795
|
}), errors['expiry'] && /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
20766
|
-
children: errors['expiry']
|
|
20796
|
+
children: (customStyle == null || (_customStyle$errorTex2 = customStyle.errorText) == null ? void 0 : _customStyle$errorTex2.expiryDate) || errors['expiry']
|
|
20767
20797
|
}), errors['cvc'] && /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
20768
|
-
children: errors['cvc']
|
|
20798
|
+
children: (customStyle == null || (_customStyle$errorTex3 = customStyle.errorText) == null ? void 0 : _customStyle$errorTex3.securityCode) || errors['cvc']
|
|
20769
20799
|
}), errors['name'] && /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
20770
|
-
children: errors['name']
|
|
20800
|
+
children: (customStyle == null || (_customStyle$errorTex4 = customStyle.errorText) == null ? void 0 : _customStyle$errorTex4.holderName) || errors['name']
|
|
20771
20801
|
})]
|
|
20772
20802
|
})]
|
|
20773
20803
|
})]
|
|
@@ -28197,8 +28227,11 @@ function getStyles(customStyle) {
|
|
|
28197
28227
|
const containerPadding = Object.assign({}, (customStyle == null ? void 0 : customStyle.Container_Padding) && {
|
|
28198
28228
|
padding: `${customStyle == null ? void 0 : customStyle.Container_Padding}px`
|
|
28199
28229
|
});
|
|
28230
|
+
const textDirection = Object.assign({}, (customStyle == null ? void 0 : customStyle.Direction) && {
|
|
28231
|
+
direction: customStyle == null ? void 0 : customStyle.Direction
|
|
28232
|
+
});
|
|
28200
28233
|
return {
|
|
28201
|
-
container: Object.assign({}, colorContainer, fontFamily, verticalSpacingBetweenComponents, containerPadding, widthOfContainer),
|
|
28234
|
+
container: Object.assign({}, colorContainer, fontFamily, verticalSpacingBetweenComponents, containerPadding, widthOfContainer, textDirection),
|
|
28202
28235
|
tabs: Object.assign({}, fontFamily, radiusBorder),
|
|
28203
28236
|
label: Object.assign({}, fontFamily, fontWeightLabel, fontSizeLabel, textColorForLabel),
|
|
28204
28237
|
input: Object.assign({}, fontFamily, fontWeightInputFields, fontSizeInputFields, colorBorderInputFields, radiusBorder, colorInputFields, textColorForInput, verticalPadding, {
|
|
@@ -28208,7 +28241,11 @@ function getStyles(customStyle) {
|
|
|
28208
28241
|
disabled: Object.assign({}, colorDisabled)
|
|
28209
28242
|
}),
|
|
28210
28243
|
error: Object.assign({}, colorError),
|
|
28211
|
-
placeholder: Object.assign({}, colorForTextPlaceholder)
|
|
28244
|
+
placeholder: Object.assign({}, colorForTextPlaceholder),
|
|
28245
|
+
labelText: Object.assign({}, customStyle == null ? void 0 : customStyle.Label_Text),
|
|
28246
|
+
placeholderText: Object.assign({}, customStyle == null ? void 0 : customStyle.Placeholder_Text),
|
|
28247
|
+
errorText: Object.assign({}, customStyle == null ? void 0 : customStyle.Error_Text),
|
|
28248
|
+
hideCardIcons: customStyle == null ? void 0 : customStyle.HideCardIcons
|
|
28212
28249
|
};
|
|
28213
28250
|
}
|
|
28214
28251
|
;// CONCATENATED MODULE: ./src/components/Payments/index.tsx
|
package/package.json
CHANGED