Skip to content

Commit f3ad569

Browse files
committed
Merge branch 'master' into feature/preference-integration-test
2 parents 3936427 + cb7eb36 commit f3ad569

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+160
-160
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/clients/identificationType/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import list from './list';
22

33
import type { MercadoPagoConfig } from '@src/mercadoPagoConfig';
4-
import type { IdentificationTypeResponse, IdentificationTypesListData } from './list/types';
4+
import type { IdentificationTypeResponse, IdentificationTypeListData } from './list/types';
55

66
/**
7-
* Mercado Pago IdentificationTypes.
7+
* Mercado Pago IdentificationType.
88
*
99
* @see {@link https://www.mercadopago.com/developers/en/reference/identification_types/_identification_types/get Documentation }.
1010
*/
@@ -20,8 +20,8 @@ export class IdentificationType {
2020
*
2121
* @see {@link https://github.com/mercadopago/sdk-nodejs/blob/master/examples/identificationtype/list.ts Usage Example }.
2222
*/
23-
list(IdentificationTypesListOptions: IdentificationTypesListData = {} as IdentificationTypesListData): Promise<IdentificationTypeResponse[]> {
24-
const { requestOptions } = IdentificationTypesListOptions;
23+
list(identificationTypeListOptions: IdentificationTypeListData = {} as IdentificationTypeListData): Promise<IdentificationTypeResponse[]> {
24+
const { requestOptions } = identificationTypeListOptions;
2525
this.config.options = { ...this.config.options, ...requestOptions };
2626
return list({ config: this.config });
2727
}

src/clients/identificationType/list/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { MercadoPagoConfig } from '@src/mercadoPagoConfig';
22
import type { ApiResponse, Options } from '@src/types';
33

4-
export declare type IdentificationTypesListData = {
4+
export declare type IdentificationTypeListData = {
55
requestOptions?: Options;
66
}
77

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
export declare type InvoicesPayment = {
1+
export declare type InvoicePayment = {
22
id: string;
33
status: string;
44
status_detail: string;
55
};
66

7-
export declare type InvoicesResponse = {
7+
export declare type InvoiceResponse = {
88
currency_id?: string;
99
date_created?: string;
1010
debit_date?: string;
1111
external_reference?: string;
1212
id?: string;
1313
last_modified?: string;
1414
payer_id?: number;
15-
payment?: InvoicesPayment;
15+
payment?: InvoicePayment;
1616
preapproval_id?: string;
1717
reason?: string;
1818
retry_attempt?: number,
1919
status?: string;
2020
summarized?: string;
2121
transaction_amount?: number;
2222
type?: string;
23-
}
23+
}

src/clients/invoices/get/get.spec.ts renamed to src/clients/invoice/get/get.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { MercadoPagoConfig } from '@src/mercadoPagoConfig';
55

66
jest.mock('@utils/restClient');
77

8-
describe('Testing invoices, get', () => {
8+
describe('Testing invoice, get', () => {
99
test('should make a GET request with the correct parameters', async () => {
1010
const client = new MercadoPagoConfig({ accessToken: 'token', options: { timeout: 5000 } });
1111
const id = '1234';

src/clients/invoice/get/index.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { RestClient } from '@utils/restClient';
2+
3+
import type { InvoiceGetClient } from './types';
4+
import type { InvoiceResponse } from '@src/clients/invoice/commonTypes';
5+
6+
export default function get({ id, config }: InvoiceGetClient): Promise<InvoiceResponse> {
7+
return RestClient.fetch<InvoiceResponse>(
8+
`/authorized_payments/${id}`,
9+
{
10+
method: 'GET',
11+
headers: {
12+
'Authorization': `Bearer ${config.accessToken}`,
13+
},
14+
...config.options
15+
}
16+
);
17+
}

0 commit comments

Comments
 (0)