@voyantjs/plugin-netopia 0.19.0 → 0.21.0

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/client.d.ts CHANGED
@@ -1,4 +1,16 @@
1
- import type { NetopiaFetch, NetopiaRuntimeOptions, NetopiaStartPaymentRequest, NetopiaStartPaymentResponse, ResolvedNetopiaRuntimeOptions } from "./types.js";
1
+ import type { NetopiaFetch, NetopiaMode, NetopiaRuntimeOptions, NetopiaStartPaymentRequest, NetopiaStartPaymentResponse, ResolvedNetopiaRuntimeOptions } from "./types.js";
2
+ /**
3
+ * Known Netopia API base URLs. The client appends `/payment/card/start`
4
+ * (and any future paths) to whichever value is selected via `mode`. To
5
+ * point at a staging proxy or test mock — or if your tenant is provisioned
6
+ * on a non-default host — set `NETOPIA_URL` (or pass `apiUrl`) to override.
7
+ *
8
+ * The two hosts use *different* path conventions:
9
+ * - live host has a `/pay` prefix on every endpoint
10
+ * - sandbox host serves endpoints from the root
11
+ * Sourced from the protravel-v3 reference implementation.
12
+ */
13
+ export declare const NETOPIA_API_BASES: Record<NetopiaMode, string>;
2
14
  export interface NetopiaClientApi {
3
15
  startCardPayment(request: NetopiaStartPaymentRequest): Promise<NetopiaStartPaymentResponse>;
4
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACrB,0BAA0B,EAC1B,2BAA2B,EAC3B,6BAA6B,EAC9B,MAAM,YAAY,CAAA;AAGnB,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAA;CAC5F;AAED,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,6BAA6B,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAChE,KAAK,CAAC,EAAE,YAAY,CAAA;CACrB;AAED,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC7C,OAAO,GAAE,qBAA0B,GAClC,6BAA6B,CAuC/B;AAMD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,gBAAgB,CA+CnF"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,qBAAqB,EACrB,0BAA0B,EAC1B,2BAA2B,EAC3B,6BAA6B,EAC9B,MAAM,YAAY,CAAA;AAGnB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAGzD,CAAA;AAED,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAA;CAC5F;AAED,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,6BAA6B,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAChE,KAAK,CAAC,EAAE,YAAY,CAAA;CACrB;AAED,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC7C,OAAO,GAAE,qBAA0B,GAClC,6BAA6B,CAwC/B;AAgBD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,gBAAgB,CA2DnF"}
package/dist/client.js CHANGED
@@ -1,14 +1,29 @@
1
1
  import { ZodError } from "zod";
2
2
  import { resolvedNetopiaRuntimeOptionsSchema } from "./validation.js";
