@tagadapay/plugin-sdk 2.7.29 → 2.7.31

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.
@@ -4,9 +4,6 @@ const DEFAULT_PREFIXES = ['', 'VITE_', 'REACT_APP_', 'NEXT_PUBLIC_'];
4
4
  * using a list of supported prefixes.
5
5
  */
6
6
  export function resolveEnvValue(key, prefixes = DEFAULT_PREFIXES) {
7
- console.log('process?.env', process?.env);
8
- console.log('import?.meta', import.meta);
9
- console.log('window', window);
10
7
  for (const prefix of prefixes) {
11
8
  const envKey = prefix ? `${prefix}${key}` : key;
12
9
  if (typeof process !== 'undefined' && process?.env?.[envKey]) {
@@ -5,7 +5,6 @@
5
5
  export interface UseOrderBumpQueryOptions {
6
6
  checkoutToken: string | null;
7
7
  offerId: string;
8
- checkout?: any;
9
8
  }
10
9
  export interface UseOrderBumpQueryResult {
11
10
  isSelected: boolean;
@@ -2,20 +2,18 @@
2
2
  * Order Bump Hook using TanStack Query
3
3
  * Replaces coordinator pattern with automatic cache invalidation
4
4
  */
5
- import { useState, useCallback, useEffect } from 'react';
6
- import { useApiMutation, useInvalidateQuery, getGlobalApiClient } from './useApiQuery';
5
+ import { useCallback, useEffect, useState } from 'react';
6
+ import { getGlobalApiClient, useApiMutation, useInvalidateQuery } from './useApiQuery';
7
7
  import { useCheckoutQuery } from './useCheckoutQuery';
8
8
  export function useOrderBumpQuery(options) {
9
- const { checkoutToken, offerId, checkout: providedCheckout } = options;
9
+ const { checkoutToken, offerId } = options;
10
10
  const { invalidateCheckout, invalidatePromotions } = useInvalidateQuery();
11
11
  const client = getGlobalApiClient();
12
12
  // Use checkout query only if no checkout is provided
13
- const { checkout: loadedCheckout } = useCheckoutQuery({
13
+ const { checkout } = useCheckoutQuery({
14
14
  checkoutToken: checkoutToken || undefined,
15
- enabled: !providedCheckout, // Enable if no checkout is provided, regardless of token
16
15
  });
17
16
  // Use provided checkout or loaded checkout
18
- const checkout = providedCheckout || loadedCheckout;
19
17
  // Get the actual checkout token from the checkout session
20
18
  const actualCheckoutToken = checkoutToken || checkout?.checkoutSession?.checkoutToken || null;
21
19
  // Function to check if order bump is selected
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagadapay/plugin-sdk",
3
- "version": "2.7.29",
3
+ "version": "2.7.31",
4
4
  "description": "Modern React SDK for building Tagada Pay plugins",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",