better-auth-mercadopago 0.1.8 → 0.2.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/client.js CHANGED
@@ -1,301 +1,271 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
1
+ export const mercadoPagoClientPlugin = () => {
2
+ return {
3
+ id: "mercadopago",
4
+ $InferServerPlugin: {},
5
+ getActions: ($fetch) => ({
6
+ /**
7
+ * Get or create a Mercado Pago customer for the authenticated user
8
+ */
9
+ getOrCreateCustomer: async (data, fetchOptions) => {
10
+ return await $fetch("/mercado-pago/customer", {
11
+ method: "POST",
12
+ body: data || {},
13
+ ...fetchOptions,
14
+ });
15
+ },
16
+ /**
17
+ * Create a payment and get checkout URL
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const { data } = await authClient.mercadoPago.createPayment({
22
+ * items: [{
23
+ * title: "Premium Plan",
24
+ * quantity: 1,
25
+ * unitPrice: 99.90,
26
+ * currencyId: "ARS"
27
+ * }]
28
+ * });
29
+ *
30
+ * // Redirect user to checkout
31
+ * window.location.href = data.checkoutUrl;
32
+ * ```
33
+ */
34
+ createPayment: async (data, fetchOptions) => {
35
+ return await $fetch("/mercado-pago/payment/create", {
36
+ method: "POST",
37
+ body: data,
38
+ ...fetchOptions,
39
+ });
40
+ },
41
+ /**
42
+ * Create a marketplace payment with automatic split
43
+ *
44
+ * You need to have the seller's MP User ID (collector_id) which they get
45
+ * after authorizing your app via OAuth.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const { data } = await authClient.mercadoPago.createPayment({
50
+ * items: [{
51
+ * title: "Product from Seller",
52
+ * quantity: 1,
53
+ * unitPrice: 100
54
+ * }],
55
+ * marketplace: {
56
+ * collectorId: "123456789", // Seller's MP User ID
57
+ * applicationFeePercentage: 10 // Platform keeps 10%
58
+ * }
59
+ * });
60
+ * ```
61
+ */
62
+ createMarketplacePayment: async (data, fetchOptions) => {
63
+ return await $fetch("/mercado-pago/payment/create", {
64
+ method: "POST",
65
+ body: data,
66
+ ...fetchOptions,
67
+ });
68
+ },
69
+ /**
70
+ * Create a subscription with recurring payments
71
+ *
72
+ * Supports two modes:
73
+ * 1. With preapproval plan (reusable): Pass preapprovalPlanId
74
+ * 2. Direct subscription (one-off): Pass reason + autoRecurring
75
+ *
76
+ * @example With plan
77
+ * ```ts
78
+ * const { data } = await authClient.mercadoPago.createSubscription({
79
+ * preapprovalPlanId: "plan_abc123"
80
+ * });
81
+ * ```
82
+ *
83
+ * @example Direct (without plan)
84
+ * ```ts
85
+ * const { data } = await authClient.mercadoPago.createSubscription({
86
+ * reason: "Premium Monthly Plan",
87
+ * autoRecurring: {
88
+ * frequency: 1,
89
+ * frequencyType: "months",
90
+ * transactionAmount: 99.90,
91
+ * currencyId: "ARS"
92
+ * }
93
+ * });
94
+ * ```
95
+ */
96
+ createSubscription: async (data, fetchOptions) => {
97
+ return await $fetch("/mercado-pago/subscription/create", {
98
+ method: "POST",
99
+ body: data,
100
+ ...fetchOptions,
101
+ });
102
+ },
103
+ /**
104
+ * Cancel a subscription
105
+ *
106
+ * @example
107
+ * ```ts
108
+ * await authClient.mercadoPago.cancelSubscription({
109
+ * subscriptionId: "sub_123"
110
+ * });
111
+ * ```
112
+ */
113
+ cancelSubscription: async (data, fetchOptions) => {
114
+ return await $fetch("/mercado-pago/subscription/cancel", {
115
+ method: "POST",
116
+ body: data,
117
+ ...fetchOptions,
118
+ });
119
+ },
120
+ /**
121
+ * Create a reusable preapproval plan (subscription template)
122
+ *
123
+ * Plans can be reused for multiple subscriptions. Create once,
124
+ * use many times with createSubscription({ preapprovalPlanId })
125
+ *
126
+ * @example
127
+ * ```ts
128
+ * const { data } = await authClient.mercadoPago.createPreapprovalPlan({
129
+ * reason: "Premium Monthly",
130
+ * autoRecurring: {
131
+ * frequency: 1,
132
+ * frequencyType: "months",
133
+ * transactionAmount: 99.90,
134
+ * freeTrial: {
135
+ * frequency: 7,
136
+ * frequencyType: "days"
137
+ * }
138
+ * },
139
+ * repetitions: 12 // 12 months, omit for infinite
140
+ * });
141
+ *
142
+ * // Use the plan
143
+ * const planId = data.plan.mercadoPagoPlanId;
144
+ * ```
145
+ */
146
+ createPreapprovalPlan: async (data, fetchOptions) => {
147
+ return await $fetch("/mercado-pago/plan/create", {
148
+ method: "POST",
149
+ body: data,
150
+ ...fetchOptions,
151
+ });
152
+ },
153
+ /**
154
+ * List all preapproval plans
155
+ *
156
+ * @example
157
+ * ```ts
158
+ * const { data } = await authClient.mercadoPago.listPreapprovalPlans();
159
+ *
160
+ * data.plans.forEach(plan => {
161
+ * console.log(plan.reason); // "Premium Monthly"
162
+ * console.log(plan.transactionAmount); // 99.90
163
+ * });
164
+ * ```
165
+ */
166
+ listPreapprovalPlans: async (fetchOptions) => {
167
+ return await $fetch("/mercado-pago/plans", {
168
+ method: "GET",
169
+ ...fetchOptions,
170
+ });
171
+ },
172
+ /**
173
+ * Get payment by ID
174
+ */
175
+ getPayment: async (paymentId, fetchOptions) => {
176
+ return await $fetch(`/mercado-pago/payment/${paymentId}`, {
177
+ method: "GET",
178
+ ...fetchOptions,
179
+ });
180
+ },
181
+ /**
182
+ * List all payments for the authenticated user
183
+ *
184
+ * @example
185
+ * ```ts
186
+ * const { data } = await authClient.mercadoPago.listPayments({
187
+ * limit: 20,
188
+ * offset: 0
189
+ * });
190
+ * ```
191
+ */
192
+ listPayments: async (params, fetchOptions) => {
193
+ const query = new URLSearchParams();
194
+ if (params?.limit)
195
+ query.set("limit", params.limit.toString());
196
+ if (params?.offset)
197
+ query.set("offset", params.offset.toString());
198
+ return await $fetch(`/mercado-pago/payments?${query.toString()}`, {
199
+ method: "GET",
200
+ ...fetchOptions,
201
+ });
202
+ },
203
+ /**
204
+ * List all subscriptions for the authenticated user
205
+ *
206
+ * @example
207
+ * ```ts
208
+ * const { data } = await authClient.mercadoPago.listSubscriptions();
209
+ * ```
210
+ */
211
+ listSubscriptions: async (fetchOptions) => {
212
+ return await $fetch(`/mercado-pago/subscriptions`, {
213
+ method: "GET",
214
+ ...fetchOptions,
215
+ });
216
+ },
217
+ /**
218
+ * Get OAuth authorization URL for marketplace sellers
219
+ *
220
+ * This is Step 1 of OAuth flow. Redirect the seller to this URL so they
221
+ * can authorize your app to process payments on their behalf.
222
+ *
223
+ * @example
224
+ * ```ts
225
+ * const { data } = await authClient.mercadoPago.getOAuthUrl({
226
+ * redirectUri: "https://myapp.com/oauth/callback"
227
+ * });
228
+ *
229
+ * // Redirect seller to authorize
230
+ * window.location.href = data.authUrl;
231
+ * ```
232
+ */
233
+ getOAuthUrl: async (params, fetchOptions) => {
234
+ const query = new URLSearchParams();
235
+ query.set("redirectUri", params.redirectUri);
236
+ return await $fetch(`/mercado-pago/oauth/authorize?${query.toString()}`, {
237
+ method: "GET",
238
+ ...fetchOptions,
239
+ });
240
+ },
241
+ /**
242
+ * Exchange OAuth code for access token
243
+ *
244
+ * This is Step 2 of OAuth flow. After the seller authorizes and MP redirects
245
+ * them back with a code, exchange that code for an access token.
246
+ *
247
+ * @example
248
+ * ```ts
249
+ * // In your /oauth/callback page:
250
+ * const code = new URLSearchParams(window.location.search).get("code");
251
+ *
252
+ * const { data } = await authClient.mercadoPago.exchangeOAuthCode({
253
+ * code,
254
+ * redirectUri: "https://myapp.com/oauth/callback"
255
+ * });
256
+ *
257
+ * // Now you have the seller's MP User ID
258
+ * console.log(data.oauthToken.mercadoPagoUserId);
259
+ * ```
260
+ */
261
+ exchangeOAuthCode: async (data, fetchOptions) => {
262
+ return await $fetch("/mercado-pago/oauth/callback", {
263
+ method: "POST",
264
+ body: data,
265
+ ...fetchOptions,
266
+ });
267
+ },
268
+ }),
269
+ };
9
270
  };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // client.ts