3
+ /**
4
+ * Known Netopia API base URLs. The client appends `/payment/card/start`
5
+ * (and any future paths) to whichever value is selected via `mode`. To
6
+ * point at a staging proxy or test mock — or if your tenant is provisioned
7
+ * on a non-default host — set `NETOPIA_URL` (or pass `apiUrl`) to override.
8
+ *
9
+ * The two hosts use *different* path conventions:
10
+ * - live host has a `/pay` prefix on every endpoint
11
+ * - sandbox host serves endpoints from the root
12
+ * Sourced from the protravel-v3 reference implementation.
13
+ */
14
+ export const NETOPIA_API_BASES = {
15
+ live: "https://secure.mobilpay.ro/pay",
16
+ sandbox: "https://secure.sandbox.netopia-payments.com",
17
+ };
3
18
  export function resolveNetopiaRuntimeOptions(bindings, options = {}) {
4
19
  const env = bindings ?? {};
5
- const apiUrl = options.apiUrl ?? coerceString(env.NETOPIA_URL);
20
+ const apiUrlOverride = options.apiUrl ?? coerceString(env.NETOPIA_URL);
21
+ const mode = resolveMode(options.mode ?? coerceString(env.NETOPIA_MODE));
22
+ const apiUrl = apiUrlOverride ?? NETOPIA_API_BASES[mode];
6
23
  const apiKey = options.apiKey ?? coerceString(env.NETOPIA_API_KEY);
7
24
  const posSignature = options.posSignature ?? coerceString(env.NETOPIA_POS_SIGNATURE);
8
25
  const notifyUrl = options.notifyUrl ?? coerceString(env.NETOPIA_NOTIFY_URL);
9
26
  const redirectUrl = options.redirectUrl ?? coerceString(env.NETOPIA_REDIRECT_URL);
10
- if (!apiUrl)
11
- throw new Error("Missing Netopia config: NETOPIA_URL");
12
27
  if (!apiKey)
13
28
  throw new Error("Missing Netopia config: NETOPIA_API_KEY");
14
29
  if (!posSignature)
@@ -47,6 +62,16 @@ export function resolveNetopiaRuntimeOptions(bindings, options = {}) {
47
62
  function coerceString(value) {
48
63
  return typeof value === "string" && value.length > 0 ? value : undefined;
49
64
  }
65
+ function resolveMode(raw) {
66
+ if (raw === "live" || raw === "sandbox")
67
+ return raw;
68
+ if (raw !== undefined) {
69
+ throw new Error(`Invalid NETOPIA_MODE: ${raw} (expected "sandbox" or "live")`);
70
+ }
71
+ // Default to sandbox so a half-configured production deploy fails into
72
+ // the safer environment instead of charging real cards.
73
+ return "sandbox";
74
+ }
50
75
  export function createNetopiaClient(options) {
51
76
  const apiUrl = options.apiUrl.replace(/\/$/, "");
52
77
  const fetchImpl = options.fetch ?? globalThis.fetch;
@@ -78,10 +103,27 @@ export function createNetopiaClient(options) {
78
103
  async startCardPayment(requestBody) {
79
104
  const res = await request("POST", "/payment/card/start", requestBody);
80
105
  const json = (res.json ?? {});
106
+ // Netopia quirk (per protravel-v3 reference): error code 101 means
107
+ // "redirect customer to payment page" — it's success-with-redirect,
108
+ // not a failure. The API sometimes omits `paymentURL` in this case;
109
+ // upstream callers fall back to other fields on the session.
110
+ if (json.error && String(json.error.code) === "101") {
111
+ return json;
112
+ }
81
113
  if (!res.ok || json.error) {
82
- throw new Error(`Netopia start payment failed (${json.error?.code ?? res.status}): ${json.error?.message ?? res.text}`);
114
+ const detail = json.error?.message ??
115
+ (res.status === 404
116
+ ? `Endpoint not found at ${apiUrl}/payment/card/start. Verify NETOPIA_MODE/NETOPIA_URL.`
117
+ : stripHtml(res.text).slice(0, 200));
118
+ throw new Error(`Netopia start payment failed (${json.error?.code ?? res.status}): ${detail}`);
83
119
  }
84
120
  return json;
85
121
  },
86
122
  };
87
123
  }
124
+ function stripHtml(text) {
125
+ return text
126
+ .replace(/<[^>]+>/g, "")
127
+ .replace(/\s+/g, " ")
128
+ .trim();
129
+ }
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  export { createNetopiaCheckoutStarter } from "./checkout.js";
2
- export { createNetopiaClient, type NetopiaClientApi, type NetopiaClientOptions, resolveNetopiaRuntimeOptions, } from "./client.js";
2
+ export { createNetopiaClient, NETOPIA_API_BASES, type NetopiaClientApi, type NetopiaClientOptions, resolveNetopiaRuntimeOptions, } from "./client.js";
3
3
  export type { NetopiaNotificationRuntime, NetopiaNotificationRuntimeOptions, } from "./notification-runtime.js";
4
4
  export { buildNetopiaNotificationRuntime } from "./notification-runtime.js";
5
- export { createNetopiaFinanceExtension, createNetopiaFinanceExtension as createNetopiaFinanceAdapter, createNetopiaFinanceRoutes, NETOPIA_RUNTIME_CONTAINER_KEY, netopiaFinanceExtension, netopiaHonoPlugin as createNetopiaAdapterBundle, netopiaHonoPlugin, } from "./plugin.js";
5
+ export { createNetopiaFinanceExtension, createNetopiaFinanceExtension as createNetopiaFinanceAdapter, createNetopiaFinanceRoutes, NETOPIA_RUNTIME_CONTAINER_KEY, netopiaFinanceExtension, netopiaHonoBundle, netopiaHonoPlugin as createNetopiaAdapterBundle, netopiaHonoPlugin, } from "./plugin.js";
6
6
  export { deriveNetopiaOrderId, mapNetopiaPaymentStatus, type NetopiaCallbackResult, type NetopiaCollectPaymentResult, type NetopiaStartPaymentResult, netopiaService, } from "./service.js";
7
- export type { NetopiaBillingAddress, NetopiaBrowserData, NetopiaFetch, NetopiaInstallments, NetopiaPaymentInstrument, NetopiaPaymentOptions, NetopiaProductLine, NetopiaRuntimeOptions, NetopiaStartPaymentInput, NetopiaStartPaymentRequest, NetopiaStartPaymentResponse, NetopiaWebhookPayload, ResolvedNetopiaRuntimeOptions, } from "./types.js";
7
+ export type { NetopiaBillingAddress, NetopiaBrowserData, NetopiaFetch, NetopiaInstallments, NetopiaMode, NetopiaPaymentInstrument, NetopiaPaymentOptions, NetopiaProductLine, NetopiaRuntimeOptions, NetopiaStartPaymentInput, NetopiaStartPaymentRequest, NetopiaStartPaymentResponse, NetopiaWebhookPayload, ResolvedNetopiaRuntimeOptions, } from "./types.js";
8
8
  export { netopiaBillingAddressSchema, netopiaBrowserDataSchema, netopiaCollectBookingGuaranteeSchema, netopiaCollectBookingScheduleSchema, netopiaCollectInvoiceSchema, netopiaInstallmentsSchema, netopiaPaymentInstrumentSchema, netopiaPaymentOptionsSchema, netopiaProductLineSchema, netopiaRuntimeOptionsSchema, netopiaStartPaymentSessionSchema, netopiaWebhookPayloadSchema, resolvedNetopiaRuntimeOptionsSchema, } from "./validation.js";
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAA;AAC5D,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YAAY,EACV,0BAA0B,EAC1B,iCAAiC,GAClC,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAA;AAC3E,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,IAAI,2BAA2B,EAC5D,0BAA0B,EAC1B,6BAA6B,EAC7B,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,IAAI,0BAA0B,EAC/C,iBAAiB,GAClB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,cAAc,GACf,MAAM,cAAc,CAAA;AACrB,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,EACrB,6BAA6B,GAC9B,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,oCAAoC,EACpC,mCAAmC,EACnC,2BAA2B,EAC3B,yBAAyB,EACzB,8BAA8B,EAC9B,2BAA2B,EAC3B,wBAAwB,EACxB,2BAA2B,EAC3B,gCAAgC,EAChC,2BAA2B,EAC3B,mCAAmC,GACpC,MAAM,iBAAiB,CAAA"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { createNetopiaCheckoutStarter } from "./checkout.js";
2
- export { createNetopiaClient, resolveNetopiaRuntimeOptions, } from "./client.js";
2
+ export { createNetopiaClient, NETOPIA_API_BASES, resolveNetopiaRuntimeOptions, } from "./client.js";
3
3
  export { buildNetopiaNotificationRuntime } from "./notification-runtime.js";
4
- export { createNetopiaFinanceExtension, createNetopiaFinanceExtension as createNetopiaFinanceAdapter, createNetopiaFinanceRoutes, NETOPIA_RUNTIME_CONTAINER_KEY, netopiaFinanceExtension, netopiaHonoPlugin as createNetopiaAdapterBundle, netopiaHonoPlugin, } from "./plugin.js";
4
+ export { createNetopiaFinanceExtension, createNetopiaFinanceExtension as createNetopiaFinanceAdapter, createNetopiaFinanceRoutes, NETOPIA_RUNTIME_CONTAINER_KEY, netopiaFinanceExtension, netopiaHonoBundle, netopiaHonoPlugin as createNetopiaAdapterBundle, netopiaHonoPlugin, } from "./plugin.js";
5
5
  export { deriveNetopiaOrderId, mapNetopiaPaymentStatus, netopiaService, } from "./service.js";
6
6
  export { netopiaBillingAddressSchema, netopiaBrowserDataSchema, netopiaCollectBookingGuaranteeSchema, netopiaCollectBookingScheduleSchema, netopiaCollectInvoiceSchema, netopiaInstallmentsSchema, netopiaPaymentInstrumentSchema, netopiaPaymentOptionsSchema, netopiaProductLineSchema, netopiaRuntimeOptionsSchema, netopiaStartPaymentSessionSchema, netopiaWebhookPayloadSchema, resolvedNetopiaRuntimeOptionsSchema, } from "./validation.js";
package/dist/plugin.d.ts CHANGED
@@ -30,7 +30,7 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
30
30
  createdAt: string;
31
31
  updatedAt: string;
32
32
  expiresAt: string | null;
33
- status: "pending" | "expired" | "cancelled" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
33
+ status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
34
34
  currency: string;
35
35
  notes: string | null;
36
36
  idempotencyKey: string | null;
@@ -41,7 +41,7 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
41
41
  completedAt: string | null;
42
42
  paymentId: string | null;
43
43
  amountCents: number;
44
- targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
44
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
45
45
  targetId: string | null;
46
46
  orderId: string | null;
47
47
  invoiceId: string | null;
@@ -156,8 +156,10 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
156
156
  createdAt: string;
157
157
  updatedAt: string;
158
158
  organizationId: string | null;
159
- status: "pending" | "cancelled" | "failed" | "sent";
159
+ status: "pending" | "failed" | "cancelled" | "sent";
160
160
  provider: string;
161
+ scheduledFor: string | null;
162
+ errorMessage: string | null;
161
163
  bookingId: string | null;
162
164
  personId: string | null;
163
165
  channel: "email" | "sms";
@@ -166,7 +168,6 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
166
168
  templateId: string | null;
167
169
  invoiceId: string | null;
168
170
  failedAt: string | null;
169
- errorMessage: string | null;
170
171
  subject: string | null;
171
172
  sentAt: string | null;
172
173
  fromAddress: string | null;
@@ -179,7 +180,6 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
179
180
  payloadData: {
180
181
  [x: string]: import("hono/utils/types").JSONValue;
181
182
  } | null;
182
- scheduledFor: string | null;
183
183
  } | null;
184
184
  invoiceNotification: {
185
185
  metadata: {
@@ -189,8 +189,10 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
189
189
  createdAt: string;
190
190
  updatedAt: string;
191
191
  organizationId: string | null;
192
- status: "pending" | "cancelled" | "failed" | "sent";
192
+ status: "pending" | "failed" | "cancelled" | "sent";
193
193
  provider: string;
194
+ scheduledFor: string | null;
195
+ errorMessage: string | null;
194
196
  bookingId: string | null;
195
197
  personId: string | null;
196
198
  channel: "email" | "sms";
@@ -199,7 +201,6 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
199
201
  templateId: string | null;
200
202
  invoiceId: string | null;
201
203
  failedAt: string | null;
202
- errorMessage: string | null;
203
204
  subject: string | null;
204
205
  sentAt: string | null;
205
206
  fromAddress: string | null;
@@ -212,7 +213,6 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
212
213
  payloadData: {
213
214
  [x: string]: import("hono/utils/types").JSONValue;
214
215
  } | null;
215
- scheduledFor: string | null;
216
216
  } | null;
217
217
  session: {
218
218
  metadata: {
@@ -222,7 +222,7 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
222
222
  createdAt: string;
223
223
  updatedAt: string;
224
224
  expiresAt: string | null;
225
- status: "pending" | "expired" | "cancelled" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
225
+ status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
226
226
  currency: string;
227
227
  notes: string | null;
228
228
  idempotencyKey: string | null;
@@ -233,7 +233,7 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
233
233
  completedAt: string | null;
234
234
  paymentId: string | null;
235
235
  amountCents: number;
236
- targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
236
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
237
237
  targetId: string | null;
238
238
  orderId: string | null;
239
239
  invoiceId: string | null;
@@ -317,8 +317,10 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
317
317
  createdAt: string;
318
318
  updatedAt: string;
319
319
  organizationId: string | null;
320
- status: "pending" | "cancelled" | "failed" | "sent";
320
+ status: "pending" | "failed" | "cancelled" | "sent";
321
321
  provider: string;
322
+ scheduledFor: string | null;
323
+ errorMessage: string | null;
322
324
  bookingId: string | null;
323
325
  personId: string | null;
324
326
  channel: "email" | "sms";
@@ -327,7 +329,6 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
327
329
  templateId: string | null;
328
330
  invoiceId: string | null;
329
331
  failedAt: string | null;
330
- errorMessage: string | null;
331
332
  subject: string | null;
332
333
  sentAt: string | null;
333
334
  fromAddress: string | null;
@@ -340,7 +341,6 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
340
341
  payloadData: {
341
342
  [x: string]: import("hono/utils/types").JSONValue;
342
343
  } | null;
343
- scheduledFor: string | null;
344
344
  } | null;
345
345
  invoiceNotification: {
346
346
  metadata: {
@@ -350,8 +350,10 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
350
350
  createdAt: string;
351
351
  updatedAt: string;
352
352
  organizationId: string | null;
353
- status: "pending" | "cancelled" | "failed" | "sent";
353
+ status: "pending" | "failed" | "cancelled" | "sent";
354
354
  provider: string;
355
+ scheduledFor: string | null;
356
+ errorMessage: string | null;
355
357
  bookingId: string | null;
356
358
  personId: string | null;
357
359
  channel: "email" | "sms";
@@ -360,7 +362,6 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
360
362
  templateId: string | null;
361
363
  invoiceId: string | null;
362
364
  failedAt: string | null;
363
- errorMessage: string | null;
364
365
  subject: string | null;
365
366
  sentAt: string | null;
366
367
  fromAddress: string | null;
@@ -373,7 +374,6 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
373
374
  payloadData: {
374
375
  [x: string]: import("hono/utils/types").JSONValue;
375
376
  } | null;
376
- scheduledFor: string | null;
377
377
  } | null;
378
378
  session: {
379
379
  metadata: {
@@ -383,7 +383,7 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
383
383
  createdAt: string;
384
384
  updatedAt: string;
385
385
  expiresAt: string | null;
386
- status: "pending" | "expired" | "cancelled" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
386
+ status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
387
387
  currency: string;
388
388
  notes: string | null;
389
389
  idempotencyKey: string | null;
@@ -394,7 +394,7 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
394
394
  completedAt: string | null;
395
395
  paymentId: string | null;
396
396
  amountCents: number;
397
- targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
397
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
398
398
  targetId: string | null;
399
399
  orderId: string | null;
400
400
  invoiceId: string | null;
@@ -476,8 +476,10 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
476
476
  createdAt: string;
477
477
  updatedAt: string;
478
478
  organizationId: string | null;
479
- status: "pending" | "cancelled" | "failed" | "sent";
479
+ status: "pending" | "failed" | "cancelled" | "sent";
480
480
  provider: string;
481
+ scheduledFor: string | null;
482
+ errorMessage: string | null;
481
483
  bookingId: string | null;
482
484
  personId: string | null;
483
485
  channel: "email" | "sms";
@@ -486,7 +488,6 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
486
488
  templateId: string | null;
487
489
  invoiceId: string | null;
488
490
  failedAt: string | null;
489
- errorMessage: string | null;
490
491
  subject: string | null;
491
492
  sentAt: string | null;
492
493
  fromAddress: string | null;
@@ -499,7 +500,6 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
499
500
  payloadData: {
500
501
  [x: string]: import("hono/utils/types").JSONValue;
501
502
  } | null;
502
- scheduledFor: string | null;
503
503
  } | null;
504
504
  invoiceNotification: {
505
505
  metadata: {
@@ -509,8 +509,10 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
509
509
  createdAt: string;
510
510
  updatedAt: string;
511
511
  organizationId: string | null;
512
- status: "pending" | "cancelled" | "failed" | "sent";
512
+ status: "pending" | "failed" | "cancelled" | "sent";
513
513
  provider: string;
514
+ scheduledFor: string | null;
515
+ errorMessage: string | null;
514
516
  bookingId: string | null;
515
517
  personId: string | null;
516
518
  channel: "email" | "sms";
@@ -519,7 +521,6 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
519
521
  templateId: string | null;
520
522
  invoiceId: string | null;
521
523
  failedAt: string | null;
522
- errorMessage: string | null;
523
524
  subject: string | null;
524
525
  sentAt: string | null;
525
526
  fromAddress: string | null;
@@ -532,7 +533,6 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
532
533
  payloadData: {
533
534
  [x: string]: import("hono/utils/types").JSONValue;
534
535
  } | null;
535
- scheduledFor: string | null;
536
536
  } | null;
537
537
  session: {
538
538
  metadata: {
@@ -542,7 +542,7 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
542
542
  createdAt: string;
543
543
  updatedAt: string;
544
544
  expiresAt: string | null;
545
- status: "pending" | "expired" | "cancelled" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
545
+ status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
546
546
  currency: string;
547
547
  notes: string | null;
548
548
  idempotencyKey: string | null;
@@ -553,7 +553,7 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
553
553
  completedAt: string | null;
554
554
  paymentId: string | null;
555
555
  amountCents: number;
556
- targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
556
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
557
557
  targetId: string | null;
558
558
  orderId: string | null;
559
559
  invoiceId: string | null;
@@ -631,7 +631,7 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
631
631
  createdAt: string;
632
632
  updatedAt: string;
633
633
  expiresAt: string | null;
634
- status: "pending" | "expired" | "cancelled" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
634
+ status: "pending" | "failed" | "expired" | "cancelled" | "paid" | "requires_redirect" | "processing" | "authorized";
635
635
  currency: string;
636
636
  notes: string | null;
637
637
  idempotencyKey: string | null;
@@ -642,7 +642,7 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
642
642
  completedAt: string | null;
643
643
  paymentId: string | null;
644
644
  amountCents: number;
645
- targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
645
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
646
646
  targetId: string | null;
647
647
  orderId: string | null;
648
648
  invoiceId: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"service-callback.d.ts","sourceRoot":"","sources":["../src/service-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAGjE,OAAO,EAKL,KAAK,qBAAqB,EAE3B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAE9E,wBAAsB,cAAc,CAClC,EAAE,EAAE,kBAAkB,EACtB,OAAO,EAAE,qBAAqB,EAC9B,cAAc,GAAE,qBAA0B,EAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,cAAc,GAAE;IAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAO,GAC3C,OAAO,CAAC,qBAAqB,CAAC,CAmJhC"}
1
+ {"version":3,"file":"service-callback.d.ts","sourceRoot":"","sources":["../src/service-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAGjE,OAAO,EAIL,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAE9E,wBAAsB,cAAc,CAClC,EAAE,EAAE,kBAAkB,EACtB,OAAO,EAAE,qBAAqB,EAC9B,cAAc,GAAE,qBAA0B,EAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,cAAc,GAAE;IAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAO,GAC3C,OAAO,CAAC,qBAAqB,CAAC,CAqIhC"}
@@ -1,5 +1,5 @@
1
1
  import { resolveNetopiaRuntimeOptions } from "./client.js";
2
- import { amountToCents, financeService, mapNetopiaPaymentStatus, mergeRecord, normalizeCurrency, } from "./service-shared.js";
2
+ import { financeService, mapNetopiaPaymentStatus, mergeRecord, } from "./service-shared.js";
3
3
  export async function handleCallback(db, payload, runtimeOptions = {}, bindings, financeRuntime = {}) {
4
4
  const runtime = resolveNetopiaRuntimeOptions(bindings, runtimeOptions);
5
5
  const orderId = payload.order.orderID;
@@ -25,26 +25,15 @@ export async function handleCallback(db, payload, runtimeOptions = {}, bindings,
25
25
  const providerPayload = mergeRecord(session.providerPayload, {
26
26
  netopiaCallback: payload,
27
27
  });
28
- const normalizedCurrency = normalizeCurrency(payload.payment.currency);
29
- const amountCents = amountToCents(payload.payment.amount);
30
- if (callbackState === "completed" &&
31
- (normalizedCurrency !== normalizeCurrency(session.currency) ||
32
- amountCents !== session.amountCents)) {
33
- const failed = await financeService.failPaymentSession(db, session.id, {
34
- providerSessionId: payload.payment.ntpID,
35
- providerPaymentId: payload.payment.ntpID,
36
- externalReference: orderId,
37
- failureCode: "amount_or_currency_mismatch",
38
- failureMessage: `Expected ${session.amountCents} ${normalizeCurrency(session.currency)}, received ${amountCents} ${normalizedCurrency}`,
39
- providerPayload,
40
- });
41
- return {
42
- action: "failed",
43
- reason: "amount_or_currency_mismatch",
44
- session: failed,
45
- orderId,
46
- };
47
- }
28
+ // Note: we intentionally don't validate `payment.amount` / `payment.currency`
29
+ // against the session. Netopia auto-converts non-RON orders into RON for
30
+ // processing (so an EUR session always callbacks with `currency: "RON"` and
31
+ // a converted amount). Any strict equality check here would reject every
32
+ // legitimate cross-currency payment. The trustworthy field is
33
+ // `payment.status` the orderID is the unguessable secret that ties the
34
+ // callback to the session, and Netopia is the only party that knows it.
35
+ // For tamper detection beyond that, wrap this handler at the route layer
36
+ // and verify the processed amount via your own FX source.
48
37
  if (callbackState === "processing") {
49
38
  const updated = await financeService.updatePaymentSession(db, session.id, {
50
39
  status: "processing",
package/dist/types.d.ts CHANGED
@@ -132,7 +132,16 @@ export interface NetopiaStartPaymentInput {
132
132
  metadata?: Record<string, unknown>;
133
133
  notes?: string | null;
134
134
  }
135
+ export type NetopiaMode = "sandbox" | "live";
135
136
  export interface NetopiaRuntimeOptions {
137
+ /**
138
+ * Selects the Netopia environment. Resolves to a known base URL via
139
+ * `NETOPIA_API_BASES`. Pass `apiUrl` to override (e.g. for tests or a
140
+ * private staging proxy). Defaults to `"sandbox"` when neither `mode`
141
+ * nor `apiUrl` is set, so a misconfigured production deploy fails into
142
+ * the safer mode rather than charging real cards.
143
+ */
144
+ mode?: NetopiaMode;
136
145
  apiUrl?: string;
137
146
  apiKey?: string;
138
147
  posSignature?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAEnE,MAAM,MAAM,YAAY,GAAG,CACzB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE;IACJ,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,KACE,OAAO,CAAC;IACX,EAAE,EAAE,OAAO,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IAC5B,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CAC5B,CAAC,CAAA;AAEF,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO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C,MAAM,WAAW,qBAAqB;IACpC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB,4BAA4B,CAAC,EAAE,CAC7B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC9B,aAAa,CAAC,oBAAoB,CAAC,CAAA;CACzC;AAED,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,KAAK,CAAC,EAAE,YAAY,CAAA;CACrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyantjs/plugin-netopia",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -39,11 +39,11 @@
39
39
  "drizzle-orm": "^0.45.2",
40
40
  "hono": "^4.12.10",
41
41
  "zod": "^4.3.6",
42
- "@voyantjs/checkout": "0.19.0",
43
- "@voyantjs/core": "0.19.0",
44
- "@voyantjs/finance": "0.19.0",
45
- "@voyantjs/hono": "0.19.0",
46
- "@voyantjs/notifications": "0.19.0"
42
+ "@voyantjs/checkout": "0.21.0",
43
+ "@voyantjs/core": "0.21.0",
44
+ "@voyantjs/finance": "0.21.0",
45
+ "@voyantjs/hono": "0.21.0",
46
+ "@voyantjs/notifications": "0.21.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "typescript": "^6.0.2",