@akinon/pz-masterpass-rest 1.121.0 → 1.122.0-rc.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/package.json +1 -1
- package/src/components/card-list.tsx +18 -18
- package/src/components/confirmation-modal.tsx +1 -1
- package/src/components/credit-card-form.tsx +15 -15
- package/src/components/installment-list.tsx +16 -16
- package/src/components/masterpass-security-info.tsx +3 -7
- package/src/components/otp-modal.tsx +12 -4
- package/src/components/payment-method-selector.tsx +20 -20
- package/src/hooks/useMasterpassAccount.ts +12 -6
- package/src/types/account.types.ts +0 -1
package/package.json
CHANGED
|
@@ -35,8 +35,8 @@ const CardList: React.FC<CardListProps> = ({
|
|
|
35
35
|
key={card.uniqueCardNumber}
|
|
36
36
|
className={`border transition-all cursor-pointer ${
|
|
37
37
|
isSelected
|
|
38
|
-
? 'border-
|
|
39
|
-
: 'border-
|
|
38
|
+
? 'border-[#000000] bg-[#000000]/5'
|
|
39
|
+
: 'border-[#eeeeee] hover:border-[#ebebeb]'
|
|
40
40
|
}`}
|
|
41
41
|
onClick={() => onCardSelect(card)}
|
|
42
42
|
>
|
|
@@ -48,13 +48,13 @@ const CardList: React.FC<CardListProps> = ({
|
|
|
48
48
|
w-4 h-4 border-2 rounded-full flex items-center justify-center
|
|
49
49
|
${
|
|
50
50
|
isSelected
|
|
51
|
-
? 'border-
|
|
52
|
-
: 'border-
|
|
51
|
+
? 'border-[#000000] bg-primary'
|
|
52
|
+
: 'border-[#ebebeb]'
|
|
53
53
|
}
|
|
54
54
|
`}
|
|
55
55
|
>
|
|
56
56
|
{isSelected && (
|
|
57
|
-
<div className="w-2 h-2 bg-
|
|
57
|
+
<div className="w-2 h-2 bg-[#ffffff] rounded-full"></div>
|
|
58
58
|
)}
|
|
59
59
|
</div>
|
|
60
60
|
|
|
@@ -64,21 +64,21 @@ const CardList: React.FC<CardListProps> = ({
|
|
|
64
64
|
className="w-8 h-6 object-contain"
|
|
65
65
|
/>
|
|
66
66
|
<div>
|
|
67
|
-
<div className="font-medium text-
|
|
67
|
+
<div className="font-medium text-[#4a4f54]">
|
|
68
68
|
{card.maskedCardNumber}
|
|
69
69
|
</div>
|
|
70
|
-
<div className="text-sm text-
|
|
70
|
+
<div className="text-sm text-[#c9c9c9]">{card.cardAlias}</div>
|
|
71
71
|
<div className="flex items-center space-x-2 mt-1">
|
|
72
72
|
<span className="text-xs px-2 py-1 bg-gray-100">
|
|
73
73
|
{card.cardType}
|
|
74
74
|
</span>
|
|
75
75
|
{card.isDefaultCard && (
|
|
76
|
-
<span className="text-xs px-2 py-1 bg-
|
|
76
|
+
<span className="text-xs px-2 py-1 bg-[#000000]/10 text-[#000000]">
|
|
77
77
|
{texts.defaultCardText}
|
|
78
78
|
</span>
|
|
79
79
|
)}
|
|
80
80
|
{card.expireSoon && (
|
|
81
|
-
<span className="text-xs px-2 py-1 bg-
|
|
81
|
+
<span className="text-xs px-2 py-1 bg-[#d08800]/10 text-[#d08800]">
|
|
82
82
|
{texts.expiresSoonText}
|
|
83
83
|
</span>
|
|
84
84
|
)}
|
|
@@ -88,7 +88,7 @@ const CardList: React.FC<CardListProps> = ({
|
|
|
88
88
|
|
|
89
89
|
{onRemove && (
|
|
90
90
|
<button
|
|
91
|
-
className="p-2 text-
|
|
91
|
+
className="p-2 text-[#d7d7d7] hover:text-[#ff6367] transition-colors disabled:opacity-50 bg-[#f5f5f5] rounded-full"
|
|
92
92
|
disabled={removingCardId === card.uniqueCardNumber}
|
|
93
93
|
onClick={(e) => {
|
|
94
94
|
e.stopPropagation();
|
|
@@ -96,7 +96,7 @@ const CardList: React.FC<CardListProps> = ({
|
|
|
96
96
|
}}
|
|
97
97
|
>
|
|
98
98
|
{removingCardId === card.uniqueCardNumber ? (
|
|
99
|
-
<div className="animate-spin h-5 w-5 border-b-2 border-
|
|
99
|
+
<div className="animate-spin h-5 w-5 border-b-2 border-[#ff6367]"></div>
|
|
100
100
|
) : (
|
|
101
101
|
<svg
|
|
102
102
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -108,7 +108,7 @@ const CardList: React.FC<CardListProps> = ({
|
|
|
108
108
|
strokeWidth="2"
|
|
109
109
|
strokeLinecap="round"
|
|
110
110
|
strokeLinejoin="round"
|
|
111
|
-
className="text-
|
|
111
|
+
className="text-[#9d9d9d]"
|
|
112
112
|
>
|
|
113
113
|
<path d="M3 6h18" />
|
|
114
114
|
<path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" />
|
|
@@ -121,17 +121,17 @@ const CardList: React.FC<CardListProps> = ({
|
|
|
121
121
|
|
|
122
122
|
{isSelected && cvcRequired && (
|
|
123
123
|
<div
|
|
124
|
-
className="border-t border-
|
|
124
|
+
className="border-t border-[#eeeeee] p-4 bg-[#f7f7f7]"
|
|
125
125
|
onClick={(e) => e.stopPropagation()}
|
|
126
126
|
>
|
|
127
127
|
<div className="flex items-center gap-4">
|
|
128
128
|
<div className="flex-1">
|
|
129
129
|
<label
|
|
130
130
|
htmlFor={`cvc-${card.uniqueCardNumber}`}
|
|
131
|
-
className="block text-sm font-medium text-
|
|
131
|
+
className="block text-sm font-medium text-[#686868] mb-2"
|
|
132
132
|
>
|
|
133
133
|
{texts.cvcCardLabel}
|
|
134
|
-
<span className="text-
|
|
134
|
+
<span className="text-[#ff6367]"> *</span>
|
|
135
135
|
</label>
|
|
136
136
|
<Input
|
|
137
137
|
id={`cvc-${card.uniqueCardNumber}`}
|
|
@@ -148,7 +148,7 @@ const CardList: React.FC<CardListProps> = ({
|
|
|
148
148
|
maxLength={expectedCvcLength}
|
|
149
149
|
className="w-32"
|
|
150
150
|
/>
|
|
151
|
-
<p className="text-xs text-
|
|
151
|
+
<p className="text-xs text-[#c9c9c9] mt-1">
|
|
152
152
|
{texts.cvcCardHelpText
|
|
153
153
|
?.replace('{length}', expectedCvcLength.toString())
|
|
154
154
|
.replace(
|
|
@@ -159,11 +159,11 @@ const CardList: React.FC<CardListProps> = ({
|
|
|
159
159
|
)}
|
|
160
160
|
</p>
|
|
161
161
|
</div>
|
|
162
|
-
<div className="flex items-center text-sm text-
|
|
162
|
+
<div className="flex items-center text-sm text-[#9d9d9d]">
|
|
163
163
|
<Icon
|
|
164
164
|
name="shield-check"
|
|
165
165
|
size={16}
|
|
166
|
-
className="mr-1 text-
|
|
166
|
+
className="mr-1 text-[#00a63d]"
|
|
167
167
|
/>
|
|
168
168
|
<span>{texts.secureCardText}</span>
|
|
169
169
|
</div>
|
|
@@ -27,7 +27,7 @@ const ConfirmationModal: React.FC<ConfirmationModalProps> = ({
|
|
|
27
27
|
<div className="flex gap-3 justify-center">
|
|
28
28
|
<Button
|
|
29
29
|
appearance="outlined"
|
|
30
|
-
className="px-6 py-3 h-auto hover:bg-
|
|
30
|
+
className="px-6 py-3 h-auto hover:bg-[#f7f7f7] transition-colors"
|
|
31
31
|
onClick={onClose}
|
|
32
32
|
disabled={isLoading}
|
|
33
33
|
>
|
|
@@ -146,17 +146,17 @@ const CreditCardForm: React.FC<CreditCardFormProps> = ({
|
|
|
146
146
|
const expectedCVVLength = getCvcLength(cardType);
|
|
147
147
|
|
|
148
148
|
return (
|
|
149
|
-
<div className="bg-
|
|
150
|
-
<div className="flex justify-start items-center border-b border-
|
|
149
|
+
<div className="bg-[#ffffff] border border-[#eeeeee] shadow-sm">
|
|
150
|
+
<div className="flex justify-start items-center border-b border-[#eeeeee] px-4 py-3 sm:px-6 sm:py-4">
|
|
151
151
|
<div className="flex items-center gap-2">
|
|
152
|
-
<Icon name="credit-card" size={20} className="text-
|
|
153
|
-
<span className="text-
|
|
152
|
+
<Icon name="credit-card" size={20} className="text-[#9d9d9d]" />
|
|
153
|
+
<span className="text-[#181818] text-lg font-medium sm:text-xl">
|
|
154
154
|
{texts.creditCardInfoTitle}
|
|
155
155
|
</span>
|
|
156
156
|
{isBinChecking && (
|
|
157
157
|
<div className="flex items-center gap-2 ml-auto">
|
|
158
158
|
<LoaderSpinner className="w-4 h-4" />
|
|
159
|
-
<span className="text-sm text-
|
|
159
|
+
<span className="text-sm text-[#2d2d2d]">
|
|
160
160
|
{texts.checkingCardText}
|
|
161
161
|
</span>
|
|
162
162
|
</div>
|
|
@@ -169,7 +169,7 @@ const CreditCardForm: React.FC<CreditCardFormProps> = ({
|
|
|
169
169
|
<div className="space-y-2">
|
|
170
170
|
<label
|
|
171
171
|
htmlFor="cardNumber"
|
|
172
|
-
className="block text-sm font-medium text-
|
|
172
|
+
className="block text-sm font-medium text-[#686868]"
|
|
173
173
|
>
|
|
174
174
|
{texts.cardNumberLabel}
|
|
175
175
|
</label>
|
|
@@ -194,7 +194,7 @@ const CreditCardForm: React.FC<CreditCardFormProps> = ({
|
|
|
194
194
|
errors.cardNumber && '-translate-y-full'
|
|
195
195
|
)}
|
|
196
196
|
>
|
|
197
|
-
<span className="flex text-sm font-medium text-
|
|
197
|
+
<span className="flex text-sm font-medium text-[#9d9d9d] bg-[#f5f5f5] px-2 py-1">
|
|
198
198
|
<img
|
|
199
199
|
src={
|
|
200
200
|
getCardIcon(watchedCardNumber.replace(/\D/g, '')).src
|
|
@@ -211,7 +211,7 @@ const CreditCardForm: React.FC<CreditCardFormProps> = ({
|
|
|
211
211
|
<div className="space-y-2">
|
|
212
212
|
<label
|
|
213
213
|
htmlFor="cardholderName"
|
|
214
|
-
className="block text-sm font-medium text-
|
|
214
|
+
className="block text-sm font-medium text-[#686868]"
|
|
215
215
|
>
|
|
216
216
|
{texts.cardholderNameLabel}
|
|
217
217
|
</label>
|
|
@@ -228,7 +228,7 @@ const CreditCardForm: React.FC<CreditCardFormProps> = ({
|
|
|
228
228
|
<div className="space-y-2">
|
|
229
229
|
<label
|
|
230
230
|
htmlFor="expiryDate"
|
|
231
|
-
className="block text-sm font-medium text-
|
|
231
|
+
className="block text-sm font-medium text-[#686868]"
|
|
232
232
|
>
|
|
233
233
|
{texts.expiryDateLabel}
|
|
234
234
|
</label>
|
|
@@ -248,7 +248,7 @@ const CreditCardForm: React.FC<CreditCardFormProps> = ({
|
|
|
248
248
|
<div className="space-y-2">
|
|
249
249
|
<label
|
|
250
250
|
htmlFor="cvv"
|
|
251
|
-
className="block text-sm font-medium text-
|
|
251
|
+
className="block text-sm font-medium text-[#686868]"
|
|
252
252
|
>
|
|
253
253
|
{texts.cvcLabel}
|
|
254
254
|
</label>
|
|
@@ -278,18 +278,18 @@ const CreditCardForm: React.FC<CreditCardFormProps> = ({
|
|
|
278
278
|
{...register('saveCard')}
|
|
279
279
|
id="saveCard"
|
|
280
280
|
type="checkbox"
|
|
281
|
-
className="h-4 w-4 mt-0.5 text-
|
|
281
|
+
className="h-4 w-4 mt-0.5 text-[#000000] focus:ring-primary border-[#ebebeb]"
|
|
282
282
|
/>
|
|
283
283
|
<label
|
|
284
284
|
htmlFor="saveCard"
|
|
285
|
-
className="text-sm font-medium text-
|
|
285
|
+
className="text-sm font-medium text-[#686868] cursor-pointer"
|
|
286
286
|
>
|
|
287
287
|
{texts.saveCardTermsPrefix}{' '}
|
|
288
288
|
<a
|
|
289
289
|
href="https://www.masterpassturkiye.com/terms-and-conditions"
|
|
290
290
|
target="_blank"
|
|
291
291
|
rel="noopener noreferrer"
|
|
292
|
-
className="text-
|
|
292
|
+
className="text-[#000000] underline hover:text-[#181818]"
|
|
293
293
|
>
|
|
294
294
|
{texts.saveCardTermsLink}
|
|
295
295
|
</a>
|
|
@@ -301,7 +301,7 @@ const CreditCardForm: React.FC<CreditCardFormProps> = ({
|
|
|
301
301
|
<div className="space-y-2 pt-2">
|
|
302
302
|
<label
|
|
303
303
|
htmlFor="cardAlias"
|
|
304
|
-
className="block text-sm font-medium text-
|
|
304
|
+
className="block text-sm font-medium text-[#686868]"
|
|
305
305
|
>
|
|
306
306
|
{texts.cardAliasLabel}
|
|
307
307
|
</label>
|
|
@@ -320,7 +320,7 @@ const CreditCardForm: React.FC<CreditCardFormProps> = ({
|
|
|
320
320
|
)}
|
|
321
321
|
|
|
322
322
|
{watchedSaveCard && (
|
|
323
|
-
<div className="flex flex-col sm:flex-row gap-3 pt-6 border-t border-
|
|
323
|
+
<div className="flex flex-col sm:flex-row gap-3 pt-6 border-t border-[#eeeeee]">
|
|
324
324
|
<Button
|
|
325
325
|
type="submit"
|
|
326
326
|
className="flex-1 group inline-flex items-center justify-center disabled:opacity-50 disabled:cursor-not-allowed"
|
|
@@ -13,11 +13,11 @@ const InstallmentList: React.FC<InstallmentListProps> = ({
|
|
|
13
13
|
texts
|
|
14
14
|
}) => {
|
|
15
15
|
return (
|
|
16
|
-
<div className="bg-white border border-
|
|
17
|
-
<div className="border-b border-
|
|
16
|
+
<div className="bg-white border border-[#eeeeee] shadow-sm">
|
|
17
|
+
<div className="border-b border-[#eeeeee] px-4 py-3 sm:px-6 sm:py-4">
|
|
18
18
|
<div className="flex items-center gap-2">
|
|
19
19
|
<Icon name="credit-card" size={20} className="text-gray-600" />
|
|
20
|
-
<span className="text-
|
|
20
|
+
<span className="text-[#181818] text-lg font-medium sm:text-xl">
|
|
21
21
|
{texts.installmentOptionsText}
|
|
22
22
|
</span>
|
|
23
23
|
</div>
|
|
@@ -26,10 +26,10 @@ const InstallmentList: React.FC<InstallmentListProps> = ({
|
|
|
26
26
|
<div className="p-4 sm:p-6">
|
|
27
27
|
{/* Card Type Display */}
|
|
28
28
|
{cardType && (
|
|
29
|
-
<div className="mb-4 p-3 bg-
|
|
29
|
+
<div className="mb-4 p-3 bg-[#f7f7f7] border border-[#eeeeee]">
|
|
30
30
|
<div className="flex items-center gap-2">
|
|
31
31
|
<Icon name="credit-card" size={16} className="text-gray-600" />
|
|
32
|
-
<span className="text-sm font-medium text-
|
|
32
|
+
<span className="text-sm font-medium text-[#686868]">
|
|
33
33
|
{texts.cardTypeLabel}
|
|
34
34
|
</span>
|
|
35
35
|
<img
|
|
@@ -55,8 +55,8 @@ const InstallmentList: React.FC<InstallmentListProps> = ({
|
|
|
55
55
|
relative flex items-center justify-between p-3 border transition-all cursor-pointer
|
|
56
56
|
${
|
|
57
57
|
isSelected
|
|
58
|
-
? 'border-
|
|
59
|
-
: 'border-
|
|
58
|
+
? 'border-[#000000] bg-[#000000]/5'
|
|
59
|
+
: 'border-[#eeeeee] hover:border-[#ebebeb]'
|
|
60
60
|
}
|
|
61
61
|
`}
|
|
62
62
|
>
|
|
@@ -66,13 +66,13 @@ const InstallmentList: React.FC<InstallmentListProps> = ({
|
|
|
66
66
|
w-4 h-4 border-2 rounded-full flex items-center justify-center
|
|
67
67
|
${
|
|
68
68
|
isSelected
|
|
69
|
-
? 'border-
|
|
70
|
-
: 'border-
|
|
69
|
+
? 'border-[#000000] bg-[#000000]'
|
|
70
|
+
: 'border-[#ebebeb]'
|
|
71
71
|
}
|
|
72
72
|
`}
|
|
73
73
|
>
|
|
74
74
|
{isSelected && (
|
|
75
|
-
<div className="w-2 h-2 bg-
|
|
75
|
+
<div className="w-2 h-2 bg-[#ffffff] rounded-full"></div>
|
|
76
76
|
)}
|
|
77
77
|
</div>
|
|
78
78
|
|
|
@@ -80,7 +80,7 @@ const InstallmentList: React.FC<InstallmentListProps> = ({
|
|
|
80
80
|
<div className="flex-1 ml-3">
|
|
81
81
|
<div className="flex items-center justify-between">
|
|
82
82
|
<div>
|
|
83
|
-
<span className="font-medium text-
|
|
83
|
+
<span className="font-medium text-[#4a4f54]">
|
|
84
84
|
{installment.installment_count === 1
|
|
85
85
|
? texts.singlePaymentText
|
|
86
86
|
: texts.installmentsText?.replace(
|
|
@@ -89,17 +89,17 @@ const InstallmentList: React.FC<InstallmentListProps> = ({
|
|
|
89
89
|
)}
|
|
90
90
|
</span>
|
|
91
91
|
{isNoInterest && (
|
|
92
|
-
<span className="text-xs bg-
|
|
92
|
+
<span className="text-xs bg-[#84978a] text-[#004e21] px-2 py-1 ml-2">
|
|
93
93
|
{texts.noInterestText}
|
|
94
94
|
</span>
|
|
95
95
|
)}
|
|
96
96
|
</div>
|
|
97
97
|
<div className="text-right">
|
|
98
|
-
<div className="font-semibold text-
|
|
98
|
+
<div className="font-semibold text-[#4a4f54]">
|
|
99
99
|
{installment.price_with_accrued_interest}
|
|
100
100
|
</div>
|
|
101
101
|
{installment.installment_count > 1 && (
|
|
102
|
-
<div className="text-sm text-
|
|
102
|
+
<div className="text-sm text-[#f7f7f7]">
|
|
103
103
|
{installment.monthly_price_with_accrued_interest}
|
|
104
104
|
{texts.perMonthText}
|
|
105
105
|
</div>
|
|
@@ -114,7 +114,7 @@ const InstallmentList: React.FC<InstallmentListProps> = ({
|
|
|
114
114
|
|
|
115
115
|
{/* Payment Button */}
|
|
116
116
|
{selectedInstallment && onProceedToPayment && (
|
|
117
|
-
<div className="pt-4 border-t border-
|
|
117
|
+
<div className="pt-4 border-t border-[#eeeeee]">
|
|
118
118
|
<Button
|
|
119
119
|
onClick={onProceedToPayment}
|
|
120
120
|
disabled={isLoading || paymentLoading}
|
|
@@ -122,7 +122,7 @@ const InstallmentList: React.FC<InstallmentListProps> = ({
|
|
|
122
122
|
>
|
|
123
123
|
{paymentLoading ? (
|
|
124
124
|
<div className="flex items-center justify-center">
|
|
125
|
-
<div className="animate-spin h-4 w-4 border-b-2 border-
|
|
125
|
+
<div className="animate-spin h-4 w-4 border-b-2 border-[#ffffff]"></div>
|
|
126
126
|
<span className="ml-2">{texts.processingPaymentText}</span>
|
|
127
127
|
</div>
|
|
128
128
|
) : (
|
|
@@ -11,18 +11,14 @@ const MasterpassSecurityInfo: React.FC<MasterpassSecurityInfoProps> = ({
|
|
|
11
11
|
}) => {
|
|
12
12
|
return (
|
|
13
13
|
<div className="flex flex-col items-center gap-2">
|
|
14
|
-
<img
|
|
15
|
-
|
|
16
|
-
alt="Masterpass"
|
|
17
|
-
className="h-6"
|
|
18
|
-
/>
|
|
19
|
-
<p className="text-xs text-center text-gray-600">
|
|
14
|
+
<img src={mpBlackLogo.src} alt="Masterpass" className="h-6" />
|
|
15
|
+
<p className="text-xs text-center text-[#9d9d9d]">
|
|
20
16
|
{texts.masterpassSecurityPrefix}{' '}
|
|
21
17
|
<a
|
|
22
18
|
href="https://www.mastercard.com.tr/tr-tr/tuketiciler/odeme-secenekleri/masterpass.html"
|
|
23
19
|
target="_blank"
|
|
24
20
|
rel="noopener noreferrer"
|
|
25
|
-
className="text-
|
|
21
|
+
className="text-[#000000] underline hover:text-[#181818] font-medium"
|
|
26
22
|
>
|
|
27
23
|
{texts.masterpassSecurityLink}
|
|
28
24
|
</a>
|
|
@@ -204,15 +204,21 @@ const OTPModal: React.FC<OTPModalProps> = ({
|
|
|
204
204
|
>
|
|
205
205
|
<div className="px-6">
|
|
206
206
|
{getTitle() && (
|
|
207
|
-
<h3 className="text-center mt-4 text-lg font-semibold">
|
|
207
|
+
<h3 className="text-center mt-4 text-lg font-semibold">
|
|
208
|
+
{getTitle()}
|
|
209
|
+
</h3>
|
|
208
210
|
)}
|
|
209
|
-
<p className="text-center mt-2 text-sm text-gray-600">
|
|
211
|
+
<p className="text-center mt-2 text-sm text-gray-600">
|
|
212
|
+
{getDescription()}
|
|
213
|
+
</p>
|
|
210
214
|
<div className="flex flex-col gap-3 p-5 w-3/4 m-auto">
|
|
211
215
|
<Input
|
|
212
216
|
type="text"
|
|
213
217
|
value={otp}
|
|
214
218
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
215
|
-
setOtp(
|
|
219
|
+
setOtp(
|
|
220
|
+
e.target.value.replace(/\D/g, '').slice(0, getMaxLength())
|
|
221
|
+
);
|
|
216
222
|
setError(null);
|
|
217
223
|
}}
|
|
218
224
|
maxLength={getMaxLength()}
|
|
@@ -222,7 +228,9 @@ const OTPModal: React.FC<OTPModalProps> = ({
|
|
|
222
228
|
placeholder={getPlaceholder()}
|
|
223
229
|
/>
|
|
224
230
|
{getHelperText() && (
|
|
225
|
-
<p className="text-xs text-gray-500 text-center">
|
|
231
|
+
<p className="text-xs text-gray-500 text-center">
|
|
232
|
+
{getHelperText()}
|
|
233
|
+
</p>
|
|
226
234
|
)}
|
|
227
235
|
{error && <p className="text-error text-xs text-center">{error}</p>}
|
|
228
236
|
<Button
|
|
@@ -11,12 +11,12 @@ const PaymentMethodSelector: React.FC<PaymentMethodSelectorProps> = ({
|
|
|
11
11
|
const hasStoredCards = cards && cards.length > 0;
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
|
-
<div className="bg-white border border-
|
|
15
|
-
<div className="border-b border-
|
|
16
|
-
<h3 className="text-lg font-medium text-
|
|
14
|
+
<div className="bg-white border border-[#eeeeee] shadow-sm">
|
|
15
|
+
<div className="border-b border-[#eeeeee] px-4 py-3 sm:px-6 sm:py-4">
|
|
16
|
+
<h3 className="text-lg font-medium text-[#4a4f54]">
|
|
17
17
|
{texts.paymentMethodTitle}
|
|
18
18
|
</h3>
|
|
19
|
-
<p className="text-sm text-
|
|
19
|
+
<p className="text-sm text-[#c9c9c9] mt-1">
|
|
20
20
|
{texts.paymentMethodDescription}
|
|
21
21
|
</p>
|
|
22
22
|
</div>
|
|
@@ -31,7 +31,7 @@ const PaymentMethodSelector: React.FC<PaymentMethodSelectorProps> = ({
|
|
|
31
31
|
>
|
|
32
32
|
{hasStoredCards && (
|
|
33
33
|
<div
|
|
34
|
-
className="flex items-center p-4 border border-
|
|
34
|
+
className="flex items-center p-4 border border-[#eeeeee] hover:border-[#000000] transition-colors cursor-pointer"
|
|
35
35
|
onClick={() => onMethodChange('stored_card')}
|
|
36
36
|
>
|
|
37
37
|
<div
|
|
@@ -39,26 +39,26 @@ const PaymentMethodSelector: React.FC<PaymentMethodSelectorProps> = ({
|
|
|
39
39
|
w-4 h-4 border-2 rounded-full flex items-center justify-center mr-3
|
|
40
40
|
${
|
|
41
41
|
selectedMethod === 'stored_card'
|
|
42
|
-
? 'border-
|
|
43
|
-
: 'border-
|
|
42
|
+
? 'border-[#000000] bg-[#000000]'
|
|
43
|
+
: 'border-[#ebebeb]'
|
|
44
44
|
}
|
|
45
45
|
`}
|
|
46
46
|
>
|
|
47
47
|
{selectedMethod === 'stored_card' && (
|
|
48
|
-
<div className="w-2 h-2 bg-
|
|
48
|
+
<div className="w-2 h-2 bg-[#ffffff] rounded-full"></div>
|
|
49
49
|
)}
|
|
50
50
|
</div>
|
|
51
51
|
<div className="flex items-center">
|
|
52
52
|
<Icon
|
|
53
53
|
name="credit-card"
|
|
54
54
|
size={20}
|
|
55
|
-
className="text-
|
|
55
|
+
className="text-[#9d9d9d] mr-3"
|
|
56
56
|
/>
|
|
57
57
|
<div>
|
|
58
|
-
<div className="font-medium text-
|
|
58
|
+
<div className="font-medium text-[#4a4f54]">
|
|
59
59
|
{texts.savedCardsText}
|
|
60
60
|
</div>
|
|
61
|
-
<div className="text-sm text-
|
|
61
|
+
<div className="text-sm text-[#c9c9c9]">
|
|
62
62
|
{texts.savedCardsDescription.replace(
|
|
63
63
|
'{count}',
|
|
64
64
|
cards.length.toString()
|
|
@@ -70,7 +70,7 @@ const PaymentMethodSelector: React.FC<PaymentMethodSelectorProps> = ({
|
|
|
70
70
|
)}
|
|
71
71
|
|
|
72
72
|
<div
|
|
73
|
-
className="flex items-center p-4 border border-
|
|
73
|
+
className="flex items-center p-4 border border-[#eeeeee] hover:border-[#000000] transition-colors cursor-pointer"
|
|
74
74
|
onClick={() => onMethodChange('new_card')}
|
|
75
75
|
>
|
|
76
76
|
<div
|
|
@@ -78,22 +78,22 @@ const PaymentMethodSelector: React.FC<PaymentMethodSelectorProps> = ({
|
|
|
78
78
|
w-4 h-4 border-2 rounded-full flex items-center justify-center mr-3
|
|
79
79
|
${
|
|
80
80
|
selectedMethod === 'new_card'
|
|
81
|
-
? 'border-
|
|
82
|
-
: 'border-
|
|
81
|
+
? 'border-[#000000] bg-[#000000]'
|
|
82
|
+
: 'border-[#ebebeb]'
|
|
83
83
|
}
|
|
84
84
|
`}
|
|
85
85
|
>
|
|
86
86
|
{selectedMethod === 'new_card' && (
|
|
87
|
-
<div className="w-2 h-2 bg-
|
|
87
|
+
<div className="w-2 h-2 bg-[#ffffff] rounded-full"></div>
|
|
88
88
|
)}
|
|
89
89
|
</div>
|
|
90
90
|
<div className="flex items-center">
|
|
91
|
-
<Icon name="plus" size={20} className="text-
|
|
91
|
+
<Icon name="plus" size={20} className="text-[#9d9d9d] mr-3" />
|
|
92
92
|
<div>
|
|
93
|
-
<div className="font-medium text-
|
|
93
|
+
<div className="font-medium text-[#4a4f54]">
|
|
94
94
|
{texts.newCardText}
|
|
95
95
|
</div>
|
|
96
|
-
<div className="text-sm text-
|
|
96
|
+
<div className="text-sm text-[#c9c9c9]">
|
|
97
97
|
{texts.newCardDescription}
|
|
98
98
|
</div>
|
|
99
99
|
</div>
|
|
@@ -102,12 +102,12 @@ const PaymentMethodSelector: React.FC<PaymentMethodSelectorProps> = ({
|
|
|
102
102
|
</div>
|
|
103
103
|
|
|
104
104
|
{!hasStoredCards && (
|
|
105
|
-
<div className="flex items-center justify-center p-8 text-
|
|
105
|
+
<div className="flex items-center justify-center p-8 text-[#c9c9c9]">
|
|
106
106
|
<div className="text-center">
|
|
107
107
|
<Icon
|
|
108
108
|
name="credit-card"
|
|
109
109
|
size={24}
|
|
110
|
-
className="mx-auto mb-2 text-
|
|
110
|
+
className="mx-auto mb-2 text-[#d7d7d7]"
|
|
111
111
|
/>
|
|
112
112
|
<p className="text-sm">{texts.noPaymentMethodsText}</p>
|
|
113
113
|
</div>
|
|
@@ -126,7 +126,10 @@ export const useMasterpassAccount = () => {
|
|
|
126
126
|
dispatch(resetState());
|
|
127
127
|
}, [dispatch]);
|
|
128
128
|
|
|
129
|
-
const refreshToken = async (options?: {
|
|
129
|
+
const refreshToken = async (options?: {
|
|
130
|
+
three_d?: boolean;
|
|
131
|
+
skipReset?: boolean;
|
|
132
|
+
}) => {
|
|
130
133
|
if (options?.three_d !== false && !options?.skipReset) {
|
|
131
134
|
resetData();
|
|
132
135
|
}
|
|
@@ -218,8 +221,12 @@ export const useMasterpassAccount = () => {
|
|
|
218
221
|
informationModalData: {
|
|
219
222
|
type: 'warning',
|
|
220
223
|
title: texts?.sessionExpiredTitle || 'Session Expired',
|
|
221
|
-
message:
|
|
222
|
-
|
|
224
|
+
message:
|
|
225
|
+
texts?.sessionExpiredMessage ||
|
|
226
|
+
'Your session has expired due to inactivity. Please restart the process to continue.',
|
|
227
|
+
secondaryMessage:
|
|
228
|
+
texts?.sessionExpiredSecondaryMessage ||
|
|
229
|
+
'For security reasons, verification codes are only valid for a limited time.',
|
|
223
230
|
buttonText: texts?.sessionExpiredButton || 'Start Again'
|
|
224
231
|
}
|
|
225
232
|
})
|
|
@@ -359,8 +366,8 @@ export const useMasterpassAccount = () => {
|
|
|
359
366
|
cvv: finalCardData.cvv,
|
|
360
367
|
accountAliasName: finalCardData.cardAlias,
|
|
361
368
|
userId: activeTokenData.UserId,
|
|
362
|
-
isMsisdnValidatedByMerchant:
|
|
363
|
-
|
|
369
|
+
isMsisdnValidatedByMerchant:
|
|
370
|
+
activeTokenData.IsMsisdnValidated === 'True'
|
|
364
371
|
});
|
|
365
372
|
|
|
366
373
|
const result = await handleMasterpassResponse(response);
|
|
@@ -407,7 +414,6 @@ export const useMasterpassAccount = () => {
|
|
|
407
414
|
[
|
|
408
415
|
tokenData?.AccountKey,
|
|
409
416
|
tokenData?.UserId,
|
|
410
|
-
tokenData?.AuthenticationMethod,
|
|
411
417
|
newCardFormData,
|
|
412
418
|
refreshAccountData,
|
|
413
419
|
refreshToken,
|