@voyant-travel/plugin-netopia 0.104.21 → 0.105.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.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Netopia implementation of the finance {@link CardPaymentStarter} contract.
3
+ *
4
+ * This is the one place that couples Netopia to a checkout surface: it resolves
5
+ * the request-scoped Netopia runtime from the container, starts a hosted
6
+ * payment via {@link startPaymentSession}, and returns the neutral
7
+ * `redirectUrl` finance's contract expects. When the runtime isn't configured
8
+ * it returns `null` so callers fall back (bank transfer still works).
9
+ */
10
+ import type { CardPaymentStarter } from "@voyant-travel/finance/card-payment";
11
+ /**
12
+ * Build the Netopia card-payment starter. Select it as a deployment's
13
+ * `CardPaymentStarter` to route every checkout surface's card payments through
14
+ * Netopia.
15
+ */
16
+ export declare function netopiaCardPaymentStarter(): CardPaymentStarter;
17
+ //# sourceMappingURL=card-payment-starter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-payment-starter.d.ts","sourceRoot":"","sources":["../src/card-payment-starter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AAM7E;;;;GAIG;AACH,wBAAgB,yBAAyB,IAAI,kBAAkB,CAuB9D"}
@@ -0,0 +1,23 @@
1
+ import { NETOPIA_RUNTIME_CONTAINER_KEY } from "./plugin.js";
2
+ import { startPaymentSession } from "./service-start.js";
3
+ /**
4
+ * Build the Netopia card-payment starter. Select it as a deployment's
5
+ * `CardPaymentStarter` to route every checkout surface's card payments through
6
+ * Netopia.
7
+ */
8
+ export function netopiaCardPaymentStarter() {
9
+ return async (c, args) => {
10
+ const runtime = c.var.container?.resolve(NETOPIA_RUNTIME_CONTAINER_KEY);
11
+ if (!runtime)
12
+ return null;
13
+ const started = await startPaymentSession(args.db, args.sessionId, {
14
+ // The neutral CardPaymentBilling is structurally compatible with
15
+ // Netopia's billing (same field names); callers always supply the full
16
+ // Netopia-shaped object, so the cast is safe.
17
+ billing: args.billing,
18
+ description: args.description,
19
+ returnUrl: args.returnUrl,
20
+ }, runtime);
21
+ return { redirectUrl: started.session.redirectUrl ?? null };
22
+ };
23
+ }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { netopiaCardPaymentStarter } from "./card-payment-starter.js";
1
2
  export { createNetopiaCheckoutStarter } from "./checkout.js";
2
3
  export { createNetopiaClient, NETOPIA_API_BASES, type NetopiaClientApi, type NetopiaClientOptions, resolveNetopiaRuntimeOptions, } from "./client.js";
3
4
  export type { NetopiaNotificationRuntime, NetopiaNotificationRuntimeOptions, } from "./notification-runtime.js";
@@ -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,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,4BAA4B,GAC7B,MAAM,aAAa,CAAA;AACpB,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,EACx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ClB,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,3 +1,4 @@
1
+ export { netopiaCardPaymentStarter } from "./card-payment-starter.js";
1
2
  export { createNetopiaCheckoutStarter } from "./checkout.js";
2
3
  export { createNetopiaClient, NETOPIA_API_BASES, resolveNetopiaRuntimeOptions, } from "./client.js";
3
4
  export { buildNetopiaNotificationRuntime } from "./notification-runtime.js";
package/dist/plugin.d.ts CHANGED
@@ -26,22 +26,22 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
26
26
  metadata: {
27
27
  [x: string]: import("hono/utils/types").JSONValue;
28
28
  } | null;
29
+ idempotencyKey: string | null;
29
30
  status: "failed" | "pending" | "cancelled" | "expired" | "processing" | "paid" | "requires_redirect" | "authorized";
30
- currency: string;
31
31
  id: string;
32
32
  createdAt: string;
33
33
  updatedAt: string;
34
34
  expiresAt: string | null;
35
+ currency: string;
35
36
  notes: string | null;
37
+ provider: string | null;
38
+ completedAt: string | null;
36
39
  bookingId: string | null;
37
40
  expiredAt: string | null;
38
41
  cancelledAt: string | null;
39
- completedAt: string | null;
40
42
  orderId: string | null;
41
- idempotencyKey: string | null;
42
43
  targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
43
44
  targetId: string | null;
44
- provider: string | null;
45
45
  amountCents: number;
46
46
  bookingPaymentScheduleId: string | null;
47
47
  paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
@@ -157,13 +157,13 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
157
157
  createdAt: string;
158
158
  updatedAt: string;
159
159
  organizationId: string | null;
160
+ provider: string;
161
+ scheduledFor: string | null;
162
+ errorMessage: string | null;
160
163
  bookingId: string | null;
