import type { Account, BalanceTransaction, Capability, ChargebackAlert, CreateAccountParams, CreateReportRunParams, CreateWebhookEndpointParams, Dispute, Document, DocumentUpload, ListAccountsParams, ListBalanceTransactionsParams, ListChargebackAlertsParams, ListDisputesParams, ListPayoutsParams, OnboardingLink, Page, PaymentsRestriction, Payout, PricingTemplate, ReportRun, Requirement, RequestOpts, TpaEvent, UpdateAccountParams, WebhookEndpoint } from './types.js'; /** * A ClientTransport abstracts the wire protocol. Two impls exist: * - InternalTransport (used by the Hub): calls local services in-process. * - HttpTransport (used by partners and the future stand-alone tagadapay-app): * makes HTTP requests to the published API. * * The Public SDK surface (TagadaPayClient) is identical regardless of * transport — a consumer writes the same code for both. */ export interface ClientTransport { kind: 'internal' | 'http'; accountsCreate(payload: CreateAccountParams, opts?: RequestOpts): Promise; accountsRetrieve(id: string, opts?: RequestOpts): Promise; accountsUpdate(id: string, patch: UpdateAccountParams, opts?: RequestOpts): Promise; accountsList(params: ListAccountsParams, opts?: RequestOpts): Promise>; accountsUploadDocument(id: string, doc: DocumentUpload, opts?: RequestOpts): Promise; accountsListRequirements(id: string, opts?: RequestOpts): Promise; accountsCreateOnboardingLink(id: string, opts?: RequestOpts): Promise; accountsListCapabilities(id: string, opts?: RequestOpts): Promise; payoutsList(params: ListPayoutsParams, opts?: RequestOpts): Promise>; payoutsRetrieve(id: string, opts?: RequestOpts): Promise; disputesList(params: ListDisputesParams, opts?: RequestOpts): Promise>; disputesRetrieve(id: string, opts?: RequestOpts): Promise; disputesSubmitEvidence(id: string, evidence: Record, opts?: RequestOpts): Promise; chargebackAlertsList(params: ListChargebackAlertsParams, opts?: RequestOpts): Promise>; chargebackAlertsRetrieve(id: string, opts?: RequestOpts): Promise; chargebackAlertsAction(id: string, action: 'refund' | 'accept' | 'ignore', opts?: RequestOpts): Promise; balanceTransactionsList(params: ListBalanceTransactionsParams, opts?: RequestOpts): Promise>; balanceTransactionsRetrieve(id: string, opts?: RequestOpts): Promise; reportRunsCreate(params: CreateReportRunParams, opts?: RequestOpts): Promise; reportRunsRetrieve(id: string, opts?: RequestOpts): Promise; reportRunsList(cursor?: string, opts?: RequestOpts): Promise>; webhookEndpointsCreate(params: CreateWebhookEndpointParams, opts?: RequestOpts): Promise; webhookEndpointsList(ownerType: 'merchant' | 'platform' | 'partner', ownerId: string, opts?: RequestOpts): Promise>; webhookEndpointsUpdate(id: string, patch: Partial>, opts?: RequestOpts): Promise; webhookEndpointsDelete(id: string, opts?: RequestOpts): Promise; pricingTemplatesCreate(params: Omit & { ownerType: 'platform' | 'partner'; ownerId: string; }, opts?: RequestOpts): Promise; pricingTemplatesList(ownerType: 'platform' | 'partner', ownerId: string, opts?: RequestOpts): Promise>; pricingTemplatesRetrieve(id: string, opts?: RequestOpts): Promise; accountsPlacePaymentsRestriction(id: string, restriction: PaymentsRestriction, opts?: RequestOpts): Promise; accountsReleasePaymentsRestriction(id: string, opts?: RequestOpts): Promise; } export interface TagadaPayClientConfig { /** Merchant or partner API key (tgd_live_xxx / tgd_test_xxx / tgd_internal_xxx). */ apiKey?: string; /** Internal trust secret used by the Hub in Phase A (fn-call instead of HTTP). */ internalTrust?: { secret: string; }; /** Public API base URL. Ignored by the InternalTransport. */ baseUrl?: string; /** API pinned version header. */ apiVersion?: string; /** Explicit transport override (useful for tests). */ transport?: ClientTransport; } /** * TagadaPayClient — pluggable-transport client. * * Two transports: * * - `InternalTransport` for in-process Hub→TagadaPay handoff (no HTTP * hop). Used by `src/app/services/tagadapay/client.ts`: * * const tagadapay = new TagadaPayClient({ * transport: createInternalTransport({ accounts: { create, retrieve } }), * }); * * - `HttpTransport` for the public `/api/tagadapay/v1/*` surface: * * const tagadapay = new TagadaPayClient({ * transport: createHttpTransport({ apiKey: 'tp_sk_***', baseUrl: '...' }), * }); * * For new partner / external code, prefer the modern `Tagada` client * and the `tagada.partners.*` namespace — resource-keyed (Stripe-style) * and exposed at the top level of `@tagadapay/node-sdk`. */ export declare class TagadaPayClient { private readonly transport; private readonly apiVersion; constructor(config: TagadaPayClientConfig); accounts: { create: (payload: CreateAccountParams, opts?: RequestOpts) => Promise; retrieve: (id: string, opts?: RequestOpts) => Promise; update: (id: string, patch: UpdateAccountParams, opts?: RequestOpts) => Promise; list: (params: ListAccountsParams, opts?: RequestOpts) => Promise>; uploadDocument: (id: string, doc: DocumentUpload, opts?: RequestOpts) => Promise; listRequirements: (id: string, opts?: RequestOpts) => Promise; createOnboardingLink: (id: string, opts?: RequestOpts) => Promise; listCapabilities: (id: string, opts?: RequestOpts) => Promise; }; payouts: { list: (params: ListPayoutsParams, opts?: RequestOpts) => Promise>; retrieve: (id: string, opts?: RequestOpts) => Promise; }; disputes: { list: (params: ListDisputesParams, opts?: RequestOpts) => Promise>; retrieve: (id: string, opts?: RequestOpts) => Promise; submitEvidence: (id: string, evidence: Record, opts?: RequestOpts) => Promise; }; chargebackAlerts: { list: (params: ListChargebackAlertsParams, opts?: RequestOpts) => Promise>; retrieve: (id: string, opts?: RequestOpts) => Promise; action: (id: string, action: "refund" | "accept" | "ignore", opts?: RequestOpts) => Promise; }; balanceTransactions: { list: (params: ListBalanceTransactionsParams, opts?: RequestOpts) => Promise>; retrieve: (id: string, opts?: RequestOpts) => Promise; }; reportRuns: { create: (params: CreateReportRunParams, opts?: RequestOpts) => Promise; retrieve: (id: string, opts?: RequestOpts) => Promise; list: (cursor?: string, opts?: RequestOpts) => Promise>; }; webhookEndpoints: { create: (params: CreateWebhookEndpointParams, opts?: RequestOpts) => Promise; list: (ownerType: "merchant" | "platform" | "partner", ownerId: string, opts?: RequestOpts) => Promise>; update: (id: string, patch: Partial>, opts?: RequestOpts) => Promise; delete: (id: string, opts?: RequestOpts) => Promise; }; pricingTemplates: { create: (params: Omit & { ownerType: "platform" | "partner"; ownerId: string; }, opts?: RequestOpts) => Promise; list: (ownerType: "platform" | "partner", ownerId: string, opts?: RequestOpts) => Promise>; retrieve: (id: string, opts?: RequestOpts) => Promise; }; paymentsRestrictions: { place: (id: string, restriction: PaymentsRestriction, opts?: RequestOpts) => Promise; release: (id: string, opts?: RequestOpts) => Promise; }; webhooks: { /** * Verify HMAC signature and parse the envelope. Spec-compat with * Stripe-style signatures for portability (`t=,v1=`). */ constructEvent: (rawBody: string, signature: string, secret: string) => TpaEvent; }; private withVersion; } //# sourceMappingURL=client.d.ts.map