@radhya/payments-core 0.1.3
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.d.ts +223 -0
- package/dist/index.js +1 -0
- package/package.json +27 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
type Currency = 'INR' | 'USD' | 'EUR' | 'GBP' | 'AED' | 'SGD';
|
|
2
|
+
type PaymentStatus = 'created' | 'pending' | 'authorized' | 'captured' | 'failed' | 'cancelled' | 'refunded' | 'partially_refunded';
|
|
3
|
+
type SubscriptionStatus = 'initialized' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'completed' | 'expired';
|
|
4
|
+
type PlanInterval = 'day' | 'week' | 'month' | 'year';
|
|
5
|
+
type PaymentMethod = 'card' | 'upi' | 'netbanking' | 'wallet' | 'emi' | 'paylater' | 'bank_transfer';
|
|
6
|
+
interface Money {
|
|
7
|
+
amount: number;
|
|
8
|
+
currency: Currency;
|
|
9
|
+
}
|
|
10
|
+
interface Address {
|
|
11
|
+
line1?: string;
|
|
12
|
+
line2?: string;
|
|
13
|
+
city?: string;
|
|
14
|
+
state?: string;
|
|
15
|
+
postalCode?: string;
|
|
16
|
+
country: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface Customer {
|
|
20
|
+
id: string;
|
|
21
|
+
email: string;
|
|
22
|
+
phone?: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
address?: Address;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface CreateOrderInput {
|
|
28
|
+
amount: Money;
|
|
29
|
+
customer: Customer;
|
|
30
|
+
description?: string;
|
|
31
|
+
returnUrl?: string;
|
|
32
|
+
notifyUrl?: string;
|
|
33
|
+
metadata?: Record<string, string>;
|
|
34
|
+
idempotencyKey?: string;
|
|
35
|
+
}
|
|
36
|
+
interface Order {
|
|
37
|
+
id: string;
|
|
38
|
+
providerId: string;
|
|
39
|
+
providerSessionId: string;
|
|
40
|
+
providerName: string;
|
|
41
|
+
amount: Money;
|
|
42
|
+
status: PaymentStatus;
|
|
43
|
+
customer: Customer;
|
|
44
|
+
paymentMethod?: PaymentMethod;
|
|
45
|
+
description?: string;
|
|
46
|
+
returnUrl?: string;
|
|
47
|
+
metadata?: Record<string, string>;
|
|
48
|
+
providerData?: Record<string, unknown>;
|
|
49
|
+
createdAt: number;
|
|
50
|
+
updatedAt: number;
|
|
51
|
+
paidAt?: number;
|
|
52
|
+
expiresAt?: number;
|
|
53
|
+
}
|
|
54
|
+
interface PaymentVerification {
|
|
55
|
+
orderId: string;
|
|
56
|
+
providerOrderId: string;
|
|
57
|
+
status: PaymentStatus;
|
|
58
|
+
amount: Money;
|
|
59
|
+
paymentMethod?: PaymentMethod;
|
|
60
|
+
providerPaymentId?: string;
|
|
61
|
+
providerData?: Record<string, unknown>;
|
|
62
|
+
}
|
|
63
|
+
interface RefundInput {
|
|
64
|
+
orderId: string;
|
|
65
|
+
amount?: Money;
|
|
66
|
+
reason?: string;
|
|
67
|
+
}
|
|
68
|
+
interface Refund {
|
|
69
|
+
id: string;
|
|
70
|
+
orderId: string;
|
|
71
|
+
amount: Money;
|
|
72
|
+
status: 'pending' | 'success' | 'failed';
|
|
73
|
+
reason?: string;
|
|
74
|
+
createdAt: number;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface Plan {
|
|
78
|
+
id: string;
|
|
79
|
+
providerId?: string;
|
|
80
|
+
name: string;
|
|
81
|
+
description?: string;
|
|
82
|
+
amount: Money;
|
|
83
|
+
interval: PlanInterval;
|
|
84
|
+
intervalCount: number;
|
|
85
|
+
trialDays?: number;
|
|
86
|
+
maxCycles?: number;
|
|
87
|
+
features?: string[];
|
|
88
|
+
metadata?: Record<string, string>;
|
|
89
|
+
isActive: boolean;
|
|
90
|
+
createdAt: number;
|
|
91
|
+
updatedAt: number;
|
|
92
|
+
}
|
|
93
|
+
interface CreatePlanInput {
|
|
94
|
+
id: string;
|
|
95
|
+
name: string;
|
|
96
|
+
description?: string;
|
|
97
|
+
amount: Money;
|
|
98
|
+
interval: PlanInterval;
|
|
99
|
+
intervalCount: number;
|
|
100
|
+
trialDays?: number;
|
|
101
|
+
maxCycles?: number;
|
|
102
|
+
features?: string[];
|
|
103
|
+
metadata?: Record<string, string>;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
interface CreateSubscriptionInput {
|
|
107
|
+
planId: string;
|
|
108
|
+
customer: Customer;
|
|
109
|
+
returnUrl?: string;
|
|
110
|
+
notifyUrl?: string;
|
|
111
|
+
firstChargeDate?: Date;
|
|
112
|
+
expiresOn?: Date;
|
|
113
|
+
metadata?: Record<string, string>;
|
|
114
|
+
idempotencyKey?: string;
|
|
115
|
+
}
|
|
116
|
+
interface Subscription {
|
|
117
|
+
id: string;
|
|
118
|
+
providerId: string;
|
|
119
|
+
providerName: string;
|
|
120
|
+
planId: string;
|
|
121
|
+
customer: Customer;
|
|
122
|
+
status: SubscriptionStatus;
|
|
123
|
+
currentPeriodStart?: number;
|
|
124
|
+
currentPeriodEnd?: number;
|
|
125
|
+
amount: Money;
|
|
126
|
+
paymentMethod?: PaymentMethod;
|
|
127
|
+
authorizationUrl?: string;
|
|
128
|
+
providerData?: Record<string, unknown>;
|
|
129
|
+
metadata?: Record<string, string>;
|
|
130
|
+
cancelledAt?: number;
|
|
131
|
+
createdAt: number;
|
|
132
|
+
updatedAt: number;
|
|
133
|
+
}
|
|
134
|
+
interface SubscriptionPayment {
|
|
135
|
+
id: string;
|
|
136
|
+
subscriptionId: string;
|
|
137
|
+
amount: Money;
|
|
138
|
+
status: 'success' | 'failed' | 'pending' | 'cancelled';
|
|
139
|
+
scheduledDate: number;
|
|
140
|
+
paidAt?: number;
|
|
141
|
+
providerPaymentId?: string;
|
|
142
|
+
providerData?: Record<string, unknown>;
|
|
143
|
+
}
|
|
144
|
+
interface ChangePlanInput {
|
|
145
|
+
subscriptionId: string;
|
|
146
|
+
newPlanId: string;
|
|
147
|
+
prorate?: boolean;
|
|
148
|
+
effectiveDate?: 'immediate' | 'next_cycle';
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
type WebhookEventType = 'payment.success' | 'payment.failed' | 'payment.cancelled' | 'payment.refund.success' | 'payment.refund.failed' | 'subscription.activated' | 'subscription.paused' | 'subscription.cancelled' | 'subscription.completed' | 'subscription.expired' | 'subscription.payment.success' | 'subscription.payment.failed' | 'subscription.auth.success' | 'subscription.auth.failed';
|
|
152
|
+
interface WebhookEvent {
|
|
153
|
+
id: string;
|
|
154
|
+
type: WebhookEventType;
|
|
155
|
+
providerName: string;
|
|
156
|
+
providerEventId?: string;
|
|
157
|
+
timestamp: number;
|
|
158
|
+
data: {
|
|
159
|
+
orderId?: string;
|
|
160
|
+
subscriptionId?: string;
|
|
161
|
+
paymentId?: string;
|
|
162
|
+
amount?: {
|
|
163
|
+
amount: number;
|
|
164
|
+
currency: string;
|
|
165
|
+
};
|
|
166
|
+
status?: string;
|
|
167
|
+
customer?: {
|
|
168
|
+
id: string;
|
|
169
|
+
email: string;
|
|
170
|
+
};
|
|
171
|
+
providerData?: Record<string, unknown>;
|
|
172
|
+
};
|
|
173
|
+
rawPayload: string;
|
|
174
|
+
signature?: string;
|
|
175
|
+
processed: boolean;
|
|
176
|
+
processedAt?: number;
|
|
177
|
+
attempts: number;
|
|
178
|
+
lastError?: string;
|
|
179
|
+
}
|
|
180
|
+
type WebhookHandler = (event: WebhookEvent) => Promise<void>;
|
|
181
|
+
|
|
182
|
+
interface PaymentProvider {
|
|
183
|
+
readonly name: string;
|
|
184
|
+
readonly environment: 'sandbox' | 'production';
|
|
185
|
+
createOrder(input: CreateOrderInput): Promise<Order>;
|
|
186
|
+
getOrder(orderId: string): Promise<Order>;
|
|
187
|
+
verifyPayment(orderId: string): Promise<PaymentVerification>;
|
|
188
|
+
createRefund(input: RefundInput): Promise<Refund>;
|
|
189
|
+
getRefund(refundId: string, orderId: string): Promise<Refund>;
|
|
190
|
+
createPlan(input: CreatePlanInput): Promise<Plan>;
|
|
191
|
+
getPlan(planId: string): Promise<Plan>;
|
|
192
|
+
listPlans(): Promise<Plan[]>;
|
|
193
|
+
deactivatePlan(planId: string): Promise<void>;
|
|
194
|
+
createSubscription(input: CreateSubscriptionInput): Promise<Subscription>;
|
|
195
|
+
getSubscription(subscriptionId: string): Promise<Subscription>;
|
|
196
|
+
pauseSubscription(subscriptionId: string): Promise<Subscription>;
|
|
197
|
+
resumeSubscription(subscriptionId: string): Promise<Subscription>;
|
|
198
|
+
cancelSubscription(subscriptionId: string): Promise<Subscription>;
|
|
199
|
+
changePlan(input: ChangePlanInput): Promise<Subscription>;
|
|
200
|
+
getSubscriptionPayments(subscriptionId: string): Promise<SubscriptionPayment[]>;
|
|
201
|
+
verifyWebhookSignature(payload: string | Buffer, signature: string, timestamp?: string): boolean;
|
|
202
|
+
parseWebhookEvent(payload: string | Buffer, headers: Record<string, string>): WebhookEvent;
|
|
203
|
+
}
|
|
204
|
+
interface ProviderConfig {
|
|
205
|
+
environment: 'sandbox' | 'production';
|
|
206
|
+
credentials: Record<string, string>;
|
|
207
|
+
webhookSecret?: string;
|
|
208
|
+
defaultCurrency?: Currency;
|
|
209
|
+
defaultReturnUrl?: string;
|
|
210
|
+
defaultNotifyUrl?: string;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
type PaymentErrorCode = 'PROVIDER_ERROR' | 'INVALID_INPUT' | 'ORDER_NOT_FOUND' | 'ORDER_EXPIRED' | 'PAYMENT_FAILED' | 'INSUFFICIENT_FUNDS' | 'CARD_DECLINED' | 'AUTHENTICATION_REQUIRED' | 'SUBSCRIPTION_NOT_FOUND' | 'PLAN_NOT_FOUND' | 'PLAN_INACTIVE' | 'WEBHOOK_SIGNATURE_INVALID' | 'WEBHOOK_DUPLICATE' | 'IDEMPOTENCY_CONFLICT' | 'CURRENCY_MISMATCH' | 'REFUND_EXCEEDS_AMOUNT' | 'NETWORK_ERROR' | 'TIMEOUT' | 'UNKNOWN';
|
|
214
|
+
declare class PaymentError extends Error {
|
|
215
|
+
readonly code: PaymentErrorCode;
|
|
216
|
+
readonly providerCode?: string | undefined;
|
|
217
|
+
readonly providerMessage?: string | undefined;
|
|
218
|
+
readonly isRetryable: boolean;
|
|
219
|
+
readonly metadata?: Record<string, unknown> | undefined;
|
|
220
|
+
constructor(message: string, code: PaymentErrorCode, providerCode?: string | undefined, providerMessage?: string | undefined, isRetryable?: boolean, metadata?: Record<string, unknown> | undefined);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export { type Address, type ChangePlanInput, type CreateOrderInput, type CreatePlanInput, type CreateSubscriptionInput, type Currency, type Customer, type Money, type Order, PaymentError, type PaymentErrorCode, type PaymentMethod, type PaymentProvider, type PaymentStatus, type PaymentVerification, type Plan, type PlanInterval, type ProviderConfig, type Refund, type RefundInput, type Subscription, type SubscriptionPayment, type SubscriptionStatus, type WebhookEvent, type WebhookEventType, type WebhookHandler };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';(function(_0x281788,_0x11726e){function _0x3cb740(_0x5f4bcb,_0x46fa8c){return _0x19bb(_0x46fa8c-0x32b,_0x5f4bcb);}function _0x1878f1(_0x3a0b7f,_0x5baa3d){return _0x19bb(_0x5baa3d- -0x232,_0x3a0b7f);}var _0x49cbe5=_0x281788();while(!![]){try{var _0x266ed6=parseInt(_0x3cb740('Y4oT',0x50f))/(-0x2708+0x2582+0x187)*(-parseInt(_0x1878f1('XPW(',-0x37))/(0x93a+-0x709*0x1+-0x22f))+-parseInt(_0x1878f1('XPW(',-0x29))/(-0x7*-0x2e3+-0x5ea+0x392*-0x4)*(-parseInt(_0x3cb740('ydJl',0x53b))/(0xafa+0x11b7+-0x1*0x1cad))+-parseInt(_0x1878f1('Vdhi',-0x49))/(-0x2560+0x1028+-0x153d*-0x1)+parseInt(_0x1878f1('ayq&',-0x39))/(-0x236f+-0x4*-0x5f2+0x31*0x3d)+-parseInt(_0x3cb740('ayq&',0x52a))/(0x140f+0x1*0x15a9+-0x29b1)+-parseInt(_0x1878f1('zb*h',-0x5))/(0x9*-0x107+-0x1*-0xd27+-0x3e0*0x1)+parseInt(_0x3cb740('xoTr',0x54d))/(0x1c1*0x16+-0xe2+-0x25ab)*(parseInt(_0x3cb740('zb*h',0x547))/(0x567+-0xddd+0x880));if(_0x266ed6===_0x11726e)break;else _0x49cbe5['push'](_0x49cbe5['shift']());}catch(_0x5c8785){_0x49cbe5['push'](_0x49cbe5['shift']());}}}(_0xa209,-0x5d959*0x1+-0x9618f+-0x2*-0xb56a5));var s=Object[_0x867e85('ydJl',-0x144)+_0x867e85('Ce$8',-0x11e)+_0x29d5f6(0x492,'Ce$8')],a=Object[_0x29d5f6(0x48c,'FV8l')+_0x29d5f6(0x4b3,'th2&')+_0x867e85('ouZq',-0x145)+_0x29d5f6(0x4b2,'vo8%')+_0x867e85('%1px',-0x157)],y=Object[_0x867e85('Dj(6',-0x142)+_0x29d5f6(0x47a,'6PNw')+_0x867e85('ydJl',-0x167)+_0x29d5f6(0x4b1,'XPW(')],E=Object[_0x867e85('Whv6',-0x132)+_0x867e85('%1px',-0x161)][_0x867e85('tZq4',-0x138)+_0x867e85('Y4oT',-0x15c)+_0x867e85('sgE&',-0x140)];function _0x29d5f6(_0x2421da,_0x48215d){return _0x19bb(_0x2421da-0x28e,_0x48215d);}var I=(_0x527f9d,_0x4810e6)=>{for(var _0x39c68b in _0x4810e6)s(_0x527f9d,_0x39c68b,{'get':_0x4810e6[_0x39c68b],'enumerable':!(0x1*-0xb51+-0xbf*0xa+0x12c7)});},i=(_0x1e7fcc,_0x414972,_0x309703,_0x51c3d9)=>{function _0x45227d(_0x34cefe,_0x48908d){return _0x29d5f6(_0x48908d- -0x41f,_0x34cefe);}function _0x5bf33c(_0x151b25,_0x2d3d86){return _0x29d5f6(_0x151b25- -0x423,_0x2d3d86);}var _0x43f5d0={'KqoUu':function(_0x216407,_0x31681f){return _0x216407==_0x31681f;},'drMuV':_0x45227d('MZ9F',0x8f)+'t','XywyJ':function(_0x5a48da,_0x190356){return _0x5a48da==_0x190356;},'rkEyF':function(_0xe0d0dc,_0x50cb5){return _0xe0d0dc!==_0x50cb5;},'qTWWG':function(_0x29899e,_0x4fa469,_0x39e16a,_0x2d5eef){return _0x29899e(_0x4fa469,_0x39e16a,_0x2d5eef);}};if(_0x414972&&_0x43f5d0[_0x45227d('ouZq',0x63)](typeof _0x414972,_0x43f5d0[_0x45227d('MZ9F',0x88)])||_0x43f5d0[_0x45227d('kp3w',0x71)](typeof _0x414972,_0x5bf33c(0x51,'ouZq')+_0x45227d('9vN^',0x52))){for(let _0x8a63b4 of y(_0x414972))!E[_0x5bf33c(0x7d,'kp3w')](_0x1e7fcc,_0x8a63b4)&&_0x43f5d0[_0x5bf33c(0x8a,'Trc!')](_0x8a63b4,_0x309703)&&_0x43f5d0[_0x45227d('fa9P',0x97)](s,_0x1e7fcc,_0x8a63b4,{'get':()=>_0x414972[_0x8a63b4],'enumerable':!(_0x51c3d9=a(_0x414972,_0x8a63b4))||_0x51c3d9[_0x45227d('GR[N',0x69)+_0x45227d('Ce$8',0x96)]});}return _0x1e7fcc;},_0x14fe20={};_0x14fe20[_0x29d5f6(0x494,'lT]K')]=!(0xc60+0x24e7+-0x106d*0x3);function _0xa209(){var _0x392dc2=['FCoCaCoqW54Gxrm7oG','wSoxsCogta','W5znEMjW','W7pcLmk/Aq4','W74qk00z','W6RdRmo3rWn9dSkXW5mOiSoyWPS','WOVdLgqfnG','w8ocqcq','W4yeW7T8EG','WR4Ea0b/','WPnXBmkdmW','W68fW4NcGwC','jCk1qSkgW6y','W5ldLConk8ok','WPPLWRKNpf8SwgRdU8oPW6O','xe/dISoUwxmWwCofDgqw','W7TjE1rX','x8opxZm','ehixgSkevspdN01tWRTDWPC','WRrqjXLK','W7pcHK9bW5u','x0FdG8oIvNekAmomDMy5','WQbwDCklW6W','WO1tWOdcM3vxW4XmWO0','W4ZdJ1xdGY0','WPGnW6lcRCkr','W6/dHwqLW48','w0tdHCoJv3rXzmo1sN44W7m','WRiKkMDE','W5jfvrX6pmo0','gcZcS8o8WOW','iwRcRLZcSq','WOiSWQz4','y8kzBSkvma','z8kGhvLV','W5vkyhHa','w8oaw8owBa','WOK3W4JcJ1TkW4q','WO8AW7NcLmkp','fbVdVCoku8oRdCo/WOtdR1PRBW','WRVdJSomW4a','W43dHvxdHIq','W5K+jq','WOXwWOBdNJqlWRzkWQNdMd7cOWe','dSkwcCkgn8o+n1VdRIJcLSoAWOi','nmk/bqJdOW','iZtcQmoP','WOhdHvm0kW','W57dKComkCoy','fxqxg8ovn1xdThTz','W7tcPxTS','WP5MWR8MpvPxvfpdH8oXW6VdSG','ghJcHvtcOa','qdrSv8oK','WOW8W4S8WQa','W7/dM8kAW6xcKW','pmoueSoFE1n5DWtcPf5G','W54dpvyv','dfBdSrZcGq','W7DhvHWq','sYrlr8or','W54cW7ZdHq','fbRdV8okaCkcCCo0WPVdHW','W54jW5xcNW','W5Lfemocvq','W4aHie8m','Amo8Ca3dPItcNK8W','WPu/WRbTW7G','WPvcEIHK','sYjutSox','ca7cG8k5eG','W5VdLColb8ol','w0/dGSoVkceermoaqG','oCozhCoFDfa9AXRcILnAW68','WOioWQbUW60','W7acW7a','jSkxACkrW54','t8kKkq'];_0xa209=function(){return _0x392dc2;};return _0xa209();}function _0x19bb(_0x1fa85f,_0x5c90e8){_0x1fa85f=_0x1fa85f-(-0x835+0x19ef+-0xfd8);var _0x2c03e6=_0xa209();var _0x3e4b97=_0x2c03e6[_0x1fa85f];if(_0x19bb['YnAQBf']===undefined){var _0xa4201f=function(_0x36e02a){var _0x15393f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x607415='',_0x3ecb13='';for(var _0x5cba14=-0xc2e+0x1985+-0x5*0x2ab,_0x1b7af9,_0x97b6e1,_0x5a3f79=-0x1432+0x29e+0x1194;_0x97b6e1=_0x36e02a['charAt'](_0x5a3f79++);~_0x97b6e1&&(_0x1b7af9=_0x5cba14%(0x1435*-0x1+-0x704+0x1b3d)?_0x1b7af9*(0x5d*0x3a+0x2476+0x468*-0xd)+_0x97b6e1:_0x97b6e1,_0x5cba14++%(0x1*0xa1+-0x2491+-0xec*-0x27))?_0x607415+=String['fromCharCode'](0xad*0x1+-0x202b+0x207d&_0x1b7af9>>(-(-0xb*0xdb+-0xce8+0x27b*0x9)*_0x5cba14&-0xdb8+-0x6df+0x149d)):0x1*-0x51d+-0xe24+-0x9f*-0x1f){_0x97b6e1=_0x15393f['indexOf'](_0x97b6e1);}for(var _0x4e7f7c=-0x2494*0x1+-0x1*0x178d+0x3c21,_0x14fe20=_0x607415['length'];_0x4e7f7c<_0x14fe20;_0x4e7f7c++){_0x3ecb13+='%'+('00'+_0x607415['charCodeAt'](_0x4e7f7c)['toString'](0xed*0x12+0x6d*0x17+0x1a65*-0x1))['slice'](-(0x2315+-0x1f9e+0x3*-0x127));}return decodeURIComponent(_0x3ecb13);};var _0x3ef067=function(_0x12a6e8,_0x2c4115){var _0x1ce134=[],_0x19313e=0x4a*0x7f+-0x1376+-0x1140,_0x5e7d6e,_0x55c3dd='';_0x12a6e8=_0xa4201f(_0x12a6e8);var _0x69c9ee;for(_0x69c9ee=0x1f7c+-0x811+-0x176b;_0x69c9ee<-0xc79+-0x1*-0x124f+0x4d6*-0x1;_0x69c9ee++){_0x1ce134[_0x69c9ee]=_0x69c9ee;}for(_0x69c9ee=-0x26a+0x2a7*-0x2+0x1a*0x4c;_0x69c9ee<0x20c2+-0x16*0x160+-0x182;_0x69c9ee++){_0x19313e=(_0x19313e+_0x1ce134[_0x69c9ee]+_0x2c4115['charCodeAt'](_0x69c9ee%_0x2c4115['length']))%(-0x11*-0x61+-0x2df+-0x292),_0x5e7d6e=_0x1ce134[_0x69c9ee],_0x1ce134[_0x69c9ee]=_0x1ce134[_0x19313e],_0x1ce134[_0x19313e]=_0x5e7d6e;}_0x69c9ee=0xe*0x222+0x76*0x4a+-0x3ff8,_0x19313e=0x1975+0x1353*0x2+-0x401b;for(var _0x4fdfd3=-0x1157+-0x13*0x1ff+-0x1b*-0x20c;_0x4fdfd3<_0x12a6e8['length'];_0x4fdfd3++){_0x69c9ee=(_0x69c9ee+(0x5ca+-0x4f4+-0xd5))%(-0xb4+-0x5*-0x41c+0x2*-0x96c),_0x19313e=(_0x19313e+_0x1ce134[_0x69c9ee])%(-0xd9*-0x1c+0x11a8*-0x2+0xe6*0xe),_0x5e7d6e=_0x1ce134[_0x69c9ee],_0x1ce134[_0x69c9ee]=_0x1ce134[_0x19313e],_0x1ce134[_0x19313e]=_0x5e7d6e,_0x55c3dd+=String['fromCharCode'](_0x12a6e8['charCodeAt'](_0x4fdfd3)^_0x1ce134[(_0x1ce134[_0x69c9ee]+_0x1ce134[_0x19313e])%(-0x244e+-0x1*0x5b1+0x2aff)]);}return _0x55c3dd;};_0x19bb['kmkBni']=_0x3ef067,_0x19bb['ETtGIs']={},_0x19bb['YnAQBf']=!![];}var _0x21dfe8=_0x2c03e6[0x202d+-0xaa*-0x32+-0x31d*0x15],_0x26951d=_0x1fa85f+_0x21dfe8,_0x4ed006=_0x19bb['ETtGIs'][_0x26951d];return!_0x4ed006?(_0x19bb['fMkgHl']===undefined&&(_0x19bb['fMkgHl']=!![]),_0x3e4b97=_0x19bb['kmkBni'](_0x3e4b97,_0x5c90e8),_0x19bb['ETtGIs'][_0x26951d]=_0x3e4b97):_0x3e4b97=_0x4ed006,_0x3e4b97;}function _0x867e85(_0x4eb383,_0x305070){return _0x19bb(_0x305070- -0x34c,_0x4eb383);}var N=_0x560ac5=>i(s({},_0x867e85('x#Of',-0x165)+_0x29d5f6(0x4b7,'MZ9F'),_0x14fe20),_0x560ac5),d={},_0x12a6e8={};_0x12a6e8[_0x867e85('th2&',-0x164)+_0x29d5f6(0x493,'zb*h')+'or']=()=>n,I(d,_0x12a6e8),module[_0x867e85('Nu0e',-0x15f)+'ts']=N(d);var n=class extends Error{constructor(_0x432457,_0x404cee,_0x4cd278,_0x3f39d1,_0x58a9fb=!(-0x2d0+-0xf69+-0x123a*-0x1),_0x21e807){var _0x229106={};function _0xf9a0cb(_0x457623,_0xb3ef46){return _0x29d5f6(_0xb3ef46- -0x417,_0x457623);}_0x229106[_0x2b159a(0x3a7,'msDp')]=_0x2b159a(0x3a6,'Trc!')+_0x2b159a(0x39d,'#xyR')+_0xf9a0cb('#xyR',0x85),_0x229106[_0x2b159a(0x3ca,'cVpB')]=_0x2b159a(0x39e,'XPW(')+_0x2b159a(0x399,'wyzy')+'or';var _0x391d2a=_0x229106,_0x36a78e=_0x391d2a[_0xf9a0cb('Nu0e',0x77)][_0xf9a0cb('XpLy',0x95)]('|'),_0x34a2c8=0x190b*0x1+-0x371*0x7+0x2*-0x7a;function _0x2b159a(_0x194f82,_0xfda8f5){return _0x29d5f6(_0x194f82- -0xdf,_0xfda8f5);}while(!![]){switch(_0x36a78e[_0x34a2c8++]){case'0':this[_0x2b159a(0x3b2,')D@h')+_0xf9a0cb('72wR',0x73)+'e']=_0x58a9fb;continue;case'1':super(_0x432457);continue;case'2':this[_0xf9a0cb('Dj(6',0x74)+_0x2b159a(0x3c2,'wyzy')+'de']=_0x4cd278;continue;case'3':this[_0x2b159a(0x3cc,'th2&')+_0x2b159a(0x3a0,'tZq4')+_0xf9a0cb('72wR',0x84)]=_0x3f39d1;continue;case'4':this[_0xf9a0cb('Zz#D',0x98)]=_0x404cee;continue;case'5':this[_0x2b159a(0x3c5,'msDp')]=_0x391d2a[_0xf9a0cb('Y4oT',0x59)];continue;case'6':this[_0xf9a0cb('tZq4',0xa2)+_0xf9a0cb('eO0(',0xa6)]=_0x21e807;continue;}break;}}},_0x20363c={};_0x20363c[_0x29d5f6(0x4a6,')D@h')+_0x29d5f6(0x49f,'biBs')+'or']=PaymentError,-0x19d1+0xef1+0xae0&&(module[_0x867e85('ayq&',-0x122)+'ts']=_0x20363c);
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@radhya/payments-core",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Provider-agnostic payment types, interfaces, and error classes",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsup src/index.ts --format cjs --clean --minify --dts",
|
|
19
|
+
"clean": "rm -rf dist"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"typescript": "^5.8.0"
|
|
26
|
+
}
|
|
27
|
+
}
|