@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.
package/dist/external-tracker.js
CHANGED
|
@@ -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
|
-
|
|
134
|
-
|
|
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
|
-
//
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
}
|