@sakeetech/viva-payments-core 0.2.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.
Files changed (203) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +413 -0
  3. package/dist/auth/http.d.ts +44 -0
  4. package/dist/auth/http.d.ts.map +1 -0
  5. package/dist/auth/http.js +80 -0
  6. package/dist/auth/http.js.map +1 -0
  7. package/dist/auth/index.d.ts +19 -0
  8. package/dist/auth/index.d.ts.map +1 -0
  9. package/dist/auth/index.js +18 -0
  10. package/dist/auth/index.js.map +1 -0
  11. package/dist/auth/oauth2-strategy.d.ts +117 -0
  12. package/dist/auth/oauth2-strategy.d.ts.map +1 -0
  13. package/dist/auth/oauth2-strategy.js +217 -0
  14. package/dist/auth/oauth2-strategy.js.map +1 -0
  15. package/dist/auth/reseller-strategy.d.ts +65 -0
  16. package/dist/auth/reseller-strategy.d.ts.map +1 -0
  17. package/dist/auth/reseller-strategy.js +68 -0
  18. package/dist/auth/reseller-strategy.js.map +1 -0
  19. package/dist/auth/single-flight.d.ts +81 -0
  20. package/dist/auth/single-flight.d.ts.map +1 -0
  21. package/dist/auth/single-flight.js +160 -0
  22. package/dist/auth/single-flight.js.map +1 -0
  23. package/dist/auth/token-cache.d.ts +50 -0
  24. package/dist/auth/token-cache.d.ts.map +1 -0
  25. package/dist/auth/token-cache.js +59 -0
  26. package/dist/auth/token-cache.js.map +1 -0
  27. package/dist/errors/api-error.d.ts +15 -0
  28. package/dist/errors/api-error.d.ts.map +1 -0
  29. package/dist/errors/api-error.js +18 -0
  30. package/dist/errors/api-error.js.map +1 -0
  31. package/dist/errors/auth-error.d.ts +14 -0
  32. package/dist/errors/auth-error.d.ts.map +1 -0
  33. package/dist/errors/auth-error.js +17 -0
  34. package/dist/errors/auth-error.js.map +1 -0
  35. package/dist/errors/base.d.ts +59 -0
  36. package/dist/errors/base.d.ts.map +1 -0
  37. package/dist/errors/base.js +51 -0
  38. package/dist/errors/base.js.map +1 -0
  39. package/dist/errors/index.d.ts +18 -0
  40. package/dist/errors/index.d.ts.map +1 -0
  41. package/dist/errors/index.js +16 -0
  42. package/dist/errors/index.js.map +1 -0
  43. package/dist/errors/mode-mismatch-error.d.ts +19 -0
  44. package/dist/errors/mode-mismatch-error.d.ts.map +1 -0
  45. package/dist/errors/mode-mismatch-error.js +22 -0
  46. package/dist/errors/mode-mismatch-error.js.map +1 -0
  47. package/dist/errors/rate-limit-error.d.ts +20 -0
  48. package/dist/errors/rate-limit-error.d.ts.map +1 -0
  49. package/dist/errors/rate-limit-error.js +20 -0
  50. package/dist/errors/rate-limit-error.js.map +1 -0
  51. package/dist/errors/validation-error.d.ts +14 -0
  52. package/dist/errors/validation-error.d.ts.map +1 -0
  53. package/dist/errors/validation-error.js +17 -0
  54. package/dist/errors/validation-error.js.map +1 -0
  55. package/dist/errors/webhook-error.d.ts +14 -0
  56. package/dist/errors/webhook-error.d.ts.map +1 -0
  57. package/dist/errors/webhook-error.js +17 -0
  58. package/dist/errors/webhook-error.js.map +1 -0
  59. package/dist/index.d.ts +15 -0
  60. package/dist/index.d.ts.map +1 -0
  61. package/dist/index.js +15 -0
  62. package/dist/index.js.map +1 -0
  63. package/dist/isv/accounts.d.ts +38 -0
  64. package/dist/isv/accounts.d.ts.map +1 -0
  65. package/dist/isv/accounts.js +60 -0
  66. package/dist/isv/accounts.js.map +1 -0
  67. package/dist/isv/client.d.ts +187 -0
  68. package/dist/isv/client.d.ts.map +1 -0
  69. package/dist/isv/client.js +465 -0
  70. package/dist/isv/client.js.map +1 -0
  71. package/dist/isv/index.d.ts +52 -0
  72. package/dist/isv/index.d.ts.map +1 -0
  73. package/dist/isv/index.js +53 -0
  74. package/dist/isv/index.js.map +1 -0
  75. package/dist/isv/legacy-basic-client.d.ts +122 -0
  76. package/dist/isv/legacy-basic-client.d.ts.map +1 -0
  77. package/dist/isv/legacy-basic-client.js +281 -0
  78. package/dist/isv/legacy-basic-client.js.map +1 -0
  79. package/dist/isv/payments.d.ts +199 -0
  80. package/dist/isv/payments.d.ts.map +1 -0
  81. package/dist/isv/payments.js +385 -0
  82. package/dist/isv/payments.js.map +1 -0
  83. package/dist/isv/sources.d.ts +80 -0
  84. package/dist/isv/sources.d.ts.map +1 -0
  85. package/dist/isv/sources.js +112 -0
  86. package/dist/isv/sources.js.map +1 -0
  87. package/dist/isv/webhooks-api.d.ts +48 -0
  88. package/dist/isv/webhooks-api.d.ts.map +1 -0
  89. package/dist/isv/webhooks-api.js +66 -0
  90. package/dist/isv/webhooks-api.js.map +1 -0
  91. package/dist/legacy/client.d.ts +199 -0
  92. package/dist/legacy/client.d.ts.map +1 -0
  93. package/dist/legacy/client.js +351 -0
  94. package/dist/legacy/client.js.map +1 -0
  95. package/dist/legacy/index.d.ts +15 -0
  96. package/dist/legacy/index.d.ts.map +1 -0
  97. package/dist/legacy/index.js +14 -0
  98. package/dist/legacy/index.js.map +1 -0
  99. package/dist/observability/context.d.ts +30 -0
  100. package/dist/observability/context.d.ts.map +1 -0
  101. package/dist/observability/context.js +40 -0
  102. package/dist/observability/context.js.map +1 -0
  103. package/dist/observability/index.d.ts +15 -0
  104. package/dist/observability/index.d.ts.map +1 -0
  105. package/dist/observability/index.js +11 -0
  106. package/dist/observability/index.js.map +1 -0
  107. package/dist/observability/logger.d.ts +81 -0
  108. package/dist/observability/logger.d.ts.map +1 -0
  109. package/dist/observability/logger.js +127 -0
  110. package/dist/observability/logger.js.map +1 -0
  111. package/dist/observability/metrics.d.ts +37 -0
  112. package/dist/observability/metrics.d.ts.map +1 -0
  113. package/dist/observability/metrics.js +40 -0
  114. package/dist/observability/metrics.js.map +1 -0
  115. package/dist/observability/redact.d.ts +21 -0
  116. package/dist/observability/redact.d.ts.map +1 -0
  117. package/dist/observability/redact.js +72 -0
  118. package/dist/observability/redact.js.map +1 -0
  119. package/dist/observability/tracer.d.ts +25 -0
  120. package/dist/observability/tracer.d.ts.map +1 -0
  121. package/dist/observability/tracer.js +18 -0
  122. package/dist/observability/tracer.js.map +1 -0
  123. package/dist/payments/client.d.ts +247 -0
  124. package/dist/payments/client.d.ts.map +1 -0
  125. package/dist/payments/client.js +488 -0
  126. package/dist/payments/client.js.map +1 -0
  127. package/dist/payments/index.d.ts +14 -0
  128. package/dist/payments/index.d.ts.map +1 -0
  129. package/dist/payments/index.js +13 -0
  130. package/dist/payments/index.js.map +1 -0
  131. package/dist/refunds/fast-refund-client.d.ts +128 -0
  132. package/dist/refunds/fast-refund-client.d.ts.map +1 -0
  133. package/dist/refunds/fast-refund-client.js +138 -0
  134. package/dist/refunds/fast-refund-client.js.map +1 -0
  135. package/dist/refunds/index.d.ts +19 -0
  136. package/dist/refunds/index.d.ts.map +1 -0
  137. package/dist/refunds/index.js +17 -0
  138. package/dist/refunds/index.js.map +1 -0
  139. package/dist/refunds/strategy.d.ts +78 -0
  140. package/dist/refunds/strategy.d.ts.map +1 -0
  141. package/dist/refunds/strategy.js +75 -0
  142. package/dist/refunds/strategy.js.map +1 -0
  143. package/dist/types/auth.d.ts +80 -0
  144. package/dist/types/auth.d.ts.map +1 -0
  145. package/dist/types/auth.js +12 -0
  146. package/dist/types/auth.js.map +1 -0
  147. package/dist/types/card-types.d.ts +48 -0
  148. package/dist/types/card-types.d.ts.map +1 -0
  149. package/dist/types/card-types.js +62 -0
  150. package/dist/types/card-types.js.map +1 -0
  151. package/dist/types/common.d.ts +160 -0
  152. package/dist/types/common.d.ts.map +1 -0
  153. package/dist/types/common.js +70 -0
  154. package/dist/types/common.js.map +1 -0
  155. package/dist/types/index.d.ts +21 -0
  156. package/dist/types/index.d.ts.map +1 -0
  157. package/dist/types/index.js +21 -0
  158. package/dist/types/index.js.map +1 -0
  159. package/dist/types/isv-accounts.d.ts +109 -0
  160. package/dist/types/isv-accounts.d.ts.map +1 -0
  161. package/dist/types/isv-accounts.js +22 -0
  162. package/dist/types/isv-accounts.js.map +1 -0
  163. package/dist/types/isv-payments.d.ts +262 -0
  164. package/dist/types/isv-payments.d.ts.map +1 -0
  165. package/dist/types/isv-payments.js +19 -0
  166. package/dist/types/isv-payments.js.map +1 -0
  167. package/dist/types/status.d.ts +125 -0
  168. package/dist/types/status.d.ts.map +1 -0
  169. package/dist/types/status.js +19 -0
  170. package/dist/types/status.js.map +1 -0
  171. package/dist/types/webhook-events.d.ts +447 -0
  172. package/dist/types/webhook-events.d.ts.map +1 -0
  173. package/dist/types/webhook-events.js +76 -0
  174. package/dist/types/webhook-events.js.map +1 -0
  175. package/dist/webhooks/challenge-response.d.ts +28 -0
  176. package/dist/webhooks/challenge-response.d.ts.map +1 -0
  177. package/dist/webhooks/challenge-response.js +35 -0
  178. package/dist/webhooks/challenge-response.js.map +1 -0
  179. package/dist/webhooks/event-types.d.ts +44 -0
  180. package/dist/webhooks/event-types.d.ts.map +1 -0
  181. package/dist/webhooks/event-types.js +50 -0
  182. package/dist/webhooks/event-types.js.map +1 -0
  183. package/dist/webhooks/extract-client-ip.d.ts +40 -0
  184. package/dist/webhooks/extract-client-ip.d.ts.map +1 -0
  185. package/dist/webhooks/extract-client-ip.js +72 -0
  186. package/dist/webhooks/extract-client-ip.js.map +1 -0
  187. package/dist/webhooks/hmac-verify.d.ts +38 -0
  188. package/dist/webhooks/hmac-verify.d.ts.map +1 -0
  189. package/dist/webhooks/hmac-verify.js +92 -0
  190. package/dist/webhooks/hmac-verify.js.map +1 -0
  191. package/dist/webhooks/index.d.ts +19 -0
  192. package/dist/webhooks/index.d.ts.map +1 -0
  193. package/dist/webhooks/index.js +19 -0
  194. package/dist/webhooks/index.js.map +1 -0
  195. package/dist/webhooks/ip-allowlist.d.ts +59 -0
  196. package/dist/webhooks/ip-allowlist.d.ts.map +1 -0
  197. package/dist/webhooks/ip-allowlist.js +147 -0
  198. package/dist/webhooks/ip-allowlist.js.map +1 -0
  199. package/dist/webhooks/status-lattice.d.ts +72 -0
  200. package/dist/webhooks/status-lattice.d.ts.map +1 -0
  201. package/dist/webhooks/status-lattice.js +208 -0
  202. package/dist/webhooks/status-lattice.js.map +1 -0
  203. package/package.json +85 -0
