@sakeetech/viva-payments-core 0.2.6 → 0.2.7
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/webhooks/event-types.d.ts +28 -3
- package/dist/webhooks/event-types.d.ts.map +1 -1
- package/dist/webhooks/event-types.js +31 -4
- package/dist/webhooks/event-types.js.map +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.d.ts.map +1 -1
- package/dist/webhooks/index.js +2 -1
- package/dist/webhooks/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -32,12 +32,37 @@ export declare function isTransactionEvent(id: number): id is 1796 | 1797 | 1798
|
|
|
32
32
|
*/
|
|
33
33
|
export declare function isOnboardingEvent(id: number): id is 8193 | 8194;
|
|
34
34
|
/**
|
|
35
|
-
* All v1-scope event IDs as a frozen array.
|
|
35
|
+
* All v1-scope event IDs the webhook handler ACCEPTS INBOUND, as a frozen array.
|
|
36
36
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
37
|
+
* This is the route handler's allow-list for incoming notifications — it
|
|
38
|
+
* includes 4865 (Order Updated) because the endpoint legitimately RECEIVES
|
|
39
|
+
* order-cancellation events. It is NOT the set to register via the ISV API:
|
|
40
|
+
* 4865 is not registerable at the ISV partner-account level (see
|
|
41
|
+
* {@link ISV_EVENT_TYPE_IDS}). Use this for inbound validation only.
|
|
39
42
|
*
|
|
40
43
|
* @see references/viva-docs/md/webhooks-for-payments.txt:141
|
|
41
44
|
*/
|
|
42
45
|
export declare const V1_EVENT_TYPE_IDS: readonly (1796 | 1797 | 1798 | 4865 | 8193 | 8194)[];
|
|
46
|
+
/**
|
|
47
|
+
* Event IDs registerable via the ISV webhook API (`POST /isv/v1/webhooks`).
|
|
48
|
+
*
|
|
49
|
+
* The ISV partner-account webhook API accepts only the transaction events plus
|
|
50
|
+
* the two "Marketplace & ISV only" onboarding events. It does NOT accept 4865
|
|
51
|
+
* (Order Updated) — that is an order-level Smart Checkout event registerable
|
|
52
|
+
* only per-merchant via Self-Care, and `POST /isv/v1/webhooks` rejects it with
|
|
53
|
+
* `IsvCreateWebhookFailedInvalidEventTypeId`. (sakee-tech/vivawallet-npm-public#18)
|
|
54
|
+
*
|
|
55
|
+
* 1796 — Transaction Payment Created
|
|
56
|
+
* 1797 — Transaction Reversal Created
|
|
57
|
+
* 1798 — Transaction Failed
|
|
58
|
+
* 8193 — Account Connected (Marketplace & ISV only)
|
|
59
|
+
* 8194 — Account Verification Status Changed (Marketplace & ISV only)
|
|
60
|
+
*
|
|
61
|
+
* 1799 (Transaction Price Calculated) is intentionally excluded — it is
|
|
62
|
+
* deferred post-v1 (see DEFERRED_EVENT_TYPES).
|
|
63
|
+
*
|
|
64
|
+
* @see references/viva-docs/md/webhooks-for-payments.txt:222 (8193/8194 "Marketplace & ISV only")
|
|
65
|
+
* @see references/viva-docs/md/isv-partner-program.txt:200 (ISV webhook event list — no 4865)
|
|
66
|
+
*/
|
|
67
|
+
export declare const ISV_EVENT_TYPE_IDS: readonly (1796 | 1797 | 1798 | 8193 | 8194)[];
|
|
43
68
|
//# sourceMappingURL=event-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-types.d.ts","sourceRoot":"","sources":["../../src/webhooks/event-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE/E;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,IAAI,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAE9E;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,IAAI,IAAI,GAAG,IAAI,CAE/D;AAED
|
|
1
|
+
{"version":3,"file":"event-types.d.ts","sourceRoot":"","sources":["../../src/webhooks/event-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE/E;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,IAAI,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAE9E;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,IAAI,IAAI,GAAG,IAAI,CAE/D;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,EAEvE,CAAC;AAEZ;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,EAEjE,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @see references/viva-docs/md/webhooks-for-payments.txt:141
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.V1_EVENT_TYPE_IDS = exports.EVENT_TYPES = void 0;
|
|
11
|
+
exports.ISV_EVENT_TYPE_IDS = exports.V1_EVENT_TYPE_IDS = exports.EVENT_TYPES = void 0;
|
|
12
12
|
exports.isTransactionEvent = isTransactionEvent;
|
|
13
13
|
exports.isOnboardingEvent = isOnboardingEvent;
|
|
14
14
|
var webhook_events_js_1 = require("../types/webhook-events.js");
|
|
@@ -42,14 +42,41 @@ function isOnboardingEvent(id) {
|
|
|
42
42
|
return id === 8193 || id === 8194;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
* All v1-scope event IDs as a frozen array.
|
|
45
|
+
* All v1-scope event IDs the webhook handler ACCEPTS INBOUND, as a frozen array.
|
|
46
46
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
47
|
+
* This is the route handler's allow-list for incoming notifications — it
|
|
48
|
+
* includes 4865 (Order Updated) because the endpoint legitimately RECEIVES
|
|
49
|
+
* order-cancellation events. It is NOT the set to register via the ISV API:
|
|
50
|
+
* 4865 is not registerable at the ISV partner-account level (see
|
|
51
|
+
* {@link ISV_EVENT_TYPE_IDS}). Use this for inbound validation only.
|
|
49
52
|
*
|
|
50
53
|
* @see references/viva-docs/md/webhooks-for-payments.txt:141
|
|
51
54
|
*/
|
|
52
55
|
exports.V1_EVENT_TYPE_IDS = Object.freeze([
|
|
53
56
|
1796, 1797, 1798, 4865, 8193, 8194,
|
|
54
57
|
]);
|
|
58
|
+
/**
|
|
59
|
+
* Event IDs registerable via the ISV webhook API (`POST /isv/v1/webhooks`).
|
|
60
|
+
*
|
|
61
|
+
* The ISV partner-account webhook API accepts only the transaction events plus
|
|
62
|
+
* the two "Marketplace & ISV only" onboarding events. It does NOT accept 4865
|
|
63
|
+
* (Order Updated) — that is an order-level Smart Checkout event registerable
|
|
64
|
+
* only per-merchant via Self-Care, and `POST /isv/v1/webhooks` rejects it with
|
|
65
|
+
* `IsvCreateWebhookFailedInvalidEventTypeId`. (sakee-tech/vivawallet-npm-public#18)
|
|
66
|
+
*
|
|
67
|
+
* 1796 — Transaction Payment Created
|
|
68
|
+
* 1797 — Transaction Reversal Created
|
|
69
|
+
* 1798 — Transaction Failed
|
|
70
|
+
* 8193 — Account Connected (Marketplace & ISV only)
|
|
71
|
+
* 8194 — Account Verification Status Changed (Marketplace & ISV only)
|
|
72
|
+
*
|
|
73
|
+
* 1799 (Transaction Price Calculated) is intentionally excluded — it is
|
|
74
|
+
* deferred post-v1 (see DEFERRED_EVENT_TYPES).
|
|
75
|
+
*
|
|
76
|
+
* @see references/viva-docs/md/webhooks-for-payments.txt:222 (8193/8194 "Marketplace & ISV only")
|
|
77
|
+
* @see references/viva-docs/md/isv-partner-program.txt:200 (ISV webhook event list — no 4865)
|
|
78
|
+
*/
|
|
79
|
+
exports.ISV_EVENT_TYPE_IDS = Object.freeze([
|
|
80
|
+
1796, 1797, 1798, 8193, 8194,
|
|
81
|
+
]);
|
|
55
82
|
//# sourceMappingURL=event-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-types.js","sourceRoot":"","sources":["../../src/webhooks/event-types.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAgBH,gDAEC;AAYD,8CAEC;AA9BD,gEAA+E;AAAtE,gHAAA,WAAW,OAAA;AAEpB;;;;;;;;;;;GAWG;AACH,SAAgB,kBAAkB,CAAC,EAAU;IAC3C,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,CAAC;AAClE,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,iBAAiB,CAAC,EAAU;IAC1C,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,CAAC;AACpC,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"event-types.js","sourceRoot":"","sources":["../../src/webhooks/event-types.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAgBH,gDAEC;AAYD,8CAEC;AA9BD,gEAA+E;AAAtE,gHAAA,WAAW,OAAA;AAEpB;;;;;;;;;;;GAWG;AACH,SAAgB,kBAAkB,CAAC,EAAU;IAC3C,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,CAAC;AAClE,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,iBAAiB,CAAC,EAAU;IAC1C,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,CAAC;AACpC,CAAC;AAED;;;;;;;;;;GAUG;AACU,QAAA,iBAAiB,GAAyD,MAAM,CAAC,MAAM,CAAC;IACnG,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;CAC1B,CAAC,CAAC;AAEZ;;;;;;;;;;;;;;;;;;;;GAoBG;AACU,QAAA,kBAAkB,GAAkD,MAAM,CAAC,MAAM,CAAC;IAC7F,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;CACpB,CAAC,CAAC"}
|
package/dist/webhooks/index.d.ts
CHANGED
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
export { buildChallengeResponse } from './challenge-response.js';
|
|
16
16
|
export { VIVA_DEMO_IPS, VIVA_PROD_IPS, isAllowedSourceIp, } from './ip-allowlist.js';
|
|
17
17
|
export { extractClientIp, type ClientIpRequest, } from './extract-client-ip.js';
|
|
18
|
-
export { EVENT_TYPES, type VivaEventTypeId, isTransactionEvent, isOnboardingEvent, V1_EVENT_TYPE_IDS, } from './event-types.js';
|
|
18
|
+
export { EVENT_TYPES, type VivaEventTypeId, isTransactionEvent, isOnboardingEvent, V1_EVENT_TYPE_IDS, ISV_EVENT_TYPE_IDS, } from './event-types.js';
|
|
19
19
|
export { mapStatusLetter, validateStatusTransition, applyStatusTransition, type StatusTransitionResult, } from './status-lattice.js';
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/webhooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EACL,aAAa,EACb,aAAa,EACb,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,eAAe,EACf,KAAK,eAAe,GACrB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,WAAW,EACX,KAAK,eAAe,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/webhooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EACL,aAAa,EACb,aAAa,EACb,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,eAAe,EACf,KAAK,eAAe,GACrB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,WAAW,EACX,KAAK,eAAe,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAC"}
|
package/dist/webhooks/index.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @see references/viva-docs/md/webhooks-for-payments.txt:254
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.applyStatusTransition = exports.validateStatusTransition = exports.mapStatusLetter = exports.V1_EVENT_TYPE_IDS = exports.isOnboardingEvent = exports.isTransactionEvent = exports.EVENT_TYPES = exports.extractClientIp = exports.isAllowedSourceIp = exports.VIVA_PROD_IPS = exports.VIVA_DEMO_IPS = exports.buildChallengeResponse = void 0;
|
|
17
|
+
exports.applyStatusTransition = exports.validateStatusTransition = exports.mapStatusLetter = exports.ISV_EVENT_TYPE_IDS = exports.V1_EVENT_TYPE_IDS = exports.isOnboardingEvent = exports.isTransactionEvent = exports.EVENT_TYPES = exports.extractClientIp = exports.isAllowedSourceIp = exports.VIVA_PROD_IPS = exports.VIVA_DEMO_IPS = exports.buildChallengeResponse = void 0;
|
|
18
18
|
var challenge_response_js_1 = require("./challenge-response.js");
|
|
19
19
|
Object.defineProperty(exports, "buildChallengeResponse", { enumerable: true, get: function () { return challenge_response_js_1.buildChallengeResponse; } });
|
|
20
20
|
var ip_allowlist_js_1 = require("./ip-allowlist.js");
|
|
@@ -28,6 +28,7 @@ Object.defineProperty(exports, "EVENT_TYPES", { enumerable: true, get: function
|
|
|
28
28
|
Object.defineProperty(exports, "isTransactionEvent", { enumerable: true, get: function () { return event_types_js_1.isTransactionEvent; } });
|
|
29
29
|
Object.defineProperty(exports, "isOnboardingEvent", { enumerable: true, get: function () { return event_types_js_1.isOnboardingEvent; } });
|
|
30
30
|
Object.defineProperty(exports, "V1_EVENT_TYPE_IDS", { enumerable: true, get: function () { return event_types_js_1.V1_EVENT_TYPE_IDS; } });
|
|
31
|
+
Object.defineProperty(exports, "ISV_EVENT_TYPE_IDS", { enumerable: true, get: function () { return event_types_js_1.ISV_EVENT_TYPE_IDS; } });
|
|
31
32
|
var status_lattice_js_1 = require("./status-lattice.js");
|
|
32
33
|
Object.defineProperty(exports, "mapStatusLetter", { enumerable: true, get: function () { return status_lattice_js_1.mapStatusLetter; } });
|
|
33
34
|
Object.defineProperty(exports, "validateStatusTransition", { enumerable: true, get: function () { return status_lattice_js_1.validateStatusTransition; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webhooks/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,iEAAiE;AAAxD,+HAAA,sBAAsB,OAAA;AAE/B,qDAI2B;AAHzB,gHAAA,aAAa,OAAA;AACb,gHAAA,aAAa,OAAA;AACb,oHAAA,iBAAiB,OAAA;AAGnB,+DAGgC;AAF9B,uHAAA,eAAe,OAAA;AAIjB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webhooks/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,iEAAiE;AAAxD,+HAAA,sBAAsB,OAAA;AAE/B,qDAI2B;AAHzB,gHAAA,aAAa,OAAA;AACb,gHAAA,aAAa,OAAA;AACb,oHAAA,iBAAiB,OAAA;AAGnB,+DAGgC;AAF9B,uHAAA,eAAe,OAAA;AAIjB,mDAO0B;AANxB,6GAAA,WAAW,OAAA;AAEX,oHAAA,kBAAkB,OAAA;AAClB,mHAAA,iBAAiB,OAAA;AACjB,mHAAA,iBAAiB,OAAA;AACjB,oHAAA,kBAAkB,OAAA;AAGpB,yDAK6B;AAJ3B,oHAAA,eAAe,OAAA;AACf,6HAAA,wBAAwB,OAAA;AACxB,0HAAA,qBAAqB,OAAA"}
|
package/package.json
CHANGED