@tagadapay/plugin-sdk 3.1.25 → 4.0.2

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.
Files changed (81) hide show
  1. package/dist/external-tracker.js +160 -6
  2. package/dist/external-tracker.min.js +2 -2
  3. package/dist/external-tracker.min.js.map +4 -4
  4. package/dist/react/config/payment.d.ts +2 -2
  5. package/dist/react/config/payment.js +5 -5
  6. package/dist/react/hooks/usePayment.d.ts +7 -0
  7. package/dist/react/hooks/usePayment.js +1 -0
  8. package/dist/tagada-react-sdk-minimal.min.js +2 -2
  9. package/dist/tagada-react-sdk-minimal.min.js.map +4 -4
  10. package/dist/tagada-react-sdk.js +2220 -1428
  11. package/dist/tagada-react-sdk.min.js +2 -2
  12. package/dist/tagada-react-sdk.min.js.map +4 -4
  13. package/dist/tagada-sdk.js +3784 -128
  14. package/dist/tagada-sdk.min.js +2 -2
  15. package/dist/tagada-sdk.min.js.map +4 -4
  16. package/dist/v2/core/config/environment.d.ts +3 -3
  17. package/dist/v2/core/config/environment.js +7 -7
  18. package/dist/v2/core/funnelClient.d.ts +42 -0
  19. package/dist/v2/core/funnelClient.js +30 -0
  20. package/dist/v2/core/pixelTracker.d.ts +51 -0
  21. package/dist/v2/core/pixelTracker.js +425 -0
  22. package/dist/v2/core/resources/checkout.d.ts +45 -1
  23. package/dist/v2/core/resources/checkout.js +13 -3
  24. package/dist/v2/core/resources/funnel.d.ts +1 -1
  25. package/dist/v2/core/resources/geo.d.ts +50 -0
  26. package/dist/v2/core/resources/geo.js +35 -0
  27. package/dist/v2/core/resources/offers.d.ts +1 -1
  28. package/dist/v2/core/resources/offers.js +3 -1
  29. package/dist/v2/core/resources/payments.d.ts +19 -1
  30. package/dist/v2/core/resources/payments.js +8 -0
  31. package/dist/v2/core/resources/promotionEvents.d.ts +5 -0
  32. package/dist/v2/core/resources/promotionEvents.js +2 -0
  33. package/dist/v2/core/resources/promotions.d.ts +6 -1
  34. package/dist/v2/core/resources/promotions.js +6 -1
  35. package/dist/v2/core/resources/shippingRates.d.ts +18 -0
  36. package/dist/v2/core/resources/shippingRates.js +18 -0
  37. package/dist/v2/core/utils/clickIdResolver.d.ts +79 -0
  38. package/dist/v2/core/utils/clickIdResolver.js +169 -0
  39. package/dist/v2/core/utils/index.d.ts +2 -0
  40. package/dist/v2/core/utils/index.js +4 -0
  41. package/dist/v2/core/utils/metaEventId.d.ts +14 -0
  42. package/dist/v2/core/utils/metaEventId.js +16 -0
  43. package/dist/v2/index.d.ts +7 -0
  44. package/dist/v2/index.js +10 -0
  45. package/dist/v2/react/components/ApplePayButton.js +50 -0
  46. package/dist/v2/react/components/FunnelScriptInjector.js +158 -10
  47. package/dist/v2/react/components/GooglePayButton.js +39 -1
  48. package/dist/v2/react/components/StripeExpressButton.d.ts +8 -0
  49. package/dist/v2/react/components/StripeExpressButton.js +76 -3
  50. package/dist/v2/react/hooks/payment-actions/useNgeniusThreedsAction.d.ts +15 -0
  51. package/dist/v2/react/hooks/payment-actions/useNgeniusThreedsAction.js +166 -0
  52. package/dist/v2/react/hooks/payment-actions/usePaymentActionHandler.js +12 -0
  53. package/dist/v2/react/hooks/payment-processing/usePaymentProcessors.js +1 -0
  54. package/dist/v2/react/hooks/useCheckoutQuery.js +41 -29
  55. package/dist/v2/react/hooks/useDiscountsQuery.js +4 -0
  56. package/dist/v2/react/hooks/useFunnel.d.ts +7 -0
  57. package/dist/v2/react/hooks/useFunnel.js +2 -1
  58. package/dist/v2/react/hooks/useISOData.js +25 -7
  59. package/dist/v2/react/hooks/usePaymentPolling.d.ts +1 -1
  60. package/dist/v2/react/hooks/usePixelTracking.d.ts +10 -5
  61. package/dist/v2/react/hooks/usePixelTracking.js +32 -374
  62. package/dist/v2/react/hooks/usePreviewOffer.d.ts +3 -1
  63. package/dist/v2/react/hooks/usePreviewOffer.js +8 -2
  64. package/dist/v2/react/hooks/usePromotionsQuery.js +9 -3
  65. package/dist/v2/react/hooks/useShippingRatesQuery.js +36 -21
  66. package/dist/v2/react/hooks/useStepConfig.d.ts +9 -0
  67. package/dist/v2/react/hooks/useStepConfig.js +5 -1
  68. package/dist/v2/react/index.d.ts +4 -0
  69. package/dist/v2/react/index.js +8 -0
  70. package/dist/v2/react/providers/ExpressPaymentMethodsProvider.js +12 -4
  71. package/dist/v2/react/providers/TagadaProvider.js +13 -0
  72. package/dist/v2/standalone/apple-pay-service.d.ts +12 -0
  73. package/dist/v2/standalone/apple-pay-service.js +12 -0
  74. package/dist/v2/standalone/external-tracker.d.ts +1 -1
  75. package/dist/v2/standalone/google-pay-service.d.ts +9 -0
  76. package/dist/v2/standalone/google-pay-service.js +9 -0
  77. package/dist/v2/standalone/index.d.ts +11 -1
  78. package/dist/v2/standalone/index.js +30 -0
  79. package/dist/v2/standalone/payment-service.d.ts +72 -6
  80. package/dist/v2/standalone/payment-service.js +285 -65
  81. package/package.json +2 -1
