@proxy-checkout/server-js 0.0.4-pr-76.17.1 → 0.0.4-pr-76.18.1
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/lifecycle.d.ts +7 -1
- package/dist/lifecycle.js +8 -1
- package/dist/version.d.ts +2 -2
- package/dist/version.js +1 -1
- package/dist/webhook-handler.js +15 -1
- package/package.json +1 -1
package/dist/lifecycle.d.ts
CHANGED
|
@@ -10,7 +10,13 @@ import type { MerchantProxySession } from "./sessions.js";
|
|
|
10
10
|
import type { MerchantProxySubscription } from "./subscriptions.js";
|
|
11
11
|
/** Session statuses that mean the payer has paid and entitlement may be granted. */
|
|
12
12
|
export declare const PROVISIONABLE_SESSION_STATUSES: Set<string>;
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Session statuses that are terminal from the SDK's lifecycle perspective — the
|
|
15
|
+
* automatic flow has stopped and the merchant must observe the outcome. This
|
|
16
|
+
* includes `merchant_action_required`, which halts the session pending merchant
|
|
17
|
+
* intervention; classifying it here keeps a `proxy_session.merchant_action_required`
|
|
18
|
+
* event from silently resolving to `ignored` and being marked processed.
|
|
19
|
+
*/
|
|
14
20
|
export declare const TERMINAL_SESSION_STATUSES: Set<string>;
|
|
15
21
|
/** Subscription statuses that mean the subscription is no longer active. */
|
|
16
22
|
export declare const ENDED_SUBSCRIPTION_STATUSES: Set<string>;
|
package/dist/lifecycle.js
CHANGED
|
@@ -9,11 +9,18 @@
|
|
|
9
9
|
import { ProxyCheckoutValidationError } from "./errors.js";
|
|
10
10
|
/** Session statuses that mean the payer has paid and entitlement may be granted. */
|
|
11
11
|
export const PROVISIONABLE_SESSION_STATUSES = new Set(["paid", "provisionable"]);
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Session statuses that are terminal from the SDK's lifecycle perspective — the
|
|
14
|
+
* automatic flow has stopped and the merchant must observe the outcome. This
|
|
15
|
+
* includes `merchant_action_required`, which halts the session pending merchant
|
|
16
|
+
* intervention; classifying it here keeps a `proxy_session.merchant_action_required`
|
|
17
|
+
* event from silently resolving to `ignored` and being marked processed.
|
|
18
|
+
*/
|
|
13
19
|
export const TERMINAL_SESSION_STATUSES = new Set([
|
|
14
20
|
"cancelled",
|
|
15
21
|
"expired",
|
|
16
22
|
"failed",
|
|
23
|
+
"merchant_action_required",
|
|
17
24
|
"provisioned",
|
|
18
25
|
"provisioning_failed",
|
|
19
26
|
]);
|
package/dist/version.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
|
|
2
|
-
export declare const proxyCheckoutServerSdkVersion = "0.0.4-pr-76.
|
|
3
|
-
export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.4-pr-76.
|
|
2
|
+
export declare const proxyCheckoutServerSdkVersion = "0.0.4-pr-76.18.1";
|
|
3
|
+
export declare const proxyCheckoutServerSdkUserAgent = "@proxy-checkout/server-js/0.0.4-pr-76.18.1";
|
package/dist/version.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const proxyCheckoutServerSdkName = "@proxy-checkout/server-js";
|
|
2
|
-
export const proxyCheckoutServerSdkVersion = "0.0.4-pr-76.
|
|
2
|
+
export const proxyCheckoutServerSdkVersion = "0.0.4-pr-76.18.1";
|
|
3
3
|
export const proxyCheckoutServerSdkUserAgent = `${proxyCheckoutServerSdkName}/${proxyCheckoutServerSdkVersion}`;
|
package/dist/webhook-handler.js
CHANGED
|
@@ -72,7 +72,21 @@ export class ProxyWebhooksResource {
|
|
|
72
72
|
throw error;
|
|
73
73
|
}
|
|
74
74
|
if (store !== undefined) {
|
|
75
|
-
|
|
75
|
+
try {
|
|
76
|
+
await store.markProcessed(event.id, toProcessRecord(resolved));
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
// The fulfillment ran, but committing idempotency failed. Best-effort
|
|
80
|
+
// release the claim so the event is reclaimable on a later delivery
|
|
81
|
+
// instead of being stuck in the in-flight branch forever.
|
|
82
|
+
try {
|
|
83
|
+
await store.markFailed(event.id, error);
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
// Never let a store failure shadow the original markProcessed error.
|
|
87
|
+
}
|
|
88
|
+
throw error;
|
|
89
|
+
}
|
|
76
90
|
}
|
|
77
91
|
return {
|
|
78
92
|
event,
|