@tagadapay/plugin-sdk 2.3.4 → 2.3.5
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.
|
@@ -151,12 +151,15 @@ export function usePayment() {
|
|
|
151
151
|
},
|
|
152
152
|
});
|
|
153
153
|
// Create payment instrument through API
|
|
154
|
+
const { expiration_month, expiration_year } = getCardMonthAndYear(cardData.expiryDate);
|
|
154
155
|
const paymentInstrumentData = {
|
|
155
156
|
type: btResponse.type,
|
|
156
157
|
card: {
|
|
157
|
-
maskedCardNumber:
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
maskedCardNumber: btResponse.enrichments?.cardDetails?.bin ?
|
|
159
|
+
`${btResponse.enrichments.cardDetails.bin}****${btResponse.enrichments.cardDetails.last4}` :
|
|
160
|
+
cardData.cardNumber.replace(/\d(?=\d{4})/g, '*'),
|
|
161
|
+
expirationMonth: expiration_month,
|
|
162
|
+
expirationYear: expiration_year,
|
|
160
163
|
},
|
|
161
164
|
token: btResponse.id,
|
|
162
165
|
};
|