payrex-js-sdk
Version:
A PayRex SDK written for NodeJS
53 lines (50 loc) • 1.64 kB
text/typescript
import { PaymentIntentResource } from '../payment-intent/types.cjs';
import { AvailablePaymentMethods, PayrexPaymentMethodOptions } from '../types.cjs';
type CheckoutSessionLineItem = {
name: string;
amount: number;
quantity: number;
description?: string;
image?: string;
};
type CreateCheckoutSessionPayload = {
currency: string;
payment_methods: AvailablePaymentMethods;
line_items: CheckoutSessionLineItem[];
success_url: string;
cancel_url: string;
customer_reference_id?: string;
description?: string;
submit_type?: string;
payment_method_options?: PayrexPaymentMethodOptions;
expires_at?: number;
metadata?: Record<string, string>;
};
type CheckoutSessionLineItemResource = Required<Omit<CheckoutSessionLineItem, "description" | "image">> & {
id: string;
resource: string;
description: string | null;
image: string | null;
};
type CheckoutSessionResource = {
id: string;
resource: string;
customer_reference_id: string | null;
client_secret: string;
status: string;
currency: string;
line_items: CheckoutSessionLineItemResource[];
livemode: boolean;
url: string;
payment_intent: PaymentIntentResource;
metadata: Record<string, string> | null;
success_url: string;
cancel_url: string;
payment_methods: AvailablePaymentMethods | string[];
description: string | null;
submit_type: string;
expires_at: number;
created_at: number;
updated_at: number;
};
export type { CheckoutSessionLineItem, CheckoutSessionLineItemResource, CheckoutSessionResource, CreateCheckoutSessionPayload };