@plyaz/types 1.27.0 → 1.27.2

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.
@@ -0,0 +1,49 @@
1
+ import type { PAYMENT_PROVIDER_TYPE } from '../provider';
2
+ import type { KYC_ENTITY_TYPE, KYC_TIER, ONBOARD_LINK_TYPE, ONBOARD_STATUS } from './enum';
3
+ export interface CreatePayoutAccountParams<TMetadata extends object = object> {
4
+ provider: PAYMENT_PROVIDER_TYPE;
5
+ userId: string;
6
+ email: string;
7
+ country: string;
8
+ entityType: KYC_ENTITY_TYPE;
9
+ tier: KYC_TIER;
10
+ onboardType?: 'standard' | 'express' | 'custom';
11
+ redirectUrls?: {
12
+ refreshUrl: string;
13
+ returnUrl: string;
14
+ };
15
+ metadata?: TMetadata;
16
+ }
17
+ export interface CreatePayoutAccountResponse<TMetadata extends object = object> {
18
+ userId: string;
19
+ provider: PAYMENT_PROVIDER_TYPE;
20
+ providerAccountId: string;
21
+ status: ONBOARD_STATUS;
22
+ tier: KYC_TIER;
23
+ metadata?: TMetadata;
24
+ createdAt: string;
25
+ }
26
+ export interface CreateAccountLinkParams {
27
+ providerAccountId: string;
28
+ onboardType: ONBOARD_LINK_TYPE;
29
+ clientSecret?: string;
30
+ tier: KYC_TIER;
31
+ redirectUrls: {
32
+ refreshUrl: string;
33
+ returnUrl: string;
34
+ };
35
+ }
36
+ export interface CreateAccountLinkResponse {
37
+ providerAccountId: string;
38
+ redirectUrl: string;
39
+ createdAt: string;
40
+ tier: KYC_TIER;
41
+ }
42
+ export interface PayoutAccountStatus {
43
+ id: string;
44
+ payoutsEnabled: boolean;
45
+ chargesEnabled: boolean;
46
+ detailsSubmitted: boolean;
47
+ currentlyDue?: string[] | null;
48
+ eventuallyDue?: string[] | null;
49
+ }
@@ -4,9 +4,10 @@ import type { BaseProviderConfig, CreatePricingParams, CreatePricingResult, Crea
4
4
  import type { PaymentResult, ProcessPaymentRequest } from '../../request';
5
5
  import type { FeeBreakdown, Money } from '../../transaction';
6
6
  import type { AdapterConfiguration, CreateCustomerParams, CreateSubscriptionParams, CustomerResult, FeeStructure, PaymentStatusResult, PayoutParams, PayoutResult, RefundParams, RefundResult, SavedPaymentMethod, SavedPaymentMethodResult, SavePaymentMethodParams, SubscriptionResult, TransactionDetails, TransactionHistory, TransactionHistoryParams, WebhookPayload, WebhookResult, WithdrawalParams, WithdrawalResult } from '../core';
7
- import type { ProviderCapabilities, ProviderConfiguration } from '../payment-provider';
7
+ import type { PayoutAccountCapabilities, ProviderCapabilities, ProviderConfiguration } from '../payment-provider';
8
8
  import type { PAYMENT_METHOD, PAYMENT_PROVIDER_TYPE } from '../provider-capability';
9
9
  import type { CalculateFeeParams } from '../../gateways/provider/fee/types';
10
+ import type { CreateAccountLinkParams, CreateAccountLinkResponse, CreatePayoutAccountParams, CreatePayoutAccountResponse, PayoutAccountStatus } from '../../kyc';
10
11
  /**
11
12
  * Core interface that all payment providers must implement.
12
13
  * This interface ensures consistent behavior across all providers
@@ -29,6 +30,11 @@ export interface PaymentAdapter {
29
30
  readonly supportedCurrencies: CurrencyCode[];
30
31
  /** Detailed capabilities of this provider */
31
32
  readonly capabilities: ProviderCapabilities;
33
+ /**
34
+ * Detailed payout/account-level capabilities.
35
+ * Includes core, optional/region-specific, advanced, and compliance capabilities.
36
+ */
37
+ readonly payoutAccountCapabilities: PayoutAccountCapabilities;
32
38
  /** Provider configuration and metadata */
33
39
  readonly config: ProviderConfiguration;
34
40
  /**
@@ -202,6 +208,10 @@ export interface PaymentAdapter {
202
208
  * Process payout to recipient (optional)
203
209
  */
204
210
  processPayout?(params: PayoutParams): Promise<PayoutResult>;
211
+ onboardPayoutAccount?<TMetadata extends object = object>(params: CreatePayoutAccountParams<TMetadata>): Promise<CreatePayoutAccountResponse<TMetadata>>;
212
+ generateOnboardingLink?(params: CreateAccountLinkParams): Promise<CreateAccountLinkResponse>;
213
+ getPayoutAccountStatus?(accountId: string): Promise<PayoutAccountStatus>;
214
+ getCapabilities?(): Promise<PayoutAccountCapabilities>;
205
215
  /**
206
216
  * Process withdrawal from a user's balance (optional)
207
217
  * This method represents a user-initiated request to move funds from their platform account
@@ -219,6 +219,64 @@ export interface ProviderCapabilities {
219
219
  /** Settlement time estimates per payment method */
220
220
  settlementTimes: Record<PAYMENT_METHOD, SettlementTimeEstimate>;
221
221
  }
