@paygentic/sdk 0.6.12 → 0.6.13
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/README.md +12 -3
- package/dist/commonjs/funcs/paymentsCreate.d.ts +19 -0
- package/dist/commonjs/funcs/paymentsCreate.d.ts.map +1 -0
- package/dist/commonjs/funcs/paymentsCreate.js +119 -0
- package/dist/commonjs/funcs/paymentsCreate.js.map +1 -0
- package/dist/commonjs/funcs/paymentsGet.d.ts +19 -0
- package/dist/commonjs/funcs/paymentsGet.d.ts.map +1 -0
- package/dist/commonjs/funcs/paymentsGet.js +124 -0
- package/dist/commonjs/funcs/paymentsGet.js.map +1 -0
- package/dist/commonjs/funcs/paymentsList.d.ts +18 -0
- package/dist/commonjs/funcs/paymentsList.d.ts.map +1 -0
- package/dist/commonjs/funcs/paymentsList.js +125 -0
- package/dist/commonjs/funcs/paymentsList.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/lib/matchers.d.ts.map +1 -1
- package/dist/commonjs/lib/matchers.js +0 -1
- package/dist/commonjs/lib/matchers.js.map +1 -1
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js +1 -2
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +1 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +1 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/operations/createpayment.d.ts +113 -0
- package/dist/commonjs/models/operations/createpayment.d.ts.map +1 -0
- package/dist/commonjs/models/operations/createpayment.js +82 -0
- package/dist/commonjs/models/operations/createpayment.js.map +1 -0
- package/dist/commonjs/models/operations/createpaymentsession.d.ts +113 -0
- package/dist/commonjs/models/operations/createpaymentsession.d.ts.map +1 -0
- package/dist/commonjs/models/operations/createpaymentsession.js +82 -0
- package/dist/commonjs/models/operations/createpaymentsession.js.map +1 -0
- package/dist/commonjs/models/operations/createplan.d.ts +18 -0
- package/dist/commonjs/models/operations/createplan.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createplan.js +11 -1
- package/dist/commonjs/models/operations/createplan.js.map +1 -1
- package/dist/commonjs/models/operations/getpayment.d.ts +15 -0
- package/dist/commonjs/models/operations/getpayment.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getpayment.js +49 -0
- package/dist/commonjs/models/operations/getpayment.js.map +1 -0
- package/dist/commonjs/models/operations/getpaymentsession.d.ts +15 -0
- package/dist/commonjs/models/operations/getpaymentsession.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getpaymentsession.js +49 -0
- package/dist/commonjs/models/operations/getpaymentsession.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +3 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +3 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listpayments.d.ts +75 -0
- package/dist/commonjs/models/operations/listpayments.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listpayments.js +82 -0
- package/dist/commonjs/models/operations/listpayments.js.map +1 -0
- package/dist/commonjs/models/operations/listpaymentsessions.d.ts +75 -0
- package/dist/commonjs/models/operations/listpaymentsessions.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listpaymentsessions.js +82 -0
- package/dist/commonjs/models/operations/listpaymentsessions.js.map +1 -0
- package/dist/commonjs/models/payment.d.ts +91 -0
- package/dist/commonjs/models/payment.d.ts.map +1 -0
- package/dist/commonjs/models/payment.js +90 -0
- package/dist/commonjs/models/payment.js.map +1 -0
- package/dist/commonjs/models/subscription.d.ts +8 -4
- package/dist/commonjs/models/subscription.d.ts.map +1 -1
- package/dist/commonjs/models/subscription.js +7 -6
- package/dist/commonjs/models/subscription.js.map +1 -1
- package/dist/commonjs/sdk/payments.d.ts +27 -0
- package/dist/commonjs/sdk/payments.d.ts.map +1 -0
- package/dist/commonjs/sdk/payments.js +42 -0
- package/dist/commonjs/sdk/payments.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/paymentsCreate.d.ts +19 -0
- package/dist/esm/funcs/paymentsCreate.d.ts.map +1 -0
- package/dist/esm/funcs/paymentsCreate.js +83 -0
- package/dist/esm/funcs/paymentsCreate.js.map +1 -0
- package/dist/esm/funcs/paymentsGet.d.ts +19 -0
- package/dist/esm/funcs/paymentsGet.d.ts.map +1 -0
- package/dist/esm/funcs/paymentsGet.js +88 -0
- package/dist/esm/funcs/paymentsGet.js.map +1 -0
- package/dist/esm/funcs/paymentsList.d.ts +18 -0
- package/dist/esm/funcs/paymentsList.d.ts.map +1 -0
- package/dist/esm/funcs/paymentsList.js +89 -0
- package/dist/esm/funcs/paymentsList.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/lib/matchers.d.ts.map +1 -1
- package/dist/esm/lib/matchers.js +0 -1
- package/dist/esm/lib/matchers.js.map +1 -1
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js +1 -2
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/models/index.d.ts +1 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +1 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/operations/createpayment.d.ts +113 -0
- package/dist/esm/models/operations/createpayment.d.ts.map +1 -0
- package/dist/esm/models/operations/createpayment.js +44 -0
- package/dist/esm/models/operations/createpayment.js.map +1 -0
- package/dist/esm/models/operations/createpaymentsession.d.ts +113 -0
- package/dist/esm/models/operations/createpaymentsession.d.ts.map +1 -0
- package/dist/esm/models/operations/createpaymentsession.js +44 -0
- package/dist/esm/models/operations/createpaymentsession.js.map +1 -0
- package/dist/esm/models/operations/createplan.d.ts +18 -0
- package/dist/esm/models/operations/createplan.d.ts.map +1 -1
- package/dist/esm/models/operations/createplan.js +10 -0
- package/dist/esm/models/operations/createplan.js.map +1 -1
- package/dist/esm/models/operations/getpayment.d.ts +15 -0
- package/dist/esm/models/operations/getpayment.d.ts.map +1 -0
- package/dist/esm/models/operations/getpayment.js +12 -0
- package/dist/esm/models/operations/getpayment.js.map +1 -0
- package/dist/esm/models/operations/getpaymentsession.d.ts +15 -0
- package/dist/esm/models/operations/getpaymentsession.d.ts.map +1 -0
- package/dist/esm/models/operations/getpaymentsession.js +12 -0
- package/dist/esm/models/operations/getpaymentsession.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +3 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +3 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listpayments.d.ts +75 -0
- package/dist/esm/models/operations/listpayments.d.ts.map +1 -0
- package/dist/esm/models/operations/listpayments.js +44 -0
- package/dist/esm/models/operations/listpayments.js.map +1 -0
- package/dist/esm/models/operations/listpaymentsessions.d.ts +75 -0
- package/dist/esm/models/operations/listpaymentsessions.d.ts.map +1 -0
- package/dist/esm/models/operations/listpaymentsessions.js +44 -0
- package/dist/esm/models/operations/listpaymentsessions.js.map +1 -0
- package/dist/esm/models/payment.d.ts +91 -0
- package/dist/esm/models/payment.d.ts.map +1 -0
- package/dist/esm/models/payment.js +52 -0
- package/dist/esm/models/payment.js.map +1 -0
- package/dist/esm/models/subscription.d.ts +8 -4
- package/dist/esm/models/subscription.d.ts.map +1 -1
- package/dist/esm/models/subscription.js +5 -4
- package/dist/esm/models/subscription.js.map +1 -1
- package/dist/esm/sdk/payments.d.ts +27 -0
- package/dist/esm/sdk/payments.d.ts.map +1 -0
- package/dist/esm/sdk/payments.js +38 -0
- package/dist/esm/sdk/payments.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +2 -2
- package/src/funcs/paymentsCreate.ts +175 -0
- package/src/funcs/paymentsGet.ts +177 -0
- package/src/funcs/paymentsList.ts +179 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/matchers.ts +3 -2
- package/src/lib/security.ts +1 -2
- package/src/models/index.ts +1 -0
- package/src/models/operations/createpayment.ts +156 -0
- package/src/models/operations/createpaymentsession.ts +158 -0
- package/src/models/operations/createplan.ts +23 -0
- package/src/models/operations/getpayment.ts +34 -0
- package/src/models/operations/getpaymentsession.ts +34 -0
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/listpayments.ts +126 -0
- package/src/models/operations/listpaymentsessions.ts +130 -0
- package/src/models/payment.ts +149 -0
- package/src/models/subscription.ts +24 -16
- package/src/sdk/payments.ts +64 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -41,7 +41,7 @@ export type StatusPending = ClosedEnum<typeof StatusPending>;
|
|
|
41
41
|
/**
|
|
42
42
|
* Payment session details when upfront payment is required
|
|
43
43
|
*/
|
|
44
|
-
export type
|
|
44
|
+
export type SubscriptionPayment = {
|
|
45
45
|
/**
|
|
46
46
|
* Total payment amount in decimal dollar format. Sample values: '250.00' equals $250.00, '99.99' equals $99.99
|
|
47
47
|
*/
|
|
@@ -54,6 +54,10 @@ export type Payment = {
|
|
|
54
54
|
* Checkout page URL for customer payment completion. Sample values: 'https://checkout.paygentic.com/session/ps_abc123', 'https://pay.example.com/checkout/xyz789'
|
|
55
55
|
*/
|
|
56
56
|
checkoutUrl: string;
|
|
57
|
+
/**
|
|
58
|
+
* ID of the invoice linked to this payment.
|
|
59
|
+
*/
|
|
60
|
+
invoiceId?: string | undefined;
|
|
57
61
|
/**
|
|
58
62
|
* Payment session identifier for upfront payment processing. Sample values: 'ps_abc123xyz', 'ps_789def456'
|
|
59
63
|
*/
|
|
@@ -93,7 +97,7 @@ export type Subscription = {
|
|
|
93
97
|
/**
|
|
94
98
|
* Payment session details when upfront payment is required
|
|
95
99
|
*/
|
|
96
|
-
payment?:
|
|
100
|
+
payment?: SubscriptionPayment | undefined;
|
|
97
101
|
planId: string;
|
|
98
102
|
/**
|
|
99
103
|
* @deprecated Use minimumAccountBalance instead. Minimum required wallet balance in atomic units. Sample values: '200000000000' equals $200.00 minimum, '1000000000000' equals $1000.00 minimum
|
|
@@ -164,22 +168,26 @@ export const StatusPending$inboundSchema: z.ZodNativeEnum<
|
|
|
164
168
|
> = z.nativeEnum(StatusPending);
|
|
165
169
|
|
|
166
170
|
/** @internal */
|
|
167
|
-
export const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
171
|
+
export const SubscriptionPayment$inboundSchema: z.ZodType<
|
|
172
|
+
SubscriptionPayment,
|
|
173
|
+
z.ZodTypeDef,
|
|
174
|
+
unknown
|
|
175
|
+
> = z.object({
|
|
176
|
+
amount: z.string(),
|
|
177
|
+
breakdown: z.lazy(() => Breakdown$inboundSchema),
|
|
178
|
+
checkoutUrl: z.string(),
|
|
179
|
+
invoiceId: z.string().optional(),
|
|
180
|
+
paymentSessionId: z.string(),
|
|
181
|
+
status: StatusPending$inboundSchema,
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
export function subscriptionPaymentFromJSON(
|
|
177
185
|
jsonString: string,
|
|
178
|
-
): SafeParseResult<
|
|
186
|
+
): SafeParseResult<SubscriptionPayment, SDKValidationError> {
|
|
179
187
|
return safeParse(
|
|
180
188
|
jsonString,
|
|
181
|
-
(x) =>
|
|
182
|
-
`Failed to parse '
|
|
189
|
+
(x) => SubscriptionPayment$inboundSchema.parse(JSON.parse(x)),
|
|
190
|
+
`Failed to parse 'SubscriptionPayment' from JSON`,
|
|
183
191
|
);
|
|
184
192
|
}
|
|
185
193
|
|
|
@@ -204,7 +212,7 @@ export const Subscription$inboundSchema: z.ZodType<
|
|
|
204
212
|
estimatedTaxRate: z.number().optional(),
|
|
205
213
|
taxExempt: z.boolean().default(false),
|
|
206
214
|
name: z.string(),
|
|
207
|
-
payment: z.lazy(() =>
|
|
215
|
+
payment: z.lazy(() => SubscriptionPayment$inboundSchema).optional(),
|
|
208
216
|
planId: z.string(),
|
|
209
217
|
prefundAmount: z.string().optional(),
|
|
210
218
|
minimumAccountBalance: z.string().optional(),
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { paymentsCreate } from "../funcs/paymentsCreate.js";
|
|
6
|
+
import { paymentsGet } from "../funcs/paymentsGet.js";
|
|
7
|
+
import { paymentsList } from "../funcs/paymentsList.js";
|
|
8
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
9
|
+
import * as models from "../models/index.js";
|
|
10
|
+
import * as operations from "../models/operations/index.js";
|
|
11
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
12
|
+
|
|
13
|
+
export class Payments extends ClientSDK {
|
|
14
|
+
/**
|
|
15
|
+
* List Payments
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* List payments for the authenticated merchant with optional filters.
|
|
19
|
+
*/
|
|
20
|
+
async list(
|
|
21
|
+
request?: operations.ListPaymentsRequest | undefined,
|
|
22
|
+
options?: RequestOptions,
|
|
23
|
+
): Promise<operations.ListPaymentsResponse> {
|
|
24
|
+
return unwrapAsync(paymentsList(
|
|
25
|
+
this,
|
|
26
|
+
request,
|
|
27
|
+
options,
|
|
28
|
+
));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Create Payment
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Create a new payment for collecting a one-off charge. Returns a payment URL that can be shared with the customer.
|
|
36
|
+
*/
|
|
37
|
+
async create(
|
|
38
|
+
request: operations.CreatePaymentRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): Promise<models.Payment> {
|
|
41
|
+
return unwrapAsync(paymentsCreate(
|
|
42
|
+
this,
|
|
43
|
+
request,
|
|
44
|
+
options,
|
|
45
|
+
));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get Payment
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* Retrieve a single payment by ID.
|
|
53
|
+
*/
|
|
54
|
+
async get(
|
|
55
|
+
request: operations.GetPaymentRequest,
|
|
56
|
+
options?: RequestOptions,
|
|
57
|
+
): Promise<models.Payment> {
|
|
58
|
+
return unwrapAsync(paymentsGet(
|
|
59
|
+
this,
|
|
60
|
+
request,
|
|
61
|
+
options,
|
|
62
|
+
));
|
|
63
|
+
}
|
|
64
|
+
}
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { Events } from "./events.js";
|
|
|
12
12
|
import { Features } from "./features.js";
|
|
13
13
|
import { Fees } from "./fees.js";
|
|
14
14
|
import { InvoicesV2 } from "./invoicesv2.js";
|
|
15
|
+
import { Payments } from "./payments.js";
|
|
15
16
|
import { Plans } from "./plans.js";
|
|
16
17
|
import { Prices } from "./prices.js";
|
|
17
18
|
import { Products } from "./products.js";
|
|
@@ -98,6 +99,11 @@ export class Paygentic extends ClientSDK {
|
|
|
98
99
|
return (this._invoicesV2 ??= new InvoicesV2(this._options));
|
|
99
100
|
}
|
|
100
101
|
|
|
102
|
+
private _payments?: Payments;
|
|
103
|
+
get payments(): Payments {
|
|
104
|
+
return (this._payments ??= new Payments(this._options));
|
|
105
|
+
}
|
|
106
|
+
|
|
101
107
|
private _events?: Events;
|
|
102
108
|
get events(): Events {
|
|
103
109
|
return (this._events ??= new Events(this._options));
|