@tagadapay/plugin-sdk 3.1.1 → 3.1.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TagadaPay External Tracker v3.1.1
2
+ * TagadaPay External Tracker v3.1.2
3
3
  * CDN Bundle - Standalone tracking for external pages (Debug Build)
4
4
  * @license MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TagadaPay External Tracker v3.1.1
2
+ * TagadaPay External Tracker v3.1.2
3
3
  * CDN Bundle - Standalone tracking for external pages
4
4
  * @license MIT
5
5
  */
@@ -127,30 +127,33 @@ export function usePaymentQuery() {
127
127
  }
128
128
  }
129
129
  break;
130
- case 'processor_auth':
130
+ case 'processor_auth': {
131
+ // Always auto-redirect for processor auth (e.g., 3DS, external payment flows)
132
+ if (actionData.metadata?.redirect?.redirectUrl) {
133
+ window.location.href = actionData.metadata.redirect.redirectUrl;
134
+ }
135
+ break;
136
+ }
131
137
  case 'redirect': {
138
+ // For redirect type, let funnel orchestrator handle navigation via callbacks
132
139
  // Only auto-redirect if explicitly enabled (disableAutoRedirect: false)
133
- // Default behavior: disable redirects and let funnel orchestrator handle navigation
134
- const shouldRedirect = options.disableAutoRedirect === false;
135
- if (shouldRedirect && actionData.metadata?.redirect?.redirectUrl) {
140
+ const shouldAutoRedirect = options.disableAutoRedirect === false;
141
+ if (shouldAutoRedirect && actionData.metadata?.redirect?.redirectUrl) {
136
142
  window.location.href = actionData.metadata.redirect.redirectUrl;
137
143
  }
138
- else {
139
- // If auto-redirect is disabled AND payment succeeded, call success callbacks
140
- // This allows funnel orchestrator to handle navigation
141
- if (payment.status === 'succeeded') {
142
- setIsLoading(false);
143
- const response = {
144
- paymentId: payment.id,
145
- payment,
146
- // Extract order from payment if available (for funnel path resolution)
147
- order: payment.order,
148
- };
149
- // Legacy callback (backwards compatibility)
150
- options.onSuccess?.(response);
151
- // Funnel-aligned callback (recommended)
152
- options.onPaymentSuccess?.(response);
153
- }
144
+ else if (payment.status === 'succeeded') {
145
+ // Payment succeeded - call success callbacks for funnel navigation
146
+ setIsLoading(false);
147
+ const response = {
148
+ paymentId: payment.id,
149
+ payment,
150
+ // Extract order from payment if available (for funnel path resolution)
151
+ order: payment.order,
152
+ };
153
+ // Legacy callback (backwards compatibility)
154
+ options.onSuccess?.(response);
155
+ // Funnel-aligned callback (recommended)
156
+ options.onPaymentSuccess?.(response);
154
157
  }
155
158
  break;
156
159
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagadapay/plugin-sdk",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "Modern React SDK for building Tagada Pay plugins",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",