222
+ /**
223
+ * Represents the unified capabilities of a payout/payment account
224
+ * across multiple payment providers.
225
+ */
226
+ export interface PayoutAccountCapabilities {
227
+ /** Can accept card or online payments from customers. Equivalent to Stripe's `card_payments`. */
228
+ canAcceptPayments: boolean;
229
+ /** Can receive funds/transfers from the platform or other accounts. Equivalent to Stripe's `transfers`. */
230
+ canReceiveTransfers: boolean;
231
+ /** Can withdraw funds to an external bank account. Equivalent to Stripe's `payouts`. */
232
+ canPayout: boolean;
233
+ /** Can accept SEPA Direct Debit payments (EU). */
234
+ canAcceptSEPA: boolean;
235
+ /** Can accept BACS Direct Debit payments (UK). */
236
+ canAcceptBACS: boolean;
237
+ /** Can accept iDEAL payments (Netherlands). */
238
+ canAcceptiDEAL: boolean;
239
+ /** Can accept Klarna Buy-Now-Pay-Later payments. */
240
+ canAcceptKlarna: boolean;
241
+ /** Can accept other Buy-Now-Pay-Later methods like Afterpay / Clearpay. */
242
+ canAcceptOtherBNPL: boolean;
243
+ /** Can accept ACH payments (US bank account transfers). */
244
+ canAcceptACH: boolean;
245
+ /** Can accept Faster Payments (UK). */
246
+ canAcceptFasterPayments: boolean;
247
+ /** Can accept Przelewy24 payments (Poland). */
248
+ canAcceptP24: boolean;
249
+ /** Can accept EPS payments (Austria). */
250
+ canAcceptEPS: boolean;
251
+ /** Can accept Giropay payments (Germany). */
252
+ canAcceptGiropay: boolean;
253
+ /** Can accept Alipay payments (China / global). */
254
+ canAcceptAlipay: boolean;
255
+ /** Can accept WeChat Pay payments (China / global). */
256
+ canAcceptWeChatPay: boolean;
257
+ /** Can use Treasury-like products such as wallets or balance accounts. */
258
+ canUseTreasury: boolean;
259
+ /** Can issue virtual or physical cards (Stripe Issuing). */
260
+ canIssueCards: boolean;
261
+ /** Can perform instant payouts (provider-dependent). */
262
+ canUseInstantPayouts: boolean;
263
+ /** Can hold funds in the platform account before payout. */
264
+ canHoldBalance: boolean;
265
+ /** Can create sub-accounts or nested merchant accounts. */
266
+ canCreateSubAccounts: boolean;
267
+ /** Can use provider-level tax reporting (e.g., US 1099). */
268
+ canUseTaxReporting: boolean;
269
+ /** Bank account is verified and ready for payouts. */
270
+ bankVerified: boolean;
271
+ /** User has passed KYC verification checks. */
272
+ canUseKYCVerification: boolean;
273
+ /** User has passed AML (Anti-Money Laundering) checks. */
274
+ canUseAMLCheck: boolean;
275
+ /** Can issue refunds to customers. */
276
+ canProcessRefunds: boolean;
277
+ /** Can handle disputes, chargebacks, or payment reversals. */
278
+ canHandleDisputes: boolean;
279
+ }
222
280
  /**
223
281
  * Provider configuration interface for initialization.
224
282
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plyaz/types",
3
- "version": "1.27.0",
3
+ "version": "1.27.2",
4
4
  "author": "Redeemer Pace",
5
5
  "license": "ISC",
6
6
  "description": "Provides shared TypeScript types and schema utilities for validation and parsing in the @playz ecosystem.",