21
- var client_exports = {};
22
- __export(client_exports, {
23
- mercadoPagoClientPlugin: () => mercadoPagoClientPlugin
24
- });
25
- module.exports = __toCommonJS(client_exports);
26
- var mercadoPagoClientPlugin = () => {
27
- return {
28
- id: "mercadopago",
29
- $InferServerPlugin: {},
30
- getActions: ($fetch) => ({
31
- /**
32
- * Get or create a Mercado Pago customer for the authenticated user
33
- */
34
- getOrCreateCustomer: async (data, fetchOptions) => {
35
- return await $fetch("/mercado-pago/customer", {
36
- method: "POST",
37
- body: data || {},
38
- ...fetchOptions
39
- });
40
- },
41
- /**
42
- * Create a payment and get checkout URL
43
- *
44
- * @example
45
- * ```ts
46
- * const { data } = await authClient.mercadoPago.createPayment({
47
- * items: [{
48
- * title: "Premium Plan",
49
- * quantity: 1,
50
- * unitPrice: 99.90,
51
- * currencyId: "ARS"
52
- * }]
53
- * });
54
- *
55
- * // Redirect user to checkout
56
- * window.location.href = data.checkoutUrl;
57
- * ```
58
- */
59
- createPayment: async (data, fetchOptions) => {
60
- return await $fetch("/mercado-pago/payment/create", {
61
- method: "POST",
62
- body: data,
63
- ...fetchOptions
64
- });
65
- },
66
- /**
67
- * Create a marketplace payment with automatic split
68
- *
69
- * You need to have the seller's MP User ID (collector_id) which they get
70
- * after authorizing your app via OAuth.
71
- *
72
- * @example
73
- * ```ts
74
- * const { data } = await authClient.mercadoPago.createPayment({
75
- * items: [{
76
- * title: "Product from Seller",
77
- * quantity: 1,
78
- * unitPrice: 100
79
- * }],
80
- * marketplace: {
81
- * collectorId: "123456789", // Seller's MP User ID
82
- * applicationFeePercentage: 10 // Platform keeps 10%
83
- * }
84
- * });
85
- * ```
86
- */
87
- createMarketplacePayment: async (data, fetchOptions) => {
88
- return await $fetch("/mercado-pago/payment/create", {
89
- method: "POST",
90
- body: data,
91
- ...fetchOptions
92
- });
93
- },
94
- /**
95
- * Create a subscription with recurring payments
96
- *
97
- * Supports two modes:
98
- * 1. With preapproval plan (reusable): Pass preapprovalPlanId
99
- * 2. Direct subscription (one-off): Pass reason + autoRecurring
100
- *
101
- * @example With plan
102
- * ```ts
103
- * const { data } = await authClient.mercadoPago.createSubscription({
104
- * preapprovalPlanId: "plan_abc123"
105
- * });
106
- * ```
107
- *
108
- * @example Direct (without plan)
109
- * ```ts
110
- * const { data } = await authClient.mercadoPago.createSubscription({
111
- * reason: "Premium Monthly Plan",
112
- * autoRecurring: {
113
- * frequency: 1,
114
- * frequencyType: "months",
115
- * transactionAmount: 99.90,
116
- * currencyId: "ARS"
117
- * }
118
- * });
119
- * ```
120
- */
121
- createSubscription: async (data, fetchOptions) => {
122
- return await $fetch("/mercado-pago/subscription/create", {
123
- method: "POST",
124
- body: data,
125
- ...fetchOptions
126
- });
127
- },
128
- /**
129
- * Cancel a subscription
130
- *
131
- * @example
132
- * ```ts
133
- * await authClient.mercadoPago.cancelSubscription({
134
- * subscriptionId: "sub_123"
135
- * });
136
- * ```
137
- */
138
- cancelSubscription: async (data, fetchOptions) => {
139
- return await $fetch("/mercado-pago/subscription/cancel", {
140
- method: "POST",
141
- body: data,
142
- ...fetchOptions
143
- });
144
- },
145
- /**
146
- * Create a reusable preapproval plan (subscription template)
147
- *
148
- * Plans can be reused for multiple subscriptions. Create once,
149
- * use many times with createSubscription({ preapprovalPlanId })
150
- *
151
- * @example
152
- * ```ts
153
- * const { data } = await authClient.mercadoPago.createPreapprovalPlan({
154
- * reason: "Premium Monthly",
155
- * autoRecurring: {
156
- * frequency: 1,
157
- * frequencyType: "months",
158
- * transactionAmount: 99.90,
159
- * freeTrial: {
160
- * frequency: 7,
161
- * frequencyType: "days"
162
- * }
163
- * },
164
- * repetitions: 12 // 12 months, omit for infinite
165
- * });
166
- *
167
- * // Use the plan
168
- * const planId = data.plan.mercadoPagoPlanId;
169
- * ```
170
- */
171
- createPreapprovalPlan: async (data, fetchOptions) => {
172
- return await $fetch("/mercado-pago/plan/create", {
173
- method: "POST",
174
- body: data,
175
- ...fetchOptions
176
- });
177
- },
178
- /**
179
- * List all preapproval plans
180
- *
181
- * @example
182
- * ```ts
183
- * const { data } = await authClient.mercadoPago.listPreapprovalPlans();
184
- *
185
- * data.plans.forEach(plan => {
186
- * console.log(plan.reason); // "Premium Monthly"
187
- * console.log(plan.transactionAmount); // 99.90
188
- * });
189
- * ```
190
- */
191
- listPreapprovalPlans: async (fetchOptions) => {
192
- return await $fetch("/mercado-pago/plans", {
193
- method: "GET",
194
- ...fetchOptions
195
- });
196
- },
197
- /**
198
- * Get payment by ID
199
- */
200
- getPayment: async (paymentId, fetchOptions) => {
201
- return await $fetch(`/mercado-pago/payment/${paymentId}`, {
202
- method: "GET",
203
- ...fetchOptions
204
- });
205
- },
206
- /**
207
- * List all payments for the authenticated user
208
- *
209
- * @example
210
- * ```ts
211
- * const { data } = await authClient.mercadoPago.listPayments({
212
- * limit: 20,
213
- * offset: 0
214
- * });
215
- * ```
216
- */
217
- listPayments: async (params, fetchOptions) => {
218
- const query = new URLSearchParams();
219
- if (params?.limit) query.set("limit", params.limit.toString());
220
- if (params?.offset) query.set("offset", params.offset.toString());
221
- return await $fetch(`/mercado-pago/payments?${query.toString()}`, {
222
- method: "GET",
223
- ...fetchOptions
224
- });
225
- },
226
- /**
227
- * List all subscriptions for the authenticated user
228
- *
229
- * @example
230
- * ```ts
231
- * const { data } = await authClient.mercadoPago.listSubscriptions();
232
- * ```
233
- */
234
- listSubscriptions: async (fetchOptions) => {
235
- return await $fetch(`/mercado-pago/subscriptions`, {
236
- method: "GET",
237
- ...fetchOptions
238
- });
239
- },
240
- /**
241
- * Get OAuth authorization URL for marketplace sellers
242
- *
243
- * This is Step 1 of OAuth flow. Redirect the seller to this URL so they
244
- * can authorize your app to process payments on their behalf.
245
- *
246
- * @example
247
- * ```ts
248
- * const { data } = await authClient.mercadoPago.getOAuthUrl({
249
- * redirectUri: "https://myapp.com/oauth/callback"
250
- * });
251
- *
252
- * // Redirect seller to authorize
253
- * window.location.href = data.authUrl;
254
- * ```
255
- */
256
- getOAuthUrl: async (params, fetchOptions) => {
257
- const query = new URLSearchParams();
258
- query.set("redirectUri", params.redirectUri);
259
- return await $fetch(
260
- `/mercado-pago/oauth/authorize?${query.toString()}`,
261
- {
262
- method: "GET",
263
- ...fetchOptions
264
- }
265
- );
266
- },
267
- /**
268
- * Exchange OAuth code for access token
269
- *
270
- * This is Step 2 of OAuth flow. After the seller authorizes and MP redirects
271
- * them back with a code, exchange that code for an access token.
272
- *
273
- * @example
274
- * ```ts
275
- * // In your /oauth/callback page:
276
- * const code = new URLSearchParams(window.location.search).get("code");
277
- *
278
- * const { data } = await authClient.mercadoPago.exchangeOAuthCode({
279
- * code,
280
- * redirectUri: "https://myapp.com/oauth/callback"
281
- * });
282
- *
283
- * // Now you have the seller's MP User ID
284
- * console.log(data.oauthToken.mercadoPagoUserId);
285
- * ```
286
- */
287
- exchangeOAuthCode: async (data, fetchOptions) => {
288
- return await $fetch("/mercado-pago/oauth/callback", {
289
- method: "POST",
290
- body: data,
291
- ...fetchOptions
292
- });
293
- }
294
- })
295
- };
296
- };
297
- // Annotate the CommonJS export names for ESM import in node:
298
- 0 && (module.exports = {
299
- mercadoPagoClientPlugin
300
- });
301
271
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../client.ts"],"sourcesContent":["import type {\n\tBetterAuthClientPlugin,\n\tBetterFetch,\n\tBetterFetchOption,\n} from \"better-auth/client\";\nimport type { mercadoPagoPlugin } from \"./index\";\nimport type {\n\tCreatePaymentParams,\n\tCreatePaymentResponse,\n\tCreatePreapprovalPlanParams,\n\tCreatePreapprovalPlanResponse,\n\tCreateSubscriptionParams,\n\tCreateSubscriptionResponse,\n\tMercadoPagoCustomerRecord,\n\tMercadoPagoPaymentRecord,\n\tMercadoPagoPreapprovalPlanRecord,\n\tMercadoPagoSubscriptionRecord,\n\tOAuthTokenResponse,\n\tOAuthUrlResponse,\n} from \"./types\";\n\nexport interface MercadoPagoClientActions {\n\t/**\n\t * Get or create a Mercado Pago customer for the authenticated user\n\t */\n\tgetOrCreateCustomer: (\n\t\tdata?: {\n\t\t\temail?: string;\n\t\t\tfirstName?: string;\n\t\t\tlastName?: string;\n\t\t},\n\t\tfetchOptions?: BetterFetchOption,\n\t) => Promise<{ customer: MercadoPagoCustomerRecord }>;\n\n\t/**\n\t * Create a payment and get checkout URL\n\t */\n\tcreatePayment: (\n\t\tdata: CreatePaymentParams,\n\t\tfetchOptions?: BetterFetchOption,\n\t) => Promise<CreatePaymentResponse>;\n\n\t/**\n\t * Create a marketplace payment with automatic split\n\t */\n\tcreateMarketplacePayment: (\n\t\tdata: CreatePaymentParams,\n\t\tfetchOptions?: BetterFetchOption,\n\t) => Promise<CreatePaymentResponse>;\n\n\t/**\n\t * Create a subscription with recurring payments\n\t */\n\tcreateSubscription: (\n\t\tdata: CreateSubscriptionParams,\n\t\tfetchOptions?: BetterFetchOption,\n\t) => Promise<CreateSubscriptionResponse>;\n\n\t/**\n\t * Cancel a subscription\n\t */\n\tcancelSubscription: (\n\t\tdata: { subscriptionId: string },\n\t\tfetchOptions?: BetterFetchOption,\n\t) => Promise<{ success: boolean }>;\n\n\t/**\n\t * Create a reusable preapproval plan (subscription template)\n\t */\n\tcreatePreapprovalPlan: (\n\t\tdata: CreatePreapprovalPlanParams,\n\t\tfetchOptions?: BetterFetchOption,\n\t) => Promise<CreatePreapprovalPlanResponse>;\n\n\t/**\n\t * List all preapproval plans\n\t */\n\tlistPreapprovalPlans: (\n\t\tfetchOptions?: BetterFetchOption,\n\t) => Promise<{ plans: MercadoPagoPreapprovalPlanRecord[] }>;\n\n\t/**\n\t * Get payment by ID\n\t */\n\tgetPayment: (\n\t\tpaymentId: string,\n\t\tfetchOptions?: BetterFetchOption,\n\t) => Promise<{ payment: MercadoPagoPaymentRecord }>;\n\n\t/**\n\t * List all payments for the authenticated user\n\t */\n\tlistPayments: (\n\t\tparams?: { limit?: number; offset?: number },\n\t\tfetchOptions?: BetterFetchOption,\n\t) => Promise<{ payments: MercadoPagoPaymentRecord[] }>;\n\n\t/**\n\t * List all subscriptions for the authenticated user\n\t */\n\tlistSubscriptions: (\n\t\tfetchOptions?: BetterFetchOption,\n\t) => Promise<{ subscriptions: MercadoPagoSubscriptionRecord[] }>;\n\n\t/**\n\t * Get OAuth authorization URL for marketplace sellers\n\t */\n\tgetOAuthUrl: (\n\t\tparams: { redirectUri: string },\n\t\tfetchOptions?: BetterFetchOption,\n\t) => Promise<OAuthUrlResponse>;\n\n\t/**\n\t * Exchange OAuth code for access token\n\t */\n\texchangeOAuthCode: (\n\t\tdata: { code: string; redirectUri: string },\n\t\tfetchOptions?: BetterFetchOption,\n\t) => Promise<OAuthTokenResponse>;\n}\n\ntype mercadopagoPlugin = typeof mercadoPagoPlugin;\n\n// Export the actions type for Better Auth type inference\nexport type MercadoPagoClient = MercadoPagoClientActions;\n\nexport const mercadoPagoClientPlugin = () => {\n\treturn {\n\t\tid: \"mercadopago\",\n\t\t$InferServerPlugin: {} as ReturnType<mercadopagoPlugin>,\n\n\t\tgetActions: ($fetch: BetterFetch): MercadoPagoClientActions => ({\n\t\t\t/**\n\t\t\t * Get or create a Mercado Pago customer for the authenticated user\n\t\t\t */\n\t\t\tgetOrCreateCustomer: async (\n\t\t\t\tdata?: {\n\t\t\t\t\temail?: string;\n\t\t\t\t\tfirstName?: string;\n\t\t\t\t\tlastName?: string;\n\t\t\t\t},\n\t\t\t\tfetchOptions?: BetterFetchOption,\n\t\t\t) => {\n\t\t\t\treturn await $fetch(\"/mercado-pago/customer\", {\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tbody: data || {},\n\t\t\t\t\t...fetchOptions,\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Create a payment and get checkout URL\n\t\t\t *\n\t\t\t * @example\n\t\t\t * ```ts\n\t\t\t * const { data } = await authClient.mercadoPago.createPayment({\n\t\t\t * items: [{\n\t\t\t * title: \"Premium Plan\",\n\t\t\t * quantity: 1,\n\t\t\t * unitPrice: 99.90,\n\t\t\t * currencyId: \"ARS\"\n\t\t\t * }]\n\t\t\t * });\n\t\t\t *\n\t\t\t * // Redirect user to checkout\n\t\t\t * window.location.href = data.checkoutUrl;\n\t\t\t * ```\n\t\t\t */\n\t\t\tcreatePayment: async (\n\t\t\t\tdata: CreatePaymentParams,\n\t\t\t\tfetchOptions?: BetterFetchOption,\n\t\t\t) => {\n\t\t\t\treturn await $fetch(\"/mercado-pago/payment/create\", {\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tbody: data,\n\t\t\t\t\t...fetchOptions,\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Create a marketplace payment with automatic split\n\t\t\t *\n\t\t\t * You need to have the seller's MP User ID (collector_id) which they get\n\t\t\t * after authorizing your app via OAuth.\n\t\t\t *\n\t\t\t * @example\n\t\t\t * ```ts\n\t\t\t * const { data } = await authClient.mercadoPago.createPayment({\n\t\t\t * items: [{\n\t\t\t * title: \"Product from Seller\",\n\t\t\t * quantity: 1,\n\t\t\t * unitPrice: 100\n\t\t\t * }],\n\t\t\t * marketplace: {\n\t\t\t * collectorId: \"123456789\", // Seller's MP User ID\n\t\t\t * applicationFeePercentage: 10 // Platform keeps 10%\n\t\t\t * }\n\t\t\t * });\n\t\t\t * ```\n\t\t\t */\n\t\t\tcreateMarketplacePayment: async (\n\t\t\t\tdata: CreatePaymentParams,\n\t\t\t\tfetchOptions?: BetterFetchOption,\n\t\t\t) => {\n\t\t\t\treturn await $fetch(\"/mercado-pago/payment/create\", {\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tbody: data,\n\t\t\t\t\t...fetchOptions,\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Create a subscription with recurring payments\n\t\t\t *\n\t\t\t * Supports two modes:\n\t\t\t * 1. With preapproval plan (reusable): Pass preapprovalPlanId\n\t\t\t * 2. Direct subscription (one-off): Pass reason + autoRecurring\n\t\t\t *\n\t\t\t * @example With plan\n\t\t\t * ```ts\n\t\t\t * const { data } = await authClient.mercadoPago.createSubscription({\n\t\t\t * preapprovalPlanId: \"plan_abc123\"\n\t\t\t * });\n\t\t\t * ```\n\t\t\t *\n\t\t\t * @example Direct (without plan)\n\t\t\t * ```ts\n\t\t\t * const { data } = await authClient.mercadoPago.createSubscription({\n\t\t\t * reason: \"Premium Monthly Plan\",\n\t\t\t * autoRecurring: {\n\t\t\t * frequency: 1,\n\t\t\t * frequencyType: \"months\",\n\t\t\t * transactionAmount: 99.90,\n\t\t\t * currencyId: \"ARS\"\n\t\t\t * }\n\t\t\t * });\n\t\t\t * ```\n\t\t\t */\n\t\t\tcreateSubscription: async (\n\t\t\t\tdata: CreateSubscriptionParams,\n\t\t\t\tfetchOptions?: BetterFetchOption,\n\t\t\t) => {\n\t\t\t\treturn await $fetch(\"/mercado-pago/subscription/create\", {\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tbody: data,\n\t\t\t\t\t...fetchOptions,\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Cancel a subscription\n\t\t\t *\n\t\t\t * @example\n\t\t\t * ```ts\n\t\t\t * await authClient.mercadoPago.cancelSubscription({\n\t\t\t * subscriptionId: \"sub_123\"\n\t\t\t * });\n\t\t\t * ```\n\t\t\t */\n\t\t\tcancelSubscription: async (\n\t\t\t\tdata: { subscriptionId: string },\n\t\t\t\tfetchOptions?: BetterFetchOption,\n\t\t\t) => {\n\t\t\t\treturn await $fetch(\"/mercado-pago/subscription/cancel\", {\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tbody: data,\n\t\t\t\t\t...fetchOptions,\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Create a reusable preapproval plan (subscription template)\n\t\t\t *\n\t\t\t * Plans can be reused for multiple subscriptions. Create once,\n\t\t\t * use many times with createSubscription({ preapprovalPlanId })\n\t\t\t *\n\t\t\t * @example\n\t\t\t * ```ts\n\t\t\t * const { data } = await authClient.mercadoPago.createPreapprovalPlan({\n\t\t\t * reason: \"Premium Monthly\",\n\t\t\t * autoRecurring: {\n\t\t\t * frequency: 1,\n\t\t\t * frequencyType: \"months\",\n\t\t\t * transactionAmount: 99.90,\n\t\t\t * freeTrial: {\n\t\t\t * frequency: 7,\n\t\t\t * frequencyType: \"days\"\n\t\t\t * }\n\t\t\t * },\n\t\t\t * repetitions: 12 // 12 months, omit for infinite\n\t\t\t * });\n\t\t\t *\n\t\t\t * // Use the plan\n\t\t\t * const planId = data.plan.mercadoPagoPlanId;\n\t\t\t * ```\n\t\t\t */\n\t\t\tcreatePreapprovalPlan: async (\n\t\t\t\tdata: CreatePreapprovalPlanParams,\n\t\t\t\tfetchOptions?: BetterFetchOption,\n\t\t\t) => {\n\t\t\t\treturn await $fetch(\"/mercado-pago/plan/create\", {\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tbody: data,\n\t\t\t\t\t...fetchOptions,\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * List all preapproval plans\n\t\t\t *\n\t\t\t * @example\n\t\t\t * ```ts\n\t\t\t * const { data } = await authClient.mercadoPago.listPreapprovalPlans();\n\t\t\t *\n\t\t\t * data.plans.forEach(plan => {\n\t\t\t * console.log(plan.reason); // \"Premium Monthly\"\n\t\t\t * console.log(plan.transactionAmount); // 99.90\n\t\t\t * });\n\t\t\t * ```\n\t\t\t */\n\t\t\tlistPreapprovalPlans: async (fetchOptions?: BetterFetchOption) => {\n\t\t\t\treturn await $fetch(\"/mercado-pago/plans\", {\n\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\t...fetchOptions,\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Get payment by ID\n\t\t\t */\n\t\t\tgetPayment: async (\n\t\t\t\tpaymentId: string,\n\t\t\t\tfetchOptions?: BetterFetchOption,\n\t\t\t) => {\n\t\t\t\treturn await $fetch(`/mercado-pago/payment/${paymentId}`, {\n\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\t...fetchOptions,\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * List all payments for the authenticated user\n\t\t\t *\n\t\t\t * @example\n\t\t\t * ```ts\n\t\t\t * const { data } = await authClient.mercadoPago.listPayments({\n\t\t\t * limit: 20,\n\t\t\t * offset: 0\n\t\t\t * });\n\t\t\t * ```\n\t\t\t */\n\t\t\tlistPayments: async (\n\t\t\t\tparams?: { limit?: number; offset?: number },\n\t\t\t\tfetchOptions?: BetterFetchOption,\n\t\t\t) => {\n\t\t\t\tconst query = new URLSearchParams();\n\t\t\t\tif (params?.limit) query.set(\"limit\", params.limit.toString());\n\t\t\t\tif (params?.offset) query.set(\"offset\", params.offset.toString());\n\n\t\t\t\treturn await $fetch(`/mercado-pago/payments?${query.toString()}`, {\n\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\t...fetchOptions,\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * List all subscriptions for the authenticated user\n\t\t\t *\n\t\t\t * @example\n\t\t\t * ```ts\n\t\t\t * const { data } = await authClient.mercadoPago.listSubscriptions();\n\t\t\t * ```\n\t\t\t */\n\t\t\tlistSubscriptions: async (fetchOptions?: BetterFetchOption) => {\n\t\t\t\treturn await $fetch(`/mercado-pago/subscriptions`, {\n\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\t...fetchOptions,\n\t\t\t\t});\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Get OAuth authorization URL for marketplace sellers\n\t\t\t *\n\t\t\t * This is Step 1 of OAuth flow. Redirect the seller to this URL so they\n\t\t\t * can authorize your app to process payments on their behalf.\n\t\t\t *\n\t\t\t * @example\n\t\t\t * ```ts\n\t\t\t * const { data } = await authClient.mercadoPago.getOAuthUrl({\n\t\t\t * redirectUri: \"https://myapp.com/oauth/callback\"\n\t\t\t * });\n\t\t\t *\n\t\t\t * // Redirect seller to authorize\n\t\t\t * window.location.href = data.authUrl;\n\t\t\t * ```\n\t\t\t */\n\t\t\tgetOAuthUrl: async (\n\t\t\t\tparams: { redirectUri: string },\n\t\t\t\tfetchOptions?: BetterFetchOption,\n\t\t\t) => {\n\t\t\t\tconst query = new URLSearchParams();\n\t\t\t\tquery.set(\"redirectUri\", params.redirectUri);\n\n\t\t\t\treturn await $fetch(\n\t\t\t\t\t`/mercado-pago/oauth/authorize?${query.toString()}`,\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\t\t...fetchOptions,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Exchange OAuth code for access token\n\t\t\t *\n\t\t\t * This is Step 2 of OAuth flow. After the seller authorizes and MP redirects\n\t\t\t * them back with a code, exchange that code for an access token.\n\t\t\t *\n\t\t\t * @example\n\t\t\t * ```ts\n\t\t\t * // In your /oauth/callback page:\n\t\t\t * const code = new URLSearchParams(window.location.search).get(\"code\");\n\t\t\t *\n\t\t\t * const { data } = await authClient.mercadoPago.exchangeOAuthCode({\n\t\t\t * code,\n\t\t\t * redirectUri: \"https://myapp.com/oauth/callback\"\n\t\t\t * });\n\t\t\t *\n\t\t\t * // Now you have the seller's MP User ID\n\t\t\t * console.log(data.oauthToken.mercadoPagoUserId);\n\t\t\t * ```\n\t\t\t */\n\t\t\texchangeOAuthCode: async (\n\t\t\t\tdata: { code: string; redirectUri: string },\n\t\t\t\tfetchOptions?: BetterFetchOption,\n\t\t\t) => {\n\t\t\t\treturn await $fetch(\"/mercado-pago/oauth/callback\", {\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tbody: data,\n\t\t\t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