@monkeyplus/payscope 1.0.0
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/THIRD-PARTY-LICENSES.md +41 -0
- package/dist/_chunks/auth.d.mts +707 -0
- package/dist/_chunks/database.mjs +831 -0
- package/dist/_chunks/db.d.mts +7100 -0
- package/dist/_chunks/index.d.mts +178 -0
- package/dist/_chunks/lib.mjs +3073 -0
- package/dist/_chunks/libs/better-call.d.mts +478 -0
- package/dist/_chunks/libs/postgres.d.mts +1 -0
- package/dist/_chunks/rolldown-runtime.mjs +11 -0
- package/dist/server/db.d.mts +2 -0
- package/dist/server/db.mjs +108 -0
- package/dist/server/env.d.mts +21 -0
- package/dist/server/env.mjs +22 -0
- package/dist/server/lib.d.mts +362 -0
- package/dist/server/lib.mjs +2 -0
- package/dist/server/router.d.mts +1218 -0
- package/dist/server/router.mjs +1157 -0
- package/dist/server/schemas/auth.d.mts +2 -0
- package/dist/server/schemas/auth.mjs +62 -0
- package/package.json +58 -0
- package/storefront/Readme.md +0 -0
- package/storefront/auth.ts +29 -0
- package/storefront/cart/ResumeCart.vue +217 -0
- package/storefront/cart/ResumeCartSelect.vue +32 -0
- package/storefront/cart/ShoppinCart.vue +100 -0
- package/storefront/cart/ShoppinCartItem.vue +99 -0
- package/storefront/checkout/App.vue +36 -0
- package/storefront/checkout/AppCart.vue +72 -0
- package/storefront/checkout/AppCartDiscount.vue +74 -0
- package/storefront/checkout/AppCartTotals.vue +72 -0
- package/storefront/checkout/AppLoading.vue +55 -0
- package/storefront/checkout/composables.ts +28 -0
- package/storefront/checkout/constants.ts +0 -0
- package/storefront/checkout/main.ts +11 -0
- package/storefront/checkout/pages/Address/Address.vue +95 -0
- package/storefront/checkout/pages/Info/Info.vue +94 -0
- package/storefront/checkout/pages/Info/InfoUser.vue +38 -0
- package/storefront/checkout/pages/Pay/Pay.vue +115 -0
- package/storefront/checkout/pages/Pay/Providers/BancoEconomico/BancoEconomico.vue +9 -0
- package/storefront/checkout/pages/Pay/Providers/Cybersource/Cybersource.vue +9 -0
- package/storefront/checkout/pages/Pay/Providers/Datafast/Datafast.vue +9 -0
- package/storefront/checkout/pages/Pay/Providers/Multipago/Multipago.vue +9 -0
- package/storefront/checkout/pages/Pay/Providers/Pagomedios/Pagomedios.vue +93 -0
- package/storefront/checkout/pages/Pay/Providers/Pagomedios/composable.ts +23 -0
- package/storefront/checkout/pages/Pay/Providers/Paypal/Paypal.vue +168 -0
- package/storefront/checkout/pages/Pay/Providers/Paypal/composable.ts +33 -0
- package/storefront/checkout/pages/Pay/Providers/Placetopay/Placetopay.vue +9 -0
- package/storefront/checkout/pages/Pay/Providers/Wabi/Wabi.vue +9 -0
- package/storefront/checkout/pages/Pay/Providers/composable.ts +30 -0
- package/storefront/checkout/pages/Payment/Payment.vue +19 -0
- package/storefront/checkout/pages/Payment/PaymentStatus.vue +187 -0
- package/storefront/checkout/pages/Payment/PaymentStatusDetail.vue +77 -0
- package/storefront/checkout/pages/Payment/composable.ts +81 -0
- package/storefront/checkout/pages/Shipping/Shipping.vue +67 -0
- package/storefront/checkout/pages/StepInfo.vue +37 -0
- package/storefront/checkout/router.ts +59 -0
- package/storefront/index.ts +3 -0
- package/storefront/login/App.vue +9 -0
- package/storefront/login/main.ts +10 -0
- package/storefront/login/pages/SignIn/Login.vue +82 -0
- package/storefront/login/pages/SignUp/SignUp.vue +99 -0
- package/storefront/login/router.ts +15 -0
- package/storefront/product/AddProduct.vue +303 -0
- package/storefront/product/AddProductNumber.vue +62 -0
- package/storefront/product/AddProductVariant.vue +66 -0
- package/storefront/profile/App.vue +88 -0
- package/storefront/profile/main.ts +10 -0
- package/storefront/profile/pages/Addresses/Addresses.vue +79 -0
- package/storefront/profile/pages/Addresses/AddressesForm.vue +95 -0
- package/storefront/profile/pages/Addresses/AddressesModal.vue +24 -0
- package/storefront/profile/pages/Buys/Buys.vue +8 -0
- package/storefront/profile/pages/Me/Me.vue +15 -0
- package/storefront/profile/pages/Me/MeBilling.vue +79 -0
- package/storefront/profile/pages/Me/MeBillingForm.vue +66 -0
- package/storefront/profile/pages/Me/MeBillingModal.vue +24 -0
- package/storefront/profile/pages/Me/MeInfo.vue +75 -0
- package/storefront/profile/pages/Me/MePassword.vue +53 -0
- package/storefront/profile/pages/Me/MeSubscriptions.vue +15 -0
- package/storefront/profile/pages/Returns/Returns.vue +8 -0
- package/storefront/profile/pages/Whislist/Whislist.vue +8 -0
- package/storefront/profile/router.ts +32 -0
- package/storefront/stores.ts +320 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { Connector, Database } from "../_chunks/db.mjs";
|
|
2
|
+
import { CreatePayment, Graphql, UseTasks } from "../_chunks/index.mjs";
|
|
3
|
+
interface CustomErrorOptions {
|
|
4
|
+
message: string;
|
|
5
|
+
/**
|
|
6
|
+
* Codigo de error HTTP
|
|
7
|
+
*/
|
|
8
|
+
statusCode?: number;
|
|
9
|
+
}
|
|
10
|
+
declare class CustomError extends Error {
|
|
11
|
+
httpStatusCode: number;
|
|
12
|
+
date: Date;
|
|
13
|
+
constructor({
|
|
14
|
+
message,
|
|
15
|
+
statusCode
|
|
16
|
+
}: CustomErrorOptions);
|
|
17
|
+
}
|
|
18
|
+
interface OptionsUseTask {
|
|
19
|
+
endpoint: string;
|
|
20
|
+
headers?: any;
|
|
21
|
+
}
|
|
22
|
+
declare function useTasks({
|
|
23
|
+
endpoint,
|
|
24
|
+
headers
|
|
25
|
+
}: OptionsUseTask): UseTasks;
|
|
26
|
+
declare const createPayment: CreatePayment;
|
|
27
|
+
type BancoGanaderoConnector$1 = Connector<{
|
|
28
|
+
endpoint: string;
|
|
29
|
+
aesKey: string;
|
|
30
|
+
accountCredit: string;
|
|
31
|
+
branchCode: string;
|
|
32
|
+
credentials: {
|
|
33
|
+
userName: string;
|
|
34
|
+
password: string;
|
|
35
|
+
};
|
|
36
|
+
}>;
|
|
37
|
+
declare const createBancoEconomico: BancoGanaderoConnector$1;
|
|
38
|
+
type BancoGanaderoConnector = Connector<{
|
|
39
|
+
endpoint: string;
|
|
40
|
+
apiKey: string;
|
|
41
|
+
credentials: {
|
|
42
|
+
userName: string;
|
|
43
|
+
password: string;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
declare const createBancoGanadero: BancoGanaderoConnector;
|
|
47
|
+
type CybersourceConnector = Connector<{
|
|
48
|
+
hostEndpoint: string;
|
|
49
|
+
keyId: string;
|
|
50
|
+
secretkey: string;
|
|
51
|
+
merchantId: string;
|
|
52
|
+
}>;
|
|
53
|
+
declare const createCybersource: CybersourceConnector;
|
|
54
|
+
interface DatafastCredentials {
|
|
55
|
+
currency: string;
|
|
56
|
+
endpoint: string;
|
|
57
|
+
entityId: string;
|
|
58
|
+
ecommerceId: string;
|
|
59
|
+
providerId: string;
|
|
60
|
+
paymentType: string;
|
|
61
|
+
fase: number;
|
|
62
|
+
mid: string;
|
|
63
|
+
tid: string;
|
|
64
|
+
token: string;
|
|
65
|
+
nameEcommerce: string;
|
|
66
|
+
codeIva: string;
|
|
67
|
+
}
|
|
68
|
+
type DatafastConnector = Connector<{
|
|
69
|
+
urlSite: string;
|
|
70
|
+
mode: 'development' | 'staging' | 'production';
|
|
71
|
+
credentials: DatafastCredentials;
|
|
72
|
+
}, any>;
|
|
73
|
+
declare const createDatafast: DatafastConnector;
|
|
74
|
+
interface MultipagoCredentials {
|
|
75
|
+
endpoint: string;
|
|
76
|
+
provider: string;
|
|
77
|
+
uid: string;
|
|
78
|
+
}
|
|
79
|
+
interface OptionsMultipago {
|
|
80
|
+
credentials: MultipagoCredentials;
|
|
81
|
+
serviceCode: string;
|
|
82
|
+
urlReturn: string;
|
|
83
|
+
mode: 'staging' | 'production';
|
|
84
|
+
}
|
|
85
|
+
type MultipagoConnector = Connector<OptionsMultipago>;
|
|
86
|
+
declare const createMultipagos: MultipagoConnector;
|
|
87
|
+
interface PagomediosCredentials {
|
|
88
|
+
endpoint: string;
|
|
89
|
+
token: string;
|
|
90
|
+
}
|
|
91
|
+
interface OptionsPagomedios {
|
|
92
|
+
credentials: PagomediosCredentials;
|
|
93
|
+
serviceCode: string;
|
|
94
|
+
urlReturn: string;
|
|
95
|
+
mode: 'staging' | 'production';
|
|
96
|
+
nameEcommerce?: string;
|
|
97
|
+
}
|
|
98
|
+
type PagomediosConnector = Connector<OptionsPagomedios>;
|
|
99
|
+
declare const createPagomedios: PagomediosConnector;
|
|
100
|
+
declare namespace Debit {
|
|
101
|
+
interface Order {
|
|
102
|
+
/**
|
|
103
|
+
* Amount to debit. Format: Decimal with two fraction digits.
|
|
104
|
+
*/
|
|
105
|
+
amount: number | string;
|
|
106
|
+
/**
|
|
107
|
+
* Description of the order to be purchase. Format: (Maximum Length 250)
|
|
108
|
+
*/
|
|
109
|
+
description: string;
|
|
110
|
+
/**
|
|
111
|
+
* Merchant order reference. You will identify this purchase using this reference.
|
|
112
|
+
*/
|
|
113
|
+
dev_reference: string;
|
|
114
|
+
/**
|
|
115
|
+
* Sales tax amount, included in product cost. Format: Decimal with two fraction digits.
|
|
116
|
+
*/
|
|
117
|
+
vat: number | string;
|
|
118
|
+
/**
|
|
119
|
+
* The number of installments for the payment, only for COP, MXN, BRL, PEN, CLP and USD (Ecuador).
|
|
120
|
+
*/
|
|
121
|
+
installments?: number;
|
|
122
|
+
/**
|
|
123
|
+
* Only available for Ecuador and Mexico. See the [valid values](https://paymentez.github.io/api-doc/#payment-methods-cards-debit-with-token-base-case-installments-type)
|
|
124
|
+
*/
|
|
125
|
+
installments_type?: number;
|
|
126
|
+
/**
|
|
127
|
+
* Only available for Ecuador. The taxable amount is the total amount of all taxable items excluding tax. If not sent, it's calculated on the total. Format: Decimal with two fraction digits.
|
|
128
|
+
*/
|
|
129
|
+
taxable_amount?: number | string;
|
|
130
|
+
/**
|
|
131
|
+
* Only available for Ecuador. The tax rate to be applied to this order. Should be 0 or 12.
|
|
132
|
+
*/
|
|
133
|
+
tax_percentage?: number | string;
|
|
134
|
+
/**
|
|
135
|
+
*Only available for Mexico, the number of months of grace for a deferred payment.
|
|
136
|
+
*/
|
|
137
|
+
months_grace?: number | string;
|
|
138
|
+
/**
|
|
139
|
+
* Only available for Tuya Cards ('ex', ak'). The tip. Format: Decimal with two fraction digits.
|
|
140
|
+
*/
|
|
141
|
+
tip?: number | string;
|
|
142
|
+
}
|
|
143
|
+
interface User {
|
|
144
|
+
/**
|
|
145
|
+
* Customer identifier. This is the identifier you use inside your application.
|
|
146
|
+
*/
|
|
147
|
+
id: string;
|
|
148
|
+
/**
|
|
149
|
+
* Buyer email, with valid e-mail format.
|
|
150
|
+
*/
|
|
151
|
+
email: string;
|
|
152
|
+
/**
|
|
153
|
+
* Buyer phone.
|
|
154
|
+
*/
|
|
155
|
+
phone?: string;
|
|
156
|
+
/**
|
|
157
|
+
* User IP address. Valid v4 IP address.
|
|
158
|
+
*/
|
|
159
|
+
ip_address: string;
|
|
160
|
+
/**
|
|
161
|
+
* The fiscal number given by the buyer Note: For card types ex, ak, vr, sx, ol, ep and cd this field is mandatory.
|
|
162
|
+
*/
|
|
163
|
+
fiscal_number?: string;
|
|
164
|
+
}
|
|
165
|
+
interface Card {
|
|
166
|
+
/**
|
|
167
|
+
* Card Identifier. This code is unique among all cards. Format: Long Integer.
|
|
168
|
+
*/
|
|
169
|
+
token: string;
|
|
170
|
+
/**
|
|
171
|
+
* The credit card security number.
|
|
172
|
+
*/
|
|
173
|
+
cvc?: string;
|
|
174
|
+
}
|
|
175
|
+
interface Wallet {
|
|
176
|
+
/**
|
|
177
|
+
* Type of wallet, the valid are : 'VisaCheckout', 'Masterpass' and 'CyberSource'.
|
|
178
|
+
*/
|
|
179
|
+
type?: string;
|
|
180
|
+
/**
|
|
181
|
+
* The id of the wallet (either callid, transactionId or subscriptionID ).
|
|
182
|
+
*/
|
|
183
|
+
key?: string;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
interface BodyDebitWithToken {
|
|
187
|
+
/**
|
|
188
|
+
* Fraud related parameter. 32-length numeric hash.
|
|
189
|
+
*/
|
|
190
|
+
session_id?: string;
|
|
191
|
+
order: Debit.Order;
|
|
192
|
+
user: Debit.User;
|
|
193
|
+
card: Debit.Card;
|
|
194
|
+
wallet?: Debit.Wallet;
|
|
195
|
+
/**
|
|
196
|
+
* Optional params [(3DS 2 objects included)](https://paymentez.github.io/api-doc/#payment-methods-cards-debit-with-token-base-case-objects-for-authentication) used for some commerce in Json format. Please contact your commercial executive for more details.
|
|
197
|
+
*/
|
|
198
|
+
extra_params?: Record<string, unknown>;
|
|
199
|
+
/**
|
|
200
|
+
* Object with the shipping address, see the [specification of address](https://paymentez.github.io/api-doc/#payment-methods-cards-debit-with-token-base-case-address).
|
|
201
|
+
*/
|
|
202
|
+
shipping_address?: Record<string, unknown>;
|
|
203
|
+
}
|
|
204
|
+
interface Transaction {
|
|
205
|
+
/**
|
|
206
|
+
* Could be success, failure or pending.
|
|
207
|
+
*/
|
|
208
|
+
status: 'success' | 'failure' | 'pending';
|
|
209
|
+
payment_date: string;
|
|
210
|
+
amount: number;
|
|
211
|
+
authorization_code: string;
|
|
212
|
+
installments: number;
|
|
213
|
+
dev_reference: string;
|
|
214
|
+
message: unknown;
|
|
215
|
+
carrier_code?: string;
|
|
216
|
+
/**
|
|
217
|
+
* Reference of transaction
|
|
218
|
+
*/
|
|
219
|
+
id: string;
|
|
220
|
+
/**
|
|
221
|
+
* The status detail of the transaction, for more information [status detail](https://paymentez.github.io/api-doc/#status-details)
|
|
222
|
+
*/
|
|
223
|
+
status_detail: number;
|
|
224
|
+
}
|
|
225
|
+
interface Card {
|
|
226
|
+
bin: string;
|
|
227
|
+
status: string;
|
|
228
|
+
token: string;
|
|
229
|
+
holder_name: string;
|
|
230
|
+
expiry_year: string;
|
|
231
|
+
expiry_month: string;
|
|
232
|
+
transaction_reference: string;
|
|
233
|
+
type: string;
|
|
234
|
+
number: string;
|
|
235
|
+
origin: string;
|
|
236
|
+
}
|
|
237
|
+
interface User {
|
|
238
|
+
/**
|
|
239
|
+
* Customer identifier. This is the identifier you use inside your application.
|
|
240
|
+
*/
|
|
241
|
+
id: string;
|
|
242
|
+
/**
|
|
243
|
+
* Buyer email, with valid e-mail format.
|
|
244
|
+
*/
|
|
245
|
+
email: string;
|
|
246
|
+
}
|
|
247
|
+
type GetAllCards = (uid: string) => Promise<{
|
|
248
|
+
cards: Card[];
|
|
249
|
+
}>;
|
|
250
|
+
type DeleteCard = (body: {
|
|
251
|
+
card: Pick<Card, 'token'>;
|
|
252
|
+
user: Pick<User, 'email'>;
|
|
253
|
+
}) => Promise<{
|
|
254
|
+
message: string;
|
|
255
|
+
}>;
|
|
256
|
+
type DebitWithToken = (body: BodyDebitWithToken) => Promise<{
|
|
257
|
+
transaction: Transaction;
|
|
258
|
+
}>;
|
|
259
|
+
interface VerifyBody {
|
|
260
|
+
user: Pick<User, 'id'>;
|
|
261
|
+
transaction: Pick<Transaction, 'id'>;
|
|
262
|
+
/**
|
|
263
|
+
* The type of value that is going to be sent in the request. Valid strings
|
|
264
|
+
*/
|
|
265
|
+
type: 'BY_AMOUNT' | 'BY_AUTH_CODE' | 'BY_OTP' | 'BY_CRES' | 'AUTHENTICATION_CONTINUE';
|
|
266
|
+
/**
|
|
267
|
+
* true or false to determine if the response will include more info about the transaction.
|
|
268
|
+
*/
|
|
269
|
+
more_info: boolean;
|
|
270
|
+
}
|
|
271
|
+
interface Verify {
|
|
272
|
+
(body: VerifyBody, moreInfo?: false): Promise<{
|
|
273
|
+
status: number;
|
|
274
|
+
}>;
|
|
275
|
+
(body: VerifyBody, moreInfo: true): Promise<{
|
|
276
|
+
transaction: Transaction;
|
|
277
|
+
}>;
|
|
278
|
+
}
|
|
279
|
+
interface RefundBody {
|
|
280
|
+
transaction: Pick<Transaction, 'id'>;
|
|
281
|
+
}
|
|
282
|
+
interface Refund {
|
|
283
|
+
(body: RefundBody, moreInfo?: false): Promise<{
|
|
284
|
+
status: number;
|
|
285
|
+
}>;
|
|
286
|
+
(body: RefundBody, moreInfo: true): Promise<{
|
|
287
|
+
transaction: Pick<Transaction, 'id'>;
|
|
288
|
+
}>;
|
|
289
|
+
}
|
|
290
|
+
type TranspactionInfo = (id: string) => Promise<{
|
|
291
|
+
transaction: Transaction;
|
|
292
|
+
}>;
|
|
293
|
+
interface Methods {
|
|
294
|
+
getAllCards: GetAllCards;
|
|
295
|
+
deleteCard: DeleteCard;
|
|
296
|
+
debitWithToken: DebitWithToken;
|
|
297
|
+
verify: Verify;
|
|
298
|
+
refund: Refund;
|
|
299
|
+
transactionInfo: TranspactionInfo;
|
|
300
|
+
}
|
|
301
|
+
declare namespace Pmz {
|
|
302
|
+
interface Credentials {
|
|
303
|
+
code: string;
|
|
304
|
+
key: string;
|
|
305
|
+
}
|
|
306
|
+
interface AllMethods extends Methods {}
|
|
307
|
+
}
|
|
308
|
+
interface OptionsPmz {
|
|
309
|
+
credentials: Pmz.Credentials;
|
|
310
|
+
mode: 'development' | 'staging' | 'production';
|
|
311
|
+
}
|
|
312
|
+
type PmzConnector = Connector<OptionsPmz, Pmz.AllMethods>;
|
|
313
|
+
declare const createPaymentez: PmzConnector;
|
|
314
|
+
interface PayPalCredentials {
|
|
315
|
+
clientId: string;
|
|
316
|
+
clientSecret: string;
|
|
317
|
+
}
|
|
318
|
+
interface OptionsPayPal {
|
|
319
|
+
credentials: PayPalCredentials;
|
|
320
|
+
mode: 'development' | 'staging' | 'production';
|
|
321
|
+
}
|
|
322
|
+
interface PayPalMethods {
|
|
323
|
+
getAccessToken: () => Promise<string>;
|
|
324
|
+
createOrder: (body: any) => Promise<any>;
|
|
325
|
+
captureOrder: (orderId: string, body?: any) => Promise<any>;
|
|
326
|
+
getOrder: (orderId: string) => Promise<any>;
|
|
327
|
+
getCapture: (captureId: string) => Promise<any>;
|
|
328
|
+
refundCapture: (captureId: string, body?: any) => Promise<any>;
|
|
329
|
+
}
|
|
330
|
+
type PayPalConnector = Connector<OptionsPayPal, PayPalMethods>;
|
|
331
|
+
declare const createPayPal: PayPalConnector;
|
|
332
|
+
interface PtpCredentials {
|
|
333
|
+
secretKey: string;
|
|
334
|
+
login: string;
|
|
335
|
+
}
|
|
336
|
+
interface OptionsPtp {
|
|
337
|
+
credentials: PtpCredentials;
|
|
338
|
+
endpoint: string;
|
|
339
|
+
urlReturn: string;
|
|
340
|
+
sessionExpiration?: number;
|
|
341
|
+
mode: 'development' | 'staging' | 'production';
|
|
342
|
+
}
|
|
343
|
+
type PtpConnector = Connector<OptionsPtp>;
|
|
344
|
+
declare const createPlaceToPay: PtpConnector;
|
|
345
|
+
type TransferenceConnector = Connector<any>;
|
|
346
|
+
declare const createTransference: TransferenceConnector;
|
|
347
|
+
type WabiConnector = Connector<{
|
|
348
|
+
endpoint: string;
|
|
349
|
+
apiKey: string;
|
|
350
|
+
serviceCode: string;
|
|
351
|
+
platform: number;
|
|
352
|
+
agency: number;
|
|
353
|
+
userId?: string;
|
|
354
|
+
callbackUrl?: string;
|
|
355
|
+
credentials: {
|
|
356
|
+
username: string;
|
|
357
|
+
password: string;
|
|
358
|
+
};
|
|
359
|
+
}>;
|
|
360
|
+
declare const createWabi: WabiConnector;
|
|
361
|
+
declare function createGraphql(db: Database): Graphql;
|
|
362
|
+
export { CustomError, createBancoEconomico, createBancoGanadero, createCybersource, createDatafast, createGraphql, createMultipagos, createPagomedios, createPayPal, createPayment, createPaymentez, createPlaceToPay, createTransference, createWabi, useTasks };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { CustomError, createBancoEconomico, createBancoGanadero, createCybersource, createDatafast, createGraphql, createMultipagos, createPagomedios, createPayPal, createPayment, createPaymentez, createPlaceToPay, createTransference, createWabi, useTasks } from "../_chunks/lib.mjs";
|
|
2
|
+
export { CustomError, createBancoEconomico, createBancoGanadero, createCybersource, createDatafast, createGraphql, createMultipagos, createPagomedios, createPayPal, createPayment, createPaymentez, createPlaceToPay, createTransference, createWabi, useTasks };
|