161
164
  personId: string | null;
162
165
  targetType: "organization" | "other" | "booking" | "person" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "payment_session";
163
166
  targetId: string | null;
164
- provider: string;
165
- scheduledFor: string | null;
166
- errorMessage: string | null;
167
167
  paymentSessionId: string | null;
168
168
  channel: "email" | "sms";
169
169
  templateId: string | null;
@@ -190,13 +190,13 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
190
190
  createdAt: string;
191
191
  updatedAt: string;
192
192
  organizationId: string | null;
193
+ provider: string;
194
+ scheduledFor: string | null;
195
+ errorMessage: string | null;
193
196
  bookingId: string | null;
194
197
  personId: string | null;
195
198
  targetType: "organization" | "other" | "booking" | "person" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "payment_session";
196
199
  targetId: string | null;
197
- provider: string;
198
- scheduledFor: string | null;
199
- errorMessage: string | null;
200
200
  paymentSessionId: string | null;
201
201
  channel: "email" | "sms";
202
202
  templateId: string | null;
@@ -218,22 +218,22 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
218
218
  metadata: {
219
219
  [x: string]: import("hono/utils/types").JSONValue;
220
220
  } | null;
221
+ idempotencyKey: string | null;
221
222
  status: "failed" | "pending" | "cancelled" | "expired" | "processing" | "paid" | "requires_redirect" | "authorized";
222
- currency: string;
223
223
  id: string;
224
224
  createdAt: string;
225
225
  updatedAt: string;
226
226
  expiresAt: string | null;
227
+ currency: string;
227
228
  notes: string | null;
229
+ provider: string | null;
230
+ completedAt: string | null;
228
231
  bookingId: string | null;
229
232
  expiredAt: string | null;
230
233
  cancelledAt: string | null;
231
- completedAt: string | null;
232
234
  orderId: string | null;
233
- idempotencyKey: string | null;
234
235
  targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
235
236
  targetId: string | null;
236
- provider: string | null;
237
237
  amountCents: number;
238
238
  bookingPaymentScheduleId: string | null;
239
239
  paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
@@ -294,7 +294,7 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
294
294
  error: string;
295
295
  };
296
296
  outputFormat: "json";
297
- status: 500 | 404 | 409 | 502;
297
+ status: 404 | 409 | 500 | 502;
298
298
  };
299
299
  };
300
300
  } & {
@@ -318,13 +318,13 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
318
318
  createdAt: string;
319
319
  updatedAt: string;
320
320
  organizationId: string | null;
321
+ provider: string;
322
+ scheduledFor: string | null;
323
+ errorMessage: string | null;
321
324
  bookingId: string | null;
322
325
  personId: string | null;
323
326
  targetType: "organization" | "other" | "booking" | "person" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "payment_session";
324
327
  targetId: string | null;
325
- provider: string;
326
- scheduledFor: string | null;
327
- errorMessage: string | null;
328
328
  paymentSessionId: string | null;
329
329
  channel: "email" | "sms";
330
330
  templateId: string | null;
@@ -351,13 +351,13 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
351
351
  createdAt: string;
352
352
  updatedAt: string;
353
353
  organizationId: string | null;
354
+ provider: string;
355
+ scheduledFor: string | null;
356
+ errorMessage: string | null;
354
357
  bookingId: string | null;
355
358
  personId: string | null;
356
359
  targetType: "organization" | "other" | "booking" | "person" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "payment_session";
357
360
  targetId: string | null;
358
- provider: string;
359
- scheduledFor: string | null;
360
- errorMessage: string | null;
361
361
  paymentSessionId: string | null;
362
362
  channel: "email" | "sms";
363
363
  templateId: string | null;
@@ -379,22 +379,22 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
379
379
  metadata: {
380
380
  [x: string]: import("hono/utils/types").JSONValue;
381
381
  } | null;
382
+ idempotencyKey: string | null;
382
383
  status: "failed" | "pending" | "cancelled" | "expired" | "processing" | "paid" | "requires_redirect" | "authorized";
383
- currency: string;
384
384
  id: string;
385
385
  createdAt: string;
386
386
  updatedAt: string;
387
387
  expiresAt: string | null;
388
+ currency: string;
388
389
  notes: string | null;
390
+ provider: string | null;
391
+ completedAt: string | null;
389
392
  bookingId: string | null;
390
393
  expiredAt: string | null;
391
394
  cancelledAt: string | null;
392
- completedAt: string | null;
393
395
  orderId: string | null;
394
- idempotencyKey: string | null;
395
396
  targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
396
397
  targetId: string | null;
397
- provider: string | null;
398
398
  amountCents: number;
399
399
  bookingPaymentScheduleId: string | null;
400
400
  paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
@@ -455,7 +455,7 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
455
455
  error: string;
456
456
  };