@@ -23,8 +23,8 @@ export declare function getPaymentConfig(environment?: string): PaymentConfig;
23
23
  * tagadaClientEnv controls which API server the SDK talks to, but BasisTheory
24
24
  * tokens must always match the backend's BT tenant.
25
25
  *
26
- * Production BT: *.tagadapay.com, custom domains (e.g. checkout.myboost.club)
27
- * Test BT: *.tagadapay.dev, app-dev.tagadapay.com, localhost, vercel.app, etc.
26
+ * Production BT: *.tagada.io, *.tagadapay.com, custom domains (e.g. checkout.myboost.club)
27
+ * Test BT: *.tagada.dev, *.tagadapay.dev, localhost, vercel.app, etc.
28
28
  */
29
29
  export declare function isProductionBasisTheory(): boolean;
30
30
  /**
@@ -50,22 +50,22 @@ import { getBasisTheoryKeys } from '../../config/basisTheory';
50
50
  * tagadaClientEnv controls which API server the SDK talks to, but BasisTheory
51
51
  * tokens must always match the backend's BT tenant.
52
52
  *
53
- * Production BT: *.tagadapay.com, custom domains (e.g. checkout.myboost.club)
54
- * Test BT: *.tagadapay.dev, app-dev.tagadapay.com, localhost, vercel.app, etc.
53
+ * Production BT: *.tagada.io, *.tagadapay.com, custom domains (e.g. checkout.myboost.club)
54
+ * Test BT: *.tagada.dev, *.tagadapay.dev, localhost, vercel.app, etc.
55
55
  */
56
56
  export function isProductionBasisTheory() {
57
57
  if (typeof window === 'undefined')
58
58
  return false;
59
59
  const hostname = window.location.hostname;
60
- // Dev backend under tagadapay.com — uses test BT
60
+ // Dev backend — uses test BT
61
61
  if (hostname.includes('app-dev.tagadapay.com') || hostname.includes('cdn-dev.tagadapay.com')) {
62
62
  return false;
63
63
  }
64
64
  // Production and preprod share the same production BT tenant
65
- if (hostname.includes('tagadapay.com'))
65
+ if (hostname.includes('tagada.io') || hostname.includes('tagadapay.com'))
66
66
  return true;
67
67
  // Dev/staging domains use test BT
68
- if (hostname.includes('tagadapay.dev'))
68
+ if (hostname.includes('tagada.dev') || hostname.includes('tagadapay.dev'))
69
69
  return false;
70
70
  // Local development — test BT
71
71
  if (hostname === 'localhost' ||
@@ -33,6 +33,13 @@ export interface PaymentOptions {
33
33
  threedsProvider?: ThreedsProvider;
34
34
  initiatedBy?: 'customer' | 'merchant';
35
35
  source?: 'upsell' | 'checkout' | 'offer' | 'missing_club' | 'forced';
36
+ /**
37
+ * Shipping rate selected by the customer. Forwarded on the payment
38
+ * request so the order is created with the right shipping method
39
+ * even if the session's stored rate hasn't fully round-tripped or
40
+ * got cleared (race conditions).
41
+ */
42
+ shippingRateId?: string;
36
43
  onSuccess?: (payment: Payment) => void;
37
44
  onFailure?: (error: string) => void;
38
45
  onRequireAction?: (payment: Payment) => void;
@@ -217,6 +217,7 @@ export function usePayment() {
217
217
  ...(threedsSessionId && { threedsSessionId }),
218
218
  ...(options.initiatedBy && { initiatedBy: options.initiatedBy }),
219
219
  ...(options.source && { source: options.source }),
220
+ ...(options.shippingRateId && { shippingRateId: options.shippingRateId }),
220
221
  },
221
222
  });
222
223
  console.log('Payment response:', response);