@@ -0,0 +1,66 @@
1
+ /**
2
+ * IsvWebhooks — ISV Webhook Registration API.
3
+ *
4
+ * Probe-verified 2026-05-11. Endpoints below match `docs/payment-isv-api.yaml`.
5
+ *
6
+ * - registerWebhook → POST /isv/v1/webhooks (204 No Content)
7
+ * - getVerificationKey → GET /isv/v1/webhooks/token (200 {key})
8
+ *
9
+ * Intentionally absent — these endpoints are NOT exposed by the ISV API:
10
+ *
11
+ * - listWebhooks (no GET on /isv/v1/webhooks; only POST)
12
+ * - deactivate/delete (no PATCH/DELETE; manage existing entries via the
13
+ * banking UI or by re-registering)
14
+ *
15
+ * Auth: OAuth2 Bearer with scopes
16
+ * `urn:viva:payments:core:api:isv urn:viva:payments:core:api:redirectcheckout`.
17
+ *
18
+ * Limits: max 10 URLs per `eventTypeId`. Exceeding the cap returns HTTP 400
19
+ * with `eventId: 3732` (`SecurityCreateWebhookFailedLimitReached`).
20
+ */
21
+ export class IsvWebhooks {
22
+ client;
23
+ constructor(client) {
24
+ this.client = client;
25
+ }
26
+ /**
27
+ * Register a webhook URL for an event type.
28
+ *
29
+ * Server returns 204 No Content on success. Re-posting the same URL for
30
+ * the same event type does not error — it is the caller's responsibility
31
+ * to avoid duplicates (the API has no list endpoint).
32
+ *
33
+ * Throws `VivaApiError` with `vivaCode: '3732'` if the 10-URL-per-event cap
34
+ * is exceeded.
35
+ */
36
+ async registerWebhook(req) {
37
+ await this.client.request({
38
+ method: 'POST',
39
+ path: '/isv/v1/webhooks',
40
+ body: {
41
+ eventTypeId: req.eventTypeId,
42
+ url: req.url,
43
+ },
44
+ idempotent: true,
45
+ endpoint: 'POST /isv/v1/webhooks',
46
+ });
47
+ }
48
+ /**
49
+ * Retrieve the ISV-level webhook verification key.
50
+ *
51
+ * The returned `key` must be echoed in the JSON response to the URL-verify
52
+ * GET handshake Viva performs against the webhook endpoint.
53
+ *
54
+ * Note: a single key is issued per ISV account; it does not vary per
55
+ * registered URL.
56
+ */
57
+ async getVerificationKey() {
58
+ return this.client.request({
59
+ method: 'GET',
60
+ path: '/isv/v1/webhooks/token',
61
+ idempotent: true,
62
+ endpoint: 'GET /isv/v1/webhooks/token',
63
+ });
64
+ }
65
+ }
66
+ //# sourceMappingURL=webhooks-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks-api.js","sourceRoot":"","sources":["../../src/isv/webhooks-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAQH,MAAM,OAAO,WAAW;IACO;IAA7B,YAA6B,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAEtD;;;;;;;;;OASG;IACH,KAAK,CAAC,eAAe,CAAC,GAA2B;QAC/C,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAO;YAC9B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,WAAW,EAAE,GAAG,CAAC,WAAW;gBAC5B,GAAG,EAAE,GAAG,CAAC,GAAG;aACb;YACD,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,uBAAuB;SAClC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,kBAAkB;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAA6B;YACrD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,wBAAwB;YAC9B,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,4BAA4B;SACvC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,199 @@
1
+ /**
2
+ * BasicAuthClient — HTTP client for Viva legacy API endpoints (Basic auth).
3
+ *
4
+ * Viva exposes a subset of endpoints ONLY on their legacy host
5
+ * (`demo.vivapayments.com` / `www.vivapayments.com`) behind Basic auth
6
+ * (MerchantId:ApiKey). These endpoints are NOT available on the v2/OAuth2
7
+ * surface (`demo-api.vivapayments.com`).
8
+ *
9
+ * Verified against Viva sandbox 2026-04-25:
10
+ * - Refund: `POST /api/transactions/{transactionId}` on legacy host with Basic auth.
11
+ * - Body: `application/x-www-form-urlencoded` — `Amount={minor}&SourceCode={code}`.
12
+ * - Response: PascalCase JSON `{StatusId, Amount, TransactionId, ...}`.
13
+ * - `POST /checkout/v2/transactions/{id}` (v2) returns 405 → NOT valid.
14
+ *
15
+ * Design:
16
+ * - NOT a fallback. This is the PRIMARY (and only) client for legacy endpoints.
17
+ * - Same retry / error-shape conventions as IsvHttpClient.
18
+ * - Form-encoded body builder via URLSearchParams (built-in, zero deps).
19
+ * - Tracing headers (`x-viva-correlationid`, `x-viva-eventid`) extracted and
20
+ * attached to errors and successful responses.
21
+ *
22
+ * @see references/viva-docs/md/tut-create-recurring-payment.txt:288
23
+ * @see references/viva-docs/md/merchant-id-and-api-key.txt:1
24
+ */
25
+ import type { Dispatcher } from 'undici';
26
+ import type { VivaEnvironment } from '../types/index.js';
27
+ import type { MetricsHook } from '../observability/index.js';
28
+ /**
29
+ * Which Basic-auth flavour to use when calling Viva's legacy host.
30
+ *
31
+ * - `merchant`: standard MerchantId/ApiKey Basic auth — used by single-merchant
32
+ * integrations (the original `BasicAuthClient` flavour).
33
+ * - `reseller`: ISV/reseller Basic auth scoped to one connected merchant —
34
+ * username is `ResellerId:MerchantId`, password is `ResellerApiKey`. Used by
35
+ * ISV admin operations such as `POST /api/sources`.
36
+ *
37
+ * @see docs/AUTH.md §1.2
38
+ */
39
+ export type BasicAuthVariant = 'merchant' | 'reseller';
40
+ /** Fields shared by both Basic-auth variants. */
41
+ interface BasicAuthClientCommonConfig {
42
+ /**
43
+ * Viva environment selector. Determines legacy host.
44
+ * demo → https://demo.vivapayments.com
45
+ * production → https://www.vivapayments.com
46
+ */
47
+ environment: VivaEnvironment;
48
+ /** Override undici dispatcher for tests (e.g. MockAgent). */
49
+ dispatcher?: Dispatcher;
50
+ /** Override global fetch. Defaults to undici fetch when dispatcher is provided. */
51
+ fetchImpl?: typeof fetch;
52
+ /** Clock override for tests. Defaults to Date.now. */
53
+ now?: () => number;
54
+ /**
55
+ * Exponential backoff schedule in milliseconds.
56
+ * Default: [500, 1500, 4500].
57
+ */
58
+ retryBackoffsMs?: number[];
59
+ /** Jitter ratio applied to each backoff (±ratio * backoff). Default: 0.2. */
60
+ jitterRatio?: number;
61
+ /** Default per-request timeout in milliseconds. Default: 30_000. */
62
+ defaultTimeoutMs?: number;
63
+ /** Optional metrics hook. */
64
+ metrics?: MetricsHook;
65
+ }
66
+ /**
67
+ * Merchant-flavoured Basic auth: `Basic base64(merchantId:apiKey)`.
68
+ *
69
+ * `authVariant` is optional and defaults to `'merchant'` so pre-existing call
70
+ * sites that did not set the discriminator continue to compile.
71
+ *
72
+ * @see docs/AUTH.md §1.2 (Merchant Basic)
73
+ * @see references/viva-docs/md/merchant-id-and-api-key.txt:1
74
+ */
75
+ export interface MerchantBasicAuthClientConfig extends BasicAuthClientCommonConfig {
76
+ authVariant?: 'merchant';
77
+ /**
78
+ * Merchant ID (UUID). Used as the Basic-auth username.
79
+ * @see references/viva-docs/md/merchant-id-and-api-key.txt:1
80
+ */
81
+ merchantId: string;
82
+ /**
83
+ * API Key. Used as the Basic-auth password.
84
+ * @see references/viva-docs/md/merchant-id-and-api-key.txt:1
85
+ */
86
+ apiKey: string;
87
+ }
88
+ /**
89
+ * Reseller-flavoured Basic auth: `Basic base64(resellerId:merchantId:resellerApiKey)`.
90
+ *
91
+ * The reseller credentials are scoped to **one** connected merchant per
92
+ * instance — to operate on multiple merchants under the same reseller account,
93
+ * construct multiple `BasicAuthClient` instances.
94
+ *
95
+ * @see docs/AUTH.md §1.2 (Reseller Basic)
96
+ */
97
+ export interface ResellerBasicAuthClientConfig extends BasicAuthClientCommonConfig {
98
+ authVariant: 'reseller';
99
+ /** Reseller ID (UUID) — the ISV's reseller account. */
100
+ resellerId: string;
101
+ /** Connected merchant ID (UUID) — the merchant the reseller is operating on. */
102
+ merchantId: string;
103
+ /** Reseller API key. */
104
+ resellerApiKey: string;
105
+ }
106
+ export type BasicAuthClientConfig = MerchantBasicAuthClientConfig | ResellerBasicAuthClientConfig;
107
+ export interface LegacyRequestOptions {
108
+ method: 'GET' | 'POST';
109
+ path: string;
110
+ /** Form-encoded key-value pairs (values coerced to string). */
111
+ formBody?: Record<string, string | number | bigint | undefined>;
112
+ /**
113
+ * JSON body (sent as `application/json`). Mutually exclusive with `formBody`.
114
+ * Used by endpoints such as `POST /api/sources` that expect JSON rather than
115
+ * the legacy `application/x-www-form-urlencoded` shape.
116
+ */
117
+ jsonBody?: Record<string, unknown>;
118
+ /**
119
+ * When true: retries on 429 and 5xx per the backoff schedule.
120
+ * When false: only retries on connection-level errors.
121
+ */
122
+ idempotent: boolean;
123
+ timeoutMs?: number;
124
+ /** Endpoint label for metrics. */
125
+ endpoint?: string;
126
+ }
127
+ /**
128
+ * Wrapper returned from successful legacy API calls.
129
+ * Includes Viva tracing headers for observability.
130
+ */
131
+ export interface LegacyApiResult<T> {
132
+ data: T;
133
+ /** `x-viva-correlationid` header value (e.g. "26-115-EDAA55BC"). */
134
+ vivaCorrelationId: string | undefined;
135
+ /** `x-viva-eventid` header value (e.g. "0"). */
136
+ vivaEventId: string | undefined;
137
+ }
138
+ /**
139
+ * HTTP client for Viva legacy API endpoints (Basic auth + legacy host).
140
+ *
141
+ * Instantiate once per (merchantId + apiKey + environment) tuple.
142
+ * Thread-safe; no shared mutable state.
143
+ */
144
+ export declare class BasicAuthClient {
145
+ private readonly legacyBaseUrl;
146
+ private readonly authorizationHeader;
147
+ private readonly authVariant;
148
+ private readonly dispatcher;
149
+ private readonly fetchImpl;
150
+ private readonly now;
151
+ private readonly backoffsMs;
152
+ private readonly jitterRatio;
153
+ private readonly defaultTimeoutMs;
154
+ private readonly metrics;
155
+ constructor(config: BasicAuthClientConfig);
156
+ /**
157
+ * Execute a request against the Viva legacy API.
158
+ *
159
+ * Returns a `LegacyApiResult<T>` wrapping both the parsed response and the
160
+ * Viva tracing headers (`x-viva-correlationid`, `x-viva-eventid`).
161
+ *
162
+ * @see references/viva-docs/md/tut-create-recurring-payment.txt:288
163
+ */
164
+ request<T>(opts: LegacyRequestOptions): Promise<LegacyApiResult<T>>;
165
+ /**
166
+ * Fetch the webhook verification key from the merchant-mode Viva legacy API.
167
+ *
168
+ * Calls `GET /api/messages/config/token` with Merchant Basic auth and returns
169
+ * the verification key string that the operator must paste into Viva Self
170
+ * Care → Sales → API Access → Webhooks. Used by the
171
+ * `viva-register-webhooks --apply` CLI in merchant mode.
172
+ *
173
+ * Response shape is tolerated in both casings — the Viva docs show `"Key"`
174
+ * but field-name canonicality has not been probe-verified yet, so both
175
+ * `{ Key }` and `{ key }` are accepted.
176
+ *
177
+ * @see docs/ENDPOINTS.md §8.1
178
+ * @see references/viva-docs/md/webhooks-for-payments.txt:311
179
+ */
180
+ fetchWebhookVerificationKey(): Promise<string>;
181
+ /**
182
+ * Build the `Authorization: Basic <base64>` header per variant.
183
+ *
184
+ * - merchant: `base64(merchantId:apiKey)`
185
+ * - reseller: `base64(resellerId:merchantId:resellerApiKey)`
186
+ *
187
+ * @see docs/AUTH.md §1.2
188
+ */
189
+ private static buildAuthorizationHeader;
190
+ private _executeWithRetry;
191
+ private _attempt;
192
+ private _backoffMs;
193
+ private _retryAfterMs;
194
+ private _parseErrorBody;
195
+ private _isConnectionError;
196
+ private _sleep;
197
+ }
198
+ export {};
199
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/legacy/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAO7D;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB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a;IAUrB,OAAO,CAAC,eAAe;IA2BvB,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,MAAM;CAGf"}
@@ -0,0 +1,351 @@
1
+ /**
2
+ * BasicAuthClient — HTTP client for Viva legacy API endpoints (Basic auth).
3
+ *
4
+ * Viva exposes a subset of endpoints ONLY on their legacy host
5
+ * (`demo.vivapayments.com` / `www.vivapayments.com`) behind Basic auth
6
+ * (MerchantId:ApiKey). These endpoints are NOT available on the v2/OAuth2
7
+ * surface (`demo-api.vivapayments.com`).
8
+ *
9
+ * Verified against Viva sandbox 2026-04-25:
10
+ * - Refund: `POST /api/transactions/{transactionId}` on legacy host with Basic auth.
11
+ * - Body: `application/x-www-form-urlencoded` — `Amount={minor}&SourceCode={code}`.
12
+ * - Response: PascalCase JSON `{StatusId, Amount, TransactionId, ...}`.
13
+ * - `POST /checkout/v2/transactions/{id}` (v2) returns 405 → NOT valid.
14
+ *
15
+ * Design:
16
+ * - NOT a fallback. This is the PRIMARY (and only) client for legacy endpoints.
17
+ * - Same retry / error-shape conventions as IsvHttpClient.
18
+ * - Form-encoded body builder via URLSearchParams (built-in, zero deps).
19
+ * - Tracing headers (`x-viva-correlationid`, `x-viva-eventid`) extracted and
20
+ * attached to errors and successful responses.
21
+ *
22
+ * @see references/viva-docs/md/tut-create-recurring-payment.txt:288
23
+ * @see references/viva-docs/md/merchant-id-and-api-key.txt:1
24
+ */
25
+ import { fetch as undiciFetch } from 'undici';
26
+ import { LEGACY_HOST } from '../types/index.js';
27
+ import { VivaApiError, VivaAuthError, VivaRateLimitError } from '../errors/index.js';
28
+ import { NoopMetricsHook } from '../observability/index.js';
29
+ // ---------------------------------------------------------------------------
30
+ // Constants
31
+ // ---------------------------------------------------------------------------
32
+ const DEFAULT_BACKOFFS_MS = [500, 1500, 4500];
33
+ const DEFAULT_JITTER_RATIO = 0.2;
34
+ const DEFAULT_TIMEOUT_MS = 30_000;
35
+ const MAX_RETRIES = 3;
36
+ const CONNECTION_ERROR_CODES = new Set([
37
+ 'ECONNRESET',
38
+ 'ENOTFOUND',
39
+ 'ETIMEDOUT',
40
+ 'ECONNREFUSED',
41
+ 'ECONNABORTED',
42
+ 'UND_ERR_CONNECT_TIMEOUT',
43
+ 'UND_ERR_HEADERS_TIMEOUT',
44
+ 'UND_ERR_BODY_TIMEOUT',
45
+ ]);
46
+ // ---------------------------------------------------------------------------
47
+ // BasicAuthClient
48
+ // ---------------------------------------------------------------------------
49
+ /**
50
+ * HTTP client for Viva legacy API endpoints (Basic auth + legacy host).
51
+ *
52
+ * Instantiate once per (merchantId + apiKey + environment) tuple.
53
+ * Thread-safe; no shared mutable state.
54
+ */
55
+ export class BasicAuthClient {
56
+ legacyBaseUrl;
57
+ authorizationHeader;
58
+ authVariant;
59
+ dispatcher;
60
+ fetchImpl;
61
+ now;
62
+ backoffsMs;
63
+ jitterRatio;
64
+ defaultTimeoutMs;
65
+ metrics;
66
+ constructor(config) {
67
+ this.legacyBaseUrl = LEGACY_HOST[config.environment];
68
+ this.authVariant = config.authVariant ?? 'merchant';
69
+ this.authorizationHeader = BasicAuthClient.buildAuthorizationHeader(config);
70
+ this.now = config.now ?? (() => Date.now());
71
+ this.backoffsMs = config.retryBackoffsMs ?? DEFAULT_BACKOFFS_MS;
72
+ this.jitterRatio = config.jitterRatio ?? DEFAULT_JITTER_RATIO;
73
+ this.defaultTimeoutMs = config.defaultTimeoutMs ?? DEFAULT_TIMEOUT_MS;
74
+ this.metrics = config.metrics ?? new NoopMetricsHook();
75
+ if (config.dispatcher) {
76
+ this.dispatcher = config.dispatcher;
77
+ this.fetchImpl = config.fetchImpl ?? undiciFetch;
78
+ }
79
+ else {
80
+ this.dispatcher = undefined;
81
+ this.fetchImpl = config.fetchImpl ?? undiciFetch;
82
+ }
83
+ }
84
+ /**
85
+ * Execute a request against the Viva legacy API.
86
+ *
87
+ * Returns a `LegacyApiResult<T>` wrapping both the parsed response and the
88
+ * Viva tracing headers (`x-viva-correlationid`, `x-viva-eventid`).
89
+ *
90
+ * @see references/viva-docs/md/tut-create-recurring-payment.txt:288
91
+ */
92
+ async request(opts) {
93
+ const endpoint = opts.endpoint ?? `${opts.method} ${opts.path}`;
94
+ return this.metrics.timeAsync('viva_legacy_api_request_duration_seconds', () => this._executeWithRetry(opts), { endpoint });
95
+ }
96
+ /**
97
+ * Fetch the webhook verification key from the merchant-mode Viva legacy API.
98
+ *
99
+ * Calls `GET /api/messages/config/token` with Merchant Basic auth and returns
100
+ * the verification key string that the operator must paste into Viva Self
101
+ * Care → Sales → API Access → Webhooks. Used by the
102
+ * `viva-register-webhooks --apply` CLI in merchant mode.
103
+ *
104
+ * Response shape is tolerated in both casings — the Viva docs show `"Key"`
105
+ * but field-name canonicality has not been probe-verified yet, so both
106
+ * `{ Key }` and `{ key }` are accepted.
107
+ *
108
+ * @see docs/ENDPOINTS.md §8.1
109
+ * @see references/viva-docs/md/webhooks-for-payments.txt:311
110
+ */
111
+ async fetchWebhookVerificationKey() {
112
+ const result = await this.request({
113
+ method: 'GET',
114
+ path: '/api/messages/config/token',
115
+ idempotent: true,
116
+ endpoint: 'GET /api/messages/config/token',
117
+ });
118
+ const body = result.data ?? {};
119
+ const rawKey = typeof body['Key'] === 'string'
120
+ ? body['Key']
121
+ : typeof body['key'] === 'string'
122
+ ? body['key']
123
+ : undefined;
124
+ if (!rawKey || rawKey.length === 0) {
125
+ throw new VivaApiError({
126
+ message: 'Viva legacy API returned no verification key from GET /api/messages/config/token ' +
127
+ '(expected `Key` or `key` field on the response body)',
128
+ requestId: result.vivaCorrelationId,
129
+ });
130
+ }
131
+ return rawKey;
132
+ }
133
+ // --------------------------------------------------------------------------
134
+ // Private helpers
135
+ // --------------------------------------------------------------------------
136
+ /**
137
+ * Build the `Authorization: Basic <base64>` header per variant.
138
+ *
139
+ * - merchant: `base64(merchantId:apiKey)`
140
+ * - reseller: `base64(resellerId:merchantId:resellerApiKey)`
141
+ *
142
+ * @see docs/AUTH.md §1.2
143
+ */
144
+ static buildAuthorizationHeader(config) {
145
+ if (config.authVariant === 'reseller') {
146
+ const { resellerId, merchantId, resellerApiKey } = config;
147
+ if (!resellerId || !merchantId || !resellerApiKey) {
148
+ throw new TypeError('BasicAuthClient: reseller variant requires non-empty resellerId, merchantId, and resellerApiKey');
149
+ }
150
+ const encoded = Buffer.from(`${resellerId}:${merchantId}:${resellerApiKey}`).toString('base64');
151
+ return `Basic ${encoded}`;
152
+ }
153
+ // merchant (default — authVariant either 'merchant' or undefined)
154
+ const { merchantId, apiKey } = config;
155
+ if (!merchantId || !apiKey) {
156
+ throw new TypeError('BasicAuthClient: merchant variant requires non-empty merchantId and apiKey');
157
+ }
158
+ const encoded = Buffer.from(`${merchantId}:${apiKey}`).toString('base64');
159
+ return `Basic ${encoded}`;
160
+ }
161
+ async _executeWithRetry(opts) {
162
+ let attempt = 0;
163
+ // eslint-disable-next-line no-constant-condition
164
+ while (true) {
165
+ const { response, text } = await this._attempt(opts);
166
+ const vivaCorrelationId = response.headers.get('x-viva-correlationid') ?? undefined;
167
+ const vivaEventId = response.headers.get('x-viva-eventid') ?? undefined;
168
+ // --- happy path ---
169
+ if (response.status >= 200 && response.status < 300) {
170
+ if (!text || response.status === 204) {
171
+ return { data: undefined, vivaCorrelationId, vivaEventId };
172
+ }
173
+ const data = JSON.parse(text);
174
+ return { data, vivaCorrelationId, vivaEventId };
175
+ }
176
+ // --- 401 ---
177
+ if (response.status === 401) {
178
+ const hint = this.authVariant === 'reseller'
179
+ ? 'check resellerId, merchantId, and resellerApiKey'
180
+ : 'check merchantId and apiKey';
181
+ throw new VivaAuthError({
182
+ message: `Viva legacy API authentication failed (HTTP 401) — ${hint}`,
183
+ httpStatus: 401,
184
+ requestId: vivaCorrelationId,
185
+ });
186
+ }
187
+ // --- 429 ---
188
+ if (response.status === 429) {
189
+ if (opts.idempotent && attempt < MAX_RETRIES) {
190
+ const retryAfterMs = this._retryAfterMs(response) ?? this._backoffMs(attempt);
191
+ await this._sleep(retryAfterMs);
192
+ attempt++;
193
+ continue;
194
+ }
195
+ const retryAfterMs = this._retryAfterMs(response);
196
+ throw new VivaRateLimitError({
197
+ message: 'Viva legacy API rate limited (HTTP 429)',
198
+ httpStatus: 429,
199
+ requestId: vivaCorrelationId,
200
+ ...(retryAfterMs !== undefined ? { retryAfterMs } : {}),
201
+ });
202
+ }
203
+ // --- 5xx ---
204
+ if (response.status >= 500) {
205
+ if (opts.idempotent && attempt < MAX_RETRIES) {
206
+ const backoffMs = this._backoffMs(attempt);
207
+ await this._sleep(backoffMs);
208
+ attempt++;
209
+ continue;
210
+ }
211
+ const { vivaCode, vivaMessage } = this._parseErrorBody(text);
212
+ throw new VivaApiError({
213
+ message: vivaMessage ?? `Viva legacy API error (HTTP ${response.status})`,
214
+ httpStatus: response.status,
215
+ vivaCode,
216
+ requestId: vivaCorrelationId,
217
+ });
218
+ }
219
+ // --- other 4xx ---
220
+ {
221
+ const { vivaCode, vivaMessage } = this._parseErrorBody(text);
222
+ throw new VivaApiError({
223
+ message: vivaMessage ?? `Viva legacy API error (HTTP ${response.status})`,
224
+ httpStatus: response.status,
225
+ vivaCode,
226
+ requestId: vivaCorrelationId,
227
+ });
228
+ }
229
+ }
230
+ }
231
+ async _attempt(opts) {
232
+ const url = `${this.legacyBaseUrl}${opts.path}`;
233
+ const timeoutMs = opts.timeoutMs ?? this.defaultTimeoutMs;
234
+ const controller = new AbortController();
235
+ const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
236
+ const headers = {
237
+ Authorization: this.authorizationHeader,
238
+ Accept: 'application/json',
239
+ };
240
+ const fetchOptions = {
241
+ method: opts.method,
242
+ headers,
243
+ signal: controller.signal,
244
+ };
245
+ // Body encoding — JSON for endpoints that take `application/json`
246
+ // (e.g. POST /api/sources under reseller Basic auth), form-urlencoded for
247
+ // legacy endpoints (refunds). Mutually exclusive — JSON wins if both set.
248
+ if (opts.jsonBody !== undefined) {
249
+ fetchOptions.body = JSON.stringify(opts.jsonBody);
250
+ headers['Content-Type'] = 'application/json';
251
+ }
252
+ else if (opts.formBody && Object.keys(opts.formBody).length > 0) {
253
+ const params = new URLSearchParams();
254
+ for (const [k, v] of Object.entries(opts.formBody)) {
255
+ if (v !== undefined) {
256
+ params.set(k, String(v));
257
+ }
258
+ }
259
+ fetchOptions.body = params.toString();
260
+ headers['Content-Type'] = 'application/x-www-form-urlencoded';
261
+ }
262
+ if (this.dispatcher) {
263
+ fetchOptions['dispatcher'] = this.dispatcher;
264
+ }
265
+ let maxConnectionRetries = opts.idempotent ? 0 : 1;
266
+ let connAttempt = 0;
267
+ // eslint-disable-next-line no-constant-condition
268
+ while (true) {
269
+ try {
270
+ const response = await this.fetchImpl(url, fetchOptions);
271
+ clearTimeout(timeoutId);
272
+ const text = await response.text();
273
+ return { response, text };
274
+ }
275
+ catch (err) {
276
+ clearTimeout(timeoutId);
277
+ const isConnectionError = this._isConnectionError(err);
278
+ const isAbort = err instanceof Error && err.name === 'AbortError';
279
+ if ((isConnectionError || isAbort) && !opts.idempotent && connAttempt < maxConnectionRetries) {
280
+ connAttempt++;
281
+ continue;
282
+ }
283
+ throw new VivaApiError({
284
+ message: isAbort
285
+ ? `Viva legacy API request timed out after ${timeoutMs}ms`
286
+ : `Viva legacy API network error: ${err instanceof Error ? err.message : String(err)}`,
287
+ cause: err,
288
+ });
289
+ }
290
+ }
291
+ }
292
+ _backoffMs(attempt) {
293
+ const base = this.backoffsMs[attempt] ?? this.backoffsMs[this.backoffsMs.length - 1] ?? 500;
294
+ const jitter = base * this.jitterRatio * (Math.random() * 2 - 1);
295
+ return Math.max(0, Math.round(base + jitter));
296
+ }
297
+ _retryAfterMs(response) {
298
+ const header = response.headers.get('Retry-After');
299
+ if (!header)
300
+ return undefined;
301
+ const seconds = parseFloat(header);
302
+ if (!isNaN(seconds))
303
+ return Math.max(0, Math.round(seconds * 1000));
304
+ const date = new Date(header).getTime();
305
+ if (!isNaN(date))
306
+ return Math.max(0, date - this.now());
307
+ return undefined;
308
+ }
309
+ _parseErrorBody(text) {
310
+ if (!text)
311
+ return {};
312
+ try {
313
+ const parsed = JSON.parse(text);
314
+ const vivaCode = typeof parsed['ErrorCode'] === 'number'
315
+ ? String(parsed['ErrorCode'])
316
+ : typeof parsed['errorCode'] === 'number'
317
+ ? String(parsed['errorCode'])
318
+ : typeof parsed['error'] === 'string'
319
+ ? parsed['error']
320
+ : undefined;
321
+ const vivaMessage = typeof parsed['Message'] === 'string'
322
+ ? parsed['Message']
323
+ : typeof parsed['message'] === 'string'
324
+ ? parsed['message']
325
+ : undefined;
326
+ const result = {};
327
+ if (vivaCode !== undefined)
328
+ result.vivaCode = vivaCode;
329
+ if (vivaMessage !== undefined)
330
+ result.vivaMessage = vivaMessage;
331
+ return result;
332
+ }
333
+ catch {
334
+ return {};
335
+ }
336
+ }
337
+ _isConnectionError(err) {
338
+ if (!(err instanceof Error))
339
+ return false;
340
+ const code = err.code;
341
+ if (code && CONNECTION_ERROR_CODES.has(code))
342
+ return true;
343
+ if (err.message.includes('ECONNRESET') || err.message.includes('ENOTFOUND'))
344
+ return true;
345
+ return false;
346
+ }
347
+ _sleep(ms) {
348
+ return new Promise((resolve) => setTimeout(resolve, ms));
349
+ }
350
+ }
351
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/legacy/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAErF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAyI5D,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAA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AC;IACH,CAAC;IAEO,kBAAkB,CAAC,GAAY;QACrC,IAAI,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QAC1C,MAAM,IAAI,GAAI,GAA6B,CAAC,IAAI,CAAC;QACjD,IAAI,IAAI,IAAI,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QAC1D,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;YAAE,OAAO,IAAI,CAAC;QACzF,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,MAAM,CAAC,EAAU;QACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * viva-payments-core/legacy — barrel export.
3
+ *
4
+ * Subpath: `viva-payments-core/legacy`
5
+ *
6
+ * BasicAuthClient covers Viva's legacy host endpoints (Basic auth +
7
+ * MerchantId/ApiKey). Currently the only path that works for refunds —
8
+ * Viva returns 405 on the v2/OAuth2 refund route.
9
+ *
10
+ * @see references/viva-docs/md/tut-create-recurring-payment.txt:288
11
+ * @see references/viva-docs/md/merchant-id-and-api-key.txt:1
12
+ */
13
+ export { BasicAuthClient } from './client.js';
14
+ export type { BasicAuthClientConfig, BasicAuthVariant, MerchantBasicAuthClientConfig, ResellerBasicAuthClientConfig, LegacyApiResult, LegacyRequestOptions, } from './client.js';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/legacy/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EACV,qBAAqB,EACrB,gBAAgB,EAChB,6BAA6B,EAC7B,6BAA6B,EAC7B,eAAe,EACf,oBAAoB,GACrB,MAAM,aAAa,CAAC"}