@doctadevs/mercadopago
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -86,2 +86,19 @@ export declare type MercadoPagoItem = { | ||
}; | ||
export declare type MercadoPagoAddress = { | ||
street_name: string; | ||
street_number: string; | ||
zip_code: string; | ||
}; | ||
export declare type MercadoPagoCustomer = { | ||
email: string; | ||
first_name: string; | ||
last_name: string; | ||
phone: MercadoPagoPhone; | ||
identification: MercadoPagoIdentification; | ||
default_address: 'Home'; | ||
address: MercadoPagoAddress; | ||
description: string; | ||
date_registered: string; | ||
default_card: 'None'; | ||
}; | ||
export declare const createPreference: (data: MercadoPagoPreference) => Promise<MercadoPagoPreferenceResponse>; | ||
@@ -88,0 +105,0 @@ export declare const getPreference: (id: string) => Promise<MercadoPagoPreferenceResponse>; |
@@ -5,3 +5,3 @@ "use strict"; | ||
const utils_1 = require("@doctadevs/utils"); | ||
const MERCADOPAGO_API_URL = process.env.MERCADOPAGO_API_URL || 'https://api.mercadopago.com/'; | ||
const MERCADOPAGO_API_URL = process.env.MERCADOPAGO_API_URL; | ||
const callMercadoPago = async ({ url, method = 'GET', data, queryParams = {}, token = process.env.MERCADOPAGO_TOKEN, }) => utils_1.request({ | ||
@@ -8,0 +8,0 @@ url: `${MERCADOPAGO_API_URL}${url}`, |
21
index.ts
@@ -103,4 +103,23 @@ import { request, RequestOptions } from '@doctadevs/utils'; | ||
const MERCADOPAGO_API_URL = process.env.MERCADOPAGO_API_URL || 'https://api.mercadopago.com/'; | ||
export type MercadoPagoAddress = { | ||
street_name: string; | ||
street_number: string; | ||
zip_code: string; | ||
}; | ||
export type MercadoPagoCustomer = { | ||
email: string; | ||
first_name: string; | ||
last_name: string; | ||
phone: MercadoPagoPhone; | ||
identification: MercadoPagoIdentification; | ||
default_address: 'Home'; | ||
address: MercadoPagoAddress; | ||
description: string; | ||
date_registered: string; | ||
default_card: 'None'; | ||
}; | ||
const MERCADOPAGO_API_URL = process.env.MERCADOPAGO_API_URL; | ||
const callMercadoPago = async <DataT = BodyInit, ResponseT = any>({ | ||
@@ -107,0 +126,0 @@ url, |
{ | ||
"name": "@doctadevs/mercadopago", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
12838
322