@plyaz/types 1.13.6 → 1.13.8
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.
- package/dist/index.cjs +0 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -41
- package/dist/index.js.map +1 -1
- package/dist/payments/base-error/index.d.ts +1 -1
- package/dist/payments/base-error/types.d.ts +3 -2
- package/dist/payments/gateways/provider/types.d.ts +13 -13
- package/dist/payments/gateways/routings/types.d.ts +11 -11
- package/dist/payments/index.cjs +0 -41
- package/dist/payments/index.cjs.map +1 -1
- package/dist/payments/index.d.ts +0 -1
- package/dist/payments/index.js +1 -41
- package/dist/payments/index.js.map +1 -1
- package/dist/payments/provider/adapter/types.d.ts +2 -2
- package/dist/payments/provider/core/types.d.ts +9 -9
- package/dist/payments/provider/payment-provider/types.d.ts +2 -2
- package/dist/payments/transaction/types.d.ts +3 -3
- package/package.json +1 -1
- package/dist/payments/currency/enums.d.ts +0 -37
- package/dist/payments/currency/index.d.ts +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CURRENCY_CODES } from '@plyaz/config';
|
|
2
2
|
import type { FeeBreakdown, Money } from '../../transaction';
|
|
3
3
|
import type { PAYMENTMETHOD, PAYMENTPROVIDERTYPE, PAYMENTSTATUS } from '../provider-capability';
|
|
4
4
|
/**
|
|
@@ -255,8 +255,8 @@ export interface NormalizedPaymentRequest<TMetadata extends object = object> {
|
|
|
255
255
|
amount: Money;
|
|
256
256
|
/** Payment method */
|
|
257
257
|
method: PAYMENTMETHOD;
|
|
258
|
-
/**
|
|
259
|
-
|
|
258
|
+
/** CurrencyCode */
|
|
259
|
+
CurrencyCode: typeof CURRENCY_CODES;
|
|
260
260
|
/** User initiating the transaction */
|
|
261
261
|
userId: string;
|
|
262
262
|
/** Product or service being purchased */
|
|
@@ -287,8 +287,8 @@ export interface TransactionDetails<TMetadata extends object = object> {
|
|
|
287
287
|
fees?: FeeBreakdown;
|
|
288
288
|
/** Payment method used */
|
|
289
289
|
method: PAYMENTMETHOD;
|
|
290
|
-
/**
|
|
291
|
-
|
|
290
|
+
/** CurrencyCode of the transaction */
|
|
291
|
+
CurrencyCode: typeof CURRENCY_CODES;
|
|
292
292
|
/** Timestamp when transaction was created */
|
|
293
293
|
createdAt: Date;
|
|
294
294
|
/** Timestamp of the latest status update */
|
|
@@ -329,7 +329,7 @@ export interface AdapterConfiguration<TMetadata extends object = object> {
|
|
|
329
329
|
};
|
|
330
330
|
/** Supported payment methods and currencies */
|
|
331
331
|
supportedMethods: PAYMENTMETHOD[];
|
|
332
|
-
supportedCurrencies:
|
|
332
|
+
supportedCurrencies: (typeof CURRENCY_CODES)[];
|
|
333
333
|
/** Additional configuration or metadata */
|
|
334
334
|
metadata?: TMetadata;
|
|
335
335
|
}
|
|
@@ -382,8 +382,8 @@ export interface PayoutParams<TMetadata extends object = object> {
|
|
|
382
382
|
recipientId: string;
|
|
383
383
|
/** Amount to pay out */
|
|
384
384
|
amount: Money;
|
|
385
|
-
/**
|
|
386
|
-
|
|
385
|
+
/** CurrencyCode of payout */
|
|
386
|
+
CurrencyCode: typeof CURRENCY_CODES;
|
|
387
387
|
/** Optional bank account / wallet ID at provider */
|
|
388
388
|
destinationId?: string;
|
|
389
389
|
/** Optional description */
|
|
@@ -415,7 +415,7 @@ export interface ReceiptData<TMetadata extends object = object> {
|
|
|
415
415
|
receiptId: string;
|
|
416
416
|
issuedAt: Date;
|
|
417
417
|
amount: Money;
|
|
418
|
-
|
|
418
|
+
CurrencyCode: typeof CURRENCY_CODES;
|
|
419
419
|
lineItems?: Array<{
|
|
420
420
|
name: string;
|
|
421
421
|
quantity: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ProviderHealthStatus } from '../../../features';
|
|
2
|
-
import type { CURRENCY } from '../../currency';
|
|
3
2
|
import type { BaseProviderConfig } from '../../gateways';
|
|
4
3
|
import type { PaymentResult, ProcessPaymentRequest } from '../../request';
|
|
5
4
|
import type { FeeBreakdown, Money } from '../../transaction';
|
|
6
5
|
import type { CreateCustomerParams, CustomerResult, FeeCalculationOptions, PaymentStatusResult, RefundParams, RefundResult, SavedPaymentMethodResult, SavePaymentMethodParams, TransactionHistory, TransactionHistoryParams, WebhookPayload, WebhookResult } from '../core';
|
|
7
6
|
import type { PAYMENTMETHOD, PAYMENTPROVIDERTYPE } from '../provider-capability';
|
|
7
|
+
import type { CURRENCY_CODES } from '@plyaz/config';
|
|
8
8
|
/**
|
|
9
9
|
* Core interface that all payment providers must implement.
|
|
10
10
|
* This interface ensures consistent behavior across all providers
|
|
@@ -22,7 +22,7 @@ export interface PaymentProvider {
|
|
|
22
22
|
/** Payment methods supported by this provider */
|
|
23
23
|
readonly supportedMethods: PAYMENTMETHOD[];
|
|
24
24
|
/** Currencies supported by this provider */
|
|
25
|
-
readonly supportedCurrencies:
|
|
25
|
+
readonly supportedCurrencies: typeof CURRENCY_CODES[];
|
|
26
26
|
/** Detailed capabilities of this provider */
|
|
27
27
|
readonly capabilities: ProviderCapabilities;
|
|
28
28
|
/** Provider configuration and metadata */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CURRENCY_CODES } from '@plyaz/config';
|
|
2
2
|
/**
|
|
3
3
|
* Core money interface for handling monetary values throughout the system.
|
|
4
4
|
* All monetary amounts are stored in the smallest currency unit to avoid
|
|
@@ -20,7 +20,7 @@ export interface Money {
|
|
|
20
20
|
* Currency code following ISO 4217 standard for fiat currencies
|
|
21
21
|
* and custom codes for cryptocurrencies (BTC, ETH, etc.)
|
|
22
22
|
*/
|
|
23
|
-
currency:
|
|
23
|
+
currency: typeof CURRENCY_CODES;
|
|
24
24
|
/**
|
|
25
25
|
* Human-readable formatted amount for display purposes
|
|
26
26
|
* Example: "$50.00", "€45.50", "0.001 BTC"
|
|
@@ -35,7 +35,7 @@ export interface Money {
|
|
|
35
35
|
* Original currency if this amount was converted
|
|
36
36
|
* Helps with audit trails and reconciliation
|
|
37
37
|
*/
|
|
38
|
-
originalCurrency?:
|
|
38
|
+
originalCurrency?: typeof CURRENCY_CODES;
|
|
39
39
|
/**
|
|
40
40
|
* Timestamp when exchange rate was calculated
|
|
41
41
|
* Important for cryptocurrency and volatile currency exchanges
|
package/package.json
CHANGED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export declare enum CURRENCY {
|
|
2
|
-
USD = "USD",// US Dollar
|
|
3
|
-
EUR = "EUR",// Euro
|
|
4
|
-
GBP = "GBP",// British Pound
|
|
5
|
-
PKR = "PKR",// Pakistani Rupee
|
|
6
|
-
INR = "INR",// Indian Rupee
|
|
7
|
-
AUD = "AUD",// Australian Dollar
|
|
8
|
-
CAD = "CAD",// Canadian Dollar
|
|
9
|
-
NGN = "NGN",// Nigerian Naira
|
|
10
|
-
KES = "KES",// Kenyan Shilling
|
|
11
|
-
ZAR = "ZAR",// South African Rand
|
|
12
|
-
AED = "AED",// UAE Dirham
|
|
13
|
-
SAR = "SAR",// Saudi Riyal
|
|
14
|
-
JPY = "JPY",// Japanese Yen
|
|
15
|
-
CNY = "CNY",// Chinese Yuan
|
|
16
|
-
TRY = "TRY",// Turkish Lira
|
|
17
|
-
BRL = "BRL",// Brazilian Real
|
|
18
|
-
MXN = "MXN",// Mexican Peso
|
|
19
|
-
CHF = "CHF",// Swiss Franc
|
|
20
|
-
SGD = "SGD",// Singapore Dollar
|
|
21
|
-
HKD = "HKD",// Hong Kong Dollar
|
|
22
|
-
MYR = "MYR",// Malaysian Ringgit
|
|
23
|
-
THB = "THB",// Thai Baht
|
|
24
|
-
PHP = "PHP",// Philippine Peso
|
|
25
|
-
IDR = "IDR",// Indonesian Rupiah
|
|
26
|
-
SEK = "SEK",// Swedish Krona
|
|
27
|
-
NOK = "NOK",// Norwegian Krone
|
|
28
|
-
DKK = "DKK",// Danish Krone
|
|
29
|
-
PLN = "PLN",// Polish Zloty
|
|
30
|
-
CZK = "CZK",// Czech Koruna
|
|
31
|
-
HUF = "HUF",// Hungarian Forint
|
|
32
|
-
RUB = "RUB",// Russian Ruble
|
|
33
|
-
KRW = "KRW",// South Korean Won
|
|
34
|
-
VND = "VND",// Vietnamese Dong
|
|
35
|
-
EGP = "EGP",// Egyptian Pound
|
|
36
|
-
ILS = "ILS"
|
|
37
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './enums';
|