better-auth-mercadopago 0.1.5 → 0.1.7

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.mjs CHANGED
@@ -222,21 +222,18 @@ var ValidationRules = {
222
222
  // client.ts
223
223
  var mercadoPagoClient = () => {
224
224
  return {
225
- id: "mercado-pago",
225
+ id: "mercadopago",
226
226
  $InferServerPlugin: {},
227
227
  getActions: ($fetch) => ({
228
228
  /**
229
229
  * Get or create a Mercado Pago customer for the authenticated user
230
230
  */
231
231
  getOrCreateCustomer: async (data, fetchOptions) => {
232
- return await $fetch(
233
- "/mercado-pago/customer",
234
- {
235
- method: "POST",
236
- body: data || {},
237
- ...fetchOptions
238
- }
239
- );
232
+ return await $fetch("/mercado-pago/customer", {
233
+ method: "POST",
234
+ body: data || {},
235
+ ...fetchOptions
236
+ });
240
237
  },
241
238
  /**
242
239
  * Create a payment and get checkout URL
@@ -257,14 +254,11 @@ var mercadoPagoClient = () => {
257
254
  * ```
258
255
  */
259
256
  createPayment: async (data, fetchOptions) => {
260
- return await $fetch(
261
- "/mercado-pago/payment/create",
262
- {
263
- method: "POST",
264
- body: data,
265
- ...fetchOptions
266
- }
267
- );
257
+ return await $fetch("/mercado-pago/payment/create", {
258
+ method: "POST",
259
+ body: data,
260
+ ...fetchOptions
261
+ });
268
262
  },
269
263
  /**
270
264
  * Create a marketplace payment with automatic split
@@ -288,14 +282,11 @@ var mercadoPagoClient = () => {
288
282
  * ```
289
283
  */
290
284
  createMarketplacePayment: async (data, fetchOptions) => {
291
- return await $fetch(
292
- "/mercado-pago/payment/create",
293
- {
294
- method: "POST",
295
- body: data,
296
- ...fetchOptions
297
- }
298
- );
285
+ return await $fetch("/mercado-pago/payment/create", {
286
+ method: "POST",
287
+ body: data,
288
+ ...fetchOptions
289
+ });
299
290
  },
300
291
  /**
301
292
  * Create a subscription with recurring payments
@@ -325,14 +316,11 @@ var mercadoPagoClient = () => {
325
316
  * ```
326
317
  */
327
318
  createSubscription: async (data, fetchOptions) => {
328
- return await $fetch(
329
- "/mercado-pago/subscription/create",
330
- {
331
- method: "POST",
332
- body: data,
333
- ...fetchOptions
334
- }
335
- );
319
+ return await $fetch("/mercado-pago/subscription/create", {
320
+ method: "POST",
321
+ body: data,
322
+ ...fetchOptions
323
+ });
336
324
  },
337
325
  /**
338
326
  * Cancel a subscription
@@ -345,14 +333,11 @@ var mercadoPagoClient = () => {
345
333
  * ```
346
334
  */
347
335
  cancelSubscription: async (data, fetchOptions) => {
348
- return await $fetch(
349
- "/mercado-pago/subscription/cancel",
350
- {
351
- method: "POST",
352
- body: data,
353
- ...fetchOptions
354
- }
355
- );
336
+ return await $fetch("/mercado-pago/subscription/cancel", {
337
+ method: "POST",
338
+ body: data,
339
+ ...fetchOptions
340
+ });
356
341
  },
357
342
  /**
358
343
  * Create a reusable preapproval plan (subscription template)
@@ -381,14 +366,11 @@ var mercadoPagoClient = () => {
381
366
  * ```
382
367
  */
383
368
  createPreapprovalPlan: async (data, fetchOptions) => {
384
- return await $fetch(
385
- "/mercado-pago/plan/create",
386
- {
387
- method: "POST",
388
- body: data,
389
- ...fetchOptions
390
- }
391
- );
369
+ return await $fetch("/mercado-pago/plan/create", {
370
+ method: "POST",
371
+ body: data,
372
+ ...fetchOptions
373
+ });
392
374
  },
393
375
  /**
394
376
  * List all preapproval plans
@@ -404,25 +386,19 @@ var mercadoPagoClient = () => {
404
386
  * ```
405
387
  */
406
388
  listPreapprovalPlans: async (fetchOptions) => {
407
- return await $fetch(
408
- "/mercado-pago/plans",
409
- {
410
- method: "GET",
411
- ...fetchOptions
412
- }
413
- );
389
+ return await $fetch("/mercado-pago/plans", {
390
+ method: "GET",
391
+ ...fetchOptions
392
+ });
414
393
  },
415
394
  /**
416
395
  * Get payment by ID
417
396
  */
418
397
  getPayment: async (paymentId, fetchOptions) => {
419
- return await $fetch(
420
- `/mercado-pago/payment/${paymentId}`,
421
- {
422
- method: "GET",
423
- ...fetchOptions
424
- }
425
- );
398
+ return await $fetch(`/mercado-pago/payment/${paymentId}`, {
399
+ method: "GET",
400
+ ...fetchOptions
401
+ });
426
402
  },
427
403
  /**
428
404
  * List all payments for the authenticated user
@@ -439,13 +415,10 @@ var mercadoPagoClient = () => {
439
415
  const query = new URLSearchParams();
440
416
  if (params?.limit) query.set("limit", params.limit.toString());
441
417
  if (params?.offset) query.set("offset", params.offset.toString());
442
- return await $fetch(
443
- `/mercado-pago/payments?${query.toString()}`,
444
- {
445
- method: "GET",
446
- ...fetchOptions
447
- }
448
- );
418
+ return await $fetch(`/mercado-pago/payments?${query.toString()}`, {
419
+ method: "GET",
420
+ ...fetchOptions
421
+ });
449
422
  },
450
423
  /**
451
424
  * List all subscriptions for the authenticated user
@@ -456,13 +429,10 @@ var mercadoPagoClient = () => {
456
429
  * ```
457
430
  */
458
431
  listSubscriptions: async (fetchOptions) => {
459
- return await $fetch(
460
- `/mercado-pago/subscriptions`,
461
- {
462
- method: "GET",
463
- ...fetchOptions
464
- }
465
- );
432
+ return await $fetch(`/mercado-pago/subscriptions`, {
433
+ method: "GET",
434
+ ...fetchOptions
435
+ });
466
436
  },
467
437
  /**
468
438
  * Get OAuth authorization URL for marketplace sellers
@@ -512,14 +482,11 @@ var mercadoPagoClient = () => {
512
482
  * ```
513
483
  */
514
484
  exchangeOAuthCode: async (data, fetchOptions) => {
515
- return await $fetch(
516
- "/mercado-pago/oauth/callback",
517
- {
518
- method: "POST",
519
- body: data,
520
- ...fetchOptions
521
- }
522
- );
485
+ return await $fetch("/mercado-pago/oauth/callback", {
486
+ method: "POST",
487
+ body: data,
488
+ ...fetchOptions
489
+ });
523
490
  }
524
491
  })
525
492
  };
@@ -536,7 +503,7 @@ var mercadoPagoPlugin = (options) => {
536
503
  const preApprovalClient = new PreApproval(client);
537
504
  const preApprovalPlanClient = new PreApprovalPlan(client);
538
505
  return {
539
- id: "mercado-pago",
506
+ id: "mercadopago",
540
507
  schema: {
541
508
  // Customer table - stores MP customer info
542
509
  mercadoPagoCustomer: {