import type { ApiClient } from "@promobase/sdk-runtime"; import type { ApplicationFields } from "./application.ts"; import type { CurrencyAmountFields } from "./currency-amount.ts"; import type { UserFields } from "./user.ts"; export interface PaymentEnginePaymentFields { actions: Record[]; application: ApplicationFields; country: string; created_time: string; disputes: Record[]; fraud_status: string; fulfillment_status: string; id: string; is_from_ad: boolean; is_from_page_post: boolean; items: Record[]; payout_foreign_exchange_rate: number; phone_support_eligible: boolean; platform: string; refundable_amount: CurrencyAmountFields; request_id: string; tax: string; tax_country: string; test: number; user: UserFields; } export interface PaymentEnginePaymentCreateDisputeParams { reason: string; [key: string]: unknown; } export interface PaymentEnginePaymentCreateRefundsParams { amount: number; currency: string; reason?: string; [key: string]: unknown; } export function paymentEnginePaymentNode(client: ApiClient, id: string) { return { __path: id, __brand: undefined as unknown as PaymentEnginePaymentFields, get: (opts: { fields: F; params?: Record }) => client.get>(`${id}`, opts), createDispute: (params: PaymentEnginePaymentCreateDisputeParams) => client.post(`${id}/dispute`, params as Record), createRefund: (params: PaymentEnginePaymentCreateRefundsParams) => client.post(`${id}/refunds`, params as Record), }; }