@voyant-travel/finance 0.184.0 → 0.186.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/card-payment.d.ts +7 -0
- package/dist/card-payment.js +2 -0
- package/package.json +2 -2
package/dist/card-payment.d.ts
CHANGED
|
@@ -60,5 +60,12 @@ export interface PaymentAdapterCardPaymentStarterOptions {
|
|
|
60
60
|
resolveContext?(c: Context): PaymentAdapterRuntimeContext;
|
|
61
61
|
resolveRuntime?(c: Context): FinanceServiceRuntime;
|
|
62
62
|
idempotencyKey?(sessionId: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* Resolve the public URL a redirect processor should POST its callback/IPN to
|
|
65
|
+
* (the deployment's payment webhook). Passed to the adapter as
|
|
66
|
+
* `metadata.notifyUrl` so the processor confirms server-side; absent when the
|
|
67
|
+
* deployment has no public checkout base (confirmation falls back to polling).
|
|
68
|
+
*/
|
|
69
|
+
resolveNotifyUrl?(c: Context): string | undefined;
|
|
63
70
|
}
|
|
64
71
|
export declare function createPaymentAdapterCardPaymentStarter(adapter: PaymentAdapter, options?: PaymentAdapterCardPaymentStarterOptions): CardPaymentStarter;
|
package/dist/card-payment.js
CHANGED
|
@@ -12,6 +12,7 @@ export function createPaymentAdapterCardPaymentStarter(adapter, options = {}) {
|
|
|
12
12
|
if (!session)
|
|
13
13
|
return null;
|
|
14
14
|
const idempotencyKey = session.idempotencyKey ?? options.idempotencyKey?.(session.id) ?? `payment:${session.id}`;
|
|
15
|
+
const notifyUrl = options.resolveNotifyUrl?.(c);
|
|
15
16
|
const result = await adapter.initiate(options.resolveContext?.(c) ?? { env: c.env }, {
|
|
16
17
|
paymentSessionId: session.id,
|
|
17
18
|
money: { amountMinor: session.amountCents, currency: session.currency },
|
|
@@ -24,6 +25,7 @@ export function createPaymentAdapterCardPaymentStarter(adapter, options = {}) {
|
|
|
24
25
|
firstName: args.billing.firstName,
|
|
25
26
|
lastName: args.billing.lastName ?? null,
|
|
26
27
|
},
|
|
28
|
+
...(notifyUrl ? { metadata: { notifyUrl } } : {}),
|
|
27
29
|
});
|
|
28
30
|
const providerData = {
|
|
29
31
|
providerSessionId: result.processorSessionId ?? undefined,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/finance",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.186.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
"hono": "^4.12.27",
|
|
158
158
|
"zod": "^4.4.3",
|
|
159
159
|
"@voyant-travel/action-ledger": "^0.111.10",
|
|
160
|
-
"@voyant-travel/bookings": "^0.
|
|
160
|
+
"@voyant-travel/bookings": "^0.186.0",
|
|
161
161
|
"@voyant-travel/core": "^0.130.0",
|
|
162
162
|
"@voyant-travel/db": "^0.117.1",
|
|
163
163
|
"@voyant-travel/types": "^0.109.8",
|