@cimplify/sdk 0.16.1 → 0.16.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/dist/utils.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as Money, C as CurrencyCode, aB as PricePathTaxInfo, bm as PaymentErrorDetails, bk as PaymentResponse, bl as PaymentStatusResponse } from './payment-Dvd7nRmk.mjs';
2
- import { P as ProductWithPrice } from './price-BDZNXiLS.mjs';
1
+ import { M as Money, C as CurrencyCode, aB as PricePathTaxInfo, bm as PaymentErrorDetails, bk as PaymentResponse, bl as PaymentStatusResponse } from './payment-C6ULw3K-.mjs';
2
+ import { P as ProductWithPrice } from './price-CbR6DCt0.mjs';
3
3
  import { CountryCode } from 'libphonenumber-js';
4
4
 
5
5
  declare const CURRENCY_SYMBOLS: Record<string, string>;
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as Money, C as CurrencyCode, aB as PricePathTaxInfo, bm as PaymentErrorDetails, bk as PaymentResponse, bl as PaymentStatusResponse } from './payment-Dvd7nRmk.js';
2
- import { P as ProductWithPrice } from './price-DrfhwHpw.js';
1
+ import { M as Money, C as CurrencyCode, aB as PricePathTaxInfo, bm as PaymentErrorDetails, bk as PaymentResponse, bl as PaymentStatusResponse } from './payment-C6ULw3K-.js';
2
+ import { P as ProductWithPrice } from './price-Bd6JBV8W.js';
3
3
  import { CountryCode } from 'libphonenumber-js';
4
4
 
5
5
  declare const CURRENCY_SYMBOLS: Record<string, string>;
package/dist/utils.js CHANGED
@@ -361,9 +361,10 @@ function normalizePaymentResponse(response) {
361
361
  };
362
362
  }
363
363
  if (isWebPaymentResponse(response)) {
364
- const authType = response.authorization_type?.toLowerCase();
365
- const validStringAuthTypes = ["otp", "pin", "phone", "birthday"];
366
- const safeAuthType = authType && validStringAuthTypes.includes(authType) ? authType : void 0;
364
+ const objectAuthType = response.authorization_type && typeof response.authorization_type === "object" && "address" in response.authorization_type ? "address" : void 0;
365
+ const authType = typeof response.authorization_type === "string" ? response.authorization_type.trim().toLowerCase().replace(/[\s-]+/g, "_") : void 0;
366
+ const validStringAuthTypes = ["otp", "pin", "phone", "birthday", "address"];
367
+ const safeAuthType = objectAuthType || (authType && validStringAuthTypes.includes(authType) ? authType : void 0);
367
368
  return {
368
369
  provider: response.transaction.provider_type?.toLowerCase() || "unknown",
369
370
  requires_action: response.requires_action || false,
package/dist/utils.mjs CHANGED
@@ -359,9 +359,10 @@ function normalizePaymentResponse(response) {
359
359
  };
360
360
  }
361
361
  if (isWebPaymentResponse(response)) {
362
- const authType = response.authorization_type?.toLowerCase();
363
- const validStringAuthTypes = ["otp", "pin", "phone", "birthday"];
364
- const safeAuthType = authType && validStringAuthTypes.includes(authType) ? authType : void 0;
362
+ const objectAuthType = response.authorization_type && typeof response.authorization_type === "object" && "address" in response.authorization_type ? "address" : void 0;
363
+ const authType = typeof response.authorization_type === "string" ? response.authorization_type.trim().toLowerCase().replace(/[\s-]+/g, "_") : void 0;
364
+ const validStringAuthTypes = ["otp", "pin", "phone", "birthday", "address"];
365
+ const safeAuthType = objectAuthType || (authType && validStringAuthTypes.includes(authType) ? authType : void 0);
365
366
  return {
366
367
  provider: response.transaction.provider_type?.toLowerCase() || "unknown",
367
368
  requires_action: response.requires_action || false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/sdk",
3
- "version": "0.16.1",
3
+ "version": "0.16.3",
4
4
  "description": "Cimplify Commerce SDK for storefronts",
5
5
  "keywords": [
6
6
  "cimplify",