@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: String(btResponse?.data?.number || ''),
158
- expirationMonth: Number(btResponse?.data?.expiration_month || 0),
159
- expirationYear: Number(btResponse?.data?.expiration_year || 0),
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagadapay/plugin-sdk",
3
- "version": "2.3.4",
3
+ "version": "2.3.5",
4
4
  "description": "Modern React SDK for building Tagada Pay plugins",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",