UNPKG

@wepublish/api

Version:
45 lines (44 loc) 1.2 kB
import { PayrexxClient } from './payrexx-client'; import { Transaction } from './transaction-client'; type CreateGatewayRequestData = { psp: number[]; pm: string[]; referenceId: string; amount: number; fields?: Record<string, any>; successRedirectUrl: string; failedRedirectUrl: string; cancelRedirectUrl: string; vatRate: number; currency: string; preAuthorization?: boolean; chargeOnAuthorization?: boolean; }; export type GatewayStatus = 'waiting' | 'confirmed' | 'cancelled' | 'declined'; export type Gateway = { id: number; status: GatewayStatus; hash: string; referenceId: string; link: string; invoices: Array<{ transactions: Array<Transaction>; }>; preAuthorization: true; fields: []; psp: number[]; pm: string[]; amount: number; currency: string; vatRate: number; sku: string; applicationFee: number; createdAt: number; }; export declare class GatewayClient { private readonly client; constructor(client: PayrexxClient); createGateway(requestData: CreateGatewayRequestData): Promise<Gateway>; getGateway(gatewayId: string): Promise<Gateway>; } export {};