457
457
  outputFormat: "json";
458
- status: 500 | 404 | 409 | 502;
458
+ status: 404 | 409 | 500 | 502;
459
459
  };
460
460
  };
461
461
  } & {
@@ -477,13 +477,13 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
477
477
  createdAt: string;
478
478
  updatedAt: string;
479
479
  organizationId: string | null;
480
+ provider: string;
481
+ scheduledFor: string | null;
482
+ errorMessage: string | null;
480
483
  bookingId: string | null;
481
484
  personId: string | null;
482
485
  targetType: "organization" | "other" | "booking" | "person" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "payment_session";
483
486
  targetId: string | null;
484
- provider: string;
485
- scheduledFor: string | null;
486
- errorMessage: string | null;
487
487
  paymentSessionId: string | null;
488
488
  channel: "email" | "sms";
489
489
  templateId: string | null;
@@ -510,13 +510,13 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
510
510
  createdAt: string;
511
511
  updatedAt: string;
512
512
  organizationId: string | null;
513
+ provider: string;
514
+ scheduledFor: string | null;
515
+ errorMessage: string | null;
513
516
  bookingId: string | null;
514
517
  personId: string | null;
515
518
  targetType: "organization" | "other" | "booking" | "person" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "payment_session";
516
519
  targetId: string | null;
517
- provider: string;
518
- scheduledFor: string | null;
519
- errorMessage: string | null;
520
520
  paymentSessionId: string | null;
521
521
  channel: "email" | "sms";
522
522
  templateId: string | null;
@@ -538,22 +538,22 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
538
538
  metadata: {
539
539
  [x: string]: import("hono/utils/types").JSONValue;
540
540
  } | null;
541
+ idempotencyKey: string | null;
541
542
  status: "failed" | "pending" | "cancelled" | "expired" | "processing" | "paid" | "requires_redirect" | "authorized";
542
- currency: string;
543
543
  id: string;
544
544
  createdAt: string;
545
545
  updatedAt: string;
546
546
  expiresAt: string | null;
547
+ currency: string;
547
548
  notes: string | null;
549
+ provider: string | null;
550
+ completedAt: string | null;
548
551
  bookingId: string | null;
549
552
  expiredAt: string | null;
550
553
  cancelledAt: string | null;
551
- completedAt: string | null;
552
554
  orderId: string | null;
553
- idempotencyKey: string | null;
554
555
  targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
555
556
  targetId: string | null;
556
- provider: string | null;
557
557
  amountCents: number;
558
558
  bookingPaymentScheduleId: string | null;
559
559
  paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
@@ -612,7 +612,7 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
612
612
  error: string;
613
613
  };
614
614
  outputFormat: "json";
615
- status: 500 | 404 | 409 | 502;
615
+ status: 404 | 409 | 500 | 502;
616
616
  };
617
617
  };
618
618
  } & {
@@ -643,22 +643,22 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
643
643
  metadata: {
644
644
  [x: string]: import("hono/utils/types").JSONValue;
645
645
  } | null;
646
+ idempotencyKey: string | null;
646
647
  status: "failed" | "pending" | "cancelled" | "expired" | "processing" | "paid" | "requires_redirect" | "authorized";
647
- currency: string;
648
648
  id: string;
649
649
  createdAt: string;
650
650
  updatedAt: string;
651
651
  expiresAt: string | null;
652
+ currency: string;
652
653
  notes: string | null;
654
+ provider: string | null;
655
+ completedAt: string | null;
653
656
  bookingId: string | null;
654
657
  expiredAt: string | null;
655
658
  cancelledAt: string | null;
656
- completedAt: string | null;
657
659
  orderId: string | null;
658
- idempotencyKey: string | null;
659
660
  targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
660
661
  targetId: string | null;
661
- provider: string | null;
662
662
  amountCents: number;
663
663
  bookingPaymentScheduleId: string | null;
664
664
  paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyant-travel/plugin-netopia",
3
- "version": "0.104.21",
3
+ "version": "0.105.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -40,9 +40,9 @@
40
40
  "hono": "^4.12.10",
41
41
  "zod": "^4.3.6",
42
42
  "@voyant-travel/core": "^0.109.0",
43
- "@voyant-travel/finance": "^0.120.1",
44
- "@voyant-travel/hono": "^0.110.2",
45
- "@voyant-travel/notifications": "^0.111.9",
43
+ "@voyant-travel/finance": "^0.122.0",
44
+ "@voyant-travel/hono": "^0.111.0",
45
+ "@voyant-travel/notifications": "^0.111.11",
46
46
  "@voyant-travel/utils": "^0.105.2"
47
47
  },
48
48
  "devDependencies": {