@voyant-travel/plugin-netopia 0.104.22 → 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
@@ -28,20 +28,20 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
28
28
  } | null;
29
29
  idempotencyKey: string | null;
30
30
  status: "failed" | "pending" | "cancelled" | "expired" | "processing" | "paid" | "requires_redirect" | "authorized";
31
- currency: string;
32
31
  id: string;
33
32
  createdAt: string;
34
33
  updatedAt: string;
35
34
  expiresAt: string | null;
35
+ currency: string;
36
36
  notes: string | null;
37
+ provider: string | null;
38
+ completedAt: string | null;
37
39
  bookingId: string | null;
38
40
  expiredAt: string | null;
39
41
  cancelledAt: string | null;
40
- completedAt: string | null;
41
42
  orderId: 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;
@@ -220,20 +220,20 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
220
220
  } | null;
221
221
  idempotencyKey: string | null;
222
222
  status: "failed" | "pending" | "cancelled" | "expired" | "processing" | "paid" | "requires_redirect" | "authorized";
223
- currency: string;
224
223
  id: string;
225
224
  createdAt: string;
226
225
  updatedAt: string;
227
226
  expiresAt: string | null;
227
+ currency: string;
228
228
  notes: string | null;
229
+ provider: string | null;
230
+ completedAt: string | null;
229
231
  bookingId: string | null;
230
232
  expiredAt: string | null;
231
233
  cancelledAt: string | null;
232
- completedAt: string | null;
233
234
  orderId: 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;
@@ -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;
@@ -381,20 +381,20 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
381
381
  } | null;
382
382
  idempotencyKey: string | null;
383
383
  status: "failed" | "pending" | "cancelled" | "expired" | "processing" | "paid" | "requires_redirect" | "authorized";
384
- currency: string;
385
384
  id: string;
386
385
  createdAt: string;
387
386
  updatedAt: string;
388
387
  expiresAt: string | null;
388
+ currency: string;
389
389
  notes: string | null;
390
+ provider: string | null;
391
+ completedAt: string | null;
390
392
  bookingId: string | null;
391
393
  expiredAt: string | null;
392
394
  cancelledAt: string | null;
393
- completedAt: string | null;
394
395
  orderId: 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;
@@ -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;
@@ -540,20 +540,20 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
540
540
  } | null;
541
541
  idempotencyKey: string | null;
542
542
  status: "failed" | "pending" | "cancelled" | "expired" | "processing" | "paid" | "requires_redirect" | "authorized";
543
- currency: string;
544
543
  id: string;
545
544
  createdAt: string;
546
545
  updatedAt: string;
547
546
  expiresAt: string | null;
547
+ currency: string;
548
548
  notes: string | null;
549
+ provider: string | null;
550
+ completedAt: string | null;
549
551
  bookingId: string | null;
550
552
  expiredAt: string | null;
551
553
  cancelledAt: string | null;
552
- completedAt: string | null;
553
554
  orderId: 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;
@@ -645,20 +645,20 @@ export declare function createNetopiaFinanceRoutes(options?: NetopiaRuntimeOptio
645
645
  } | null;
646
646
  idempotencyKey: string | null;
647
647
  status: "failed" | "pending" | "cancelled" | "expired" | "processing" | "paid" | "requires_redirect" | "authorized";
648
- currency: string;
649
648
  id: string;
650
649
  createdAt: string;
651
650
  updatedAt: string;
652
651
  expiresAt: string | null;
652
+ currency: string;
653
653
  notes: string | null;
654
+ provider: string | null;
655
+ completedAt: string | null;
654
656
  bookingId: string | null;
655
657
  expiredAt: string | null;
656
658
  cancelledAt: string | null;
657
- completedAt: string | null;
658
659
  orderId: 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.22",
3
+ "version": "0.105.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -40,10 +40,10 @@
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.121.0",
43
+ "@voyant-travel/finance": "^0.122.0",
44
44
  "@voyant-travel/hono": "^0.111.0",
45
- "@voyant-travel/utils": "^0.105.2",
46
- "@voyant-travel/notifications": "^0.111.10"
45
+ "@voyant-travel/notifications": "^0.111.11",
46
+ "@voyant-travel/utils": "^0.105.2"
47
47
  },
48
48
  "devDependencies": {
49
49
  "typescript": "^6.0.2",