@tineon/t9n 0.1.5 → 0.1.6
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/index.js +12 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -197,8 +197,12 @@ export class T9nCheckout {
|
|
|
197
197
|
}
|
|
198
198
|
const payload = (await res.json());
|
|
199
199
|
this.modal?.setConfirmPending(false);
|
|
200
|
-
this.
|
|
201
|
-
|
|
200
|
+
const normalized = this.normalizeStatus(payload.status);
|
|
201
|
+
this.emitStatus(normalized);
|
|
202
|
+
if (payload.status === "pending" ||
|
|
203
|
+
payload.status === "processing" ||
|
|
204
|
+
normalized === "pending_confirmation" ||
|
|
205
|
+
normalized === "awaiting_payment") {
|
|
202
206
|
this.modal?.showResult("failed", "No payment detected yet. Please try again.");
|
|
203
207
|
this.lastResultFailed = true;
|
|
204
208
|
this.modal?.setConfirmLabel("Retry check");
|
|
@@ -267,6 +271,12 @@ export class T9nCheckout {
|
|
|
267
271
|
this.emitFailOnce({ sessionId: this.sessionId, error: "checkout failed" });
|
|
268
272
|
}
|
|
269
273
|
}
|
|
274
|
+
if (normalized === "pending_confirmation" || normalized === "awaiting_payment") {
|
|
275
|
+
if (this.hasAttemptedConfirm) {
|
|
276
|
+
this.modal?.showResult("failed", "No payment detected yet. Please try again.");
|
|
277
|
+
this.lastResultFailed = true;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
270
280
|
}
|
|
271
281
|
if (payload.status === "expired") {
|
|
272
282
|
this.modal?.showResult("failed", "This session has expired.");
|