Skip to content

Commit

Permalink
Merge pull request #274 from mercadopago/feature/add-namedimport-mpco…
Browse files Browse the repository at this point in the history
…nfig

added names export for mercadopago module
  • Loading branch information
lucmkz authored Oct 5, 2023
2 parents 3459a8c + 956f910 commit 989e7b4
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 15 deletions.
26 changes: 25 additions & 1 deletion CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Releases

## VERSION 2.0.1
- Added named export to MercadoPago configuration module
- Modified integration example in readme
- Adjusted PR template
- Adjusted gitflow files

## VERSION 2.0.0

* Search Method implementation
Release SDK Node Mercado Pago V2

- TypeScript Support ⭐️
- Type of all requests and all responses
- Maintained compatibility with Vanilla Javascript

Tests
- More than 90% coverage of unit tests
- Documentation
- Implementation examples from ALL clients
- Technical Documentation
- Melhorias no Readme
- Contribution template

Technical debits
- Code registration
- Removal of vulnerable libraries and without recent updates
- Registration with other Mercado Pago SDKs
- Individual Request configuration for client
16 changes: 10 additions & 6 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,26 @@
### ✅ Checklist:

- [ ] I followed the instructions indicated in [Contribution Guidelines](CONTRIBUTING.md)
- [ ] I added the changes to CHANGELOG
- [ ] Added the necessary tests for the code or functionality that I'm working on
- [ ] I ran the tests and made sure they work
- [ ] My branch coverage is at least 80%
- [ ] I verified the style of my code matches the one in the project

## 🧰 How to reproduce

- Step by step of how to test, specially for bugs.
- Links of external docs.
- [ ] Not Apply.
- [ ] Step by step of how to test, specially for bugs.
- [ ] Links of external docs.

## 📸 Screenshots

- Before and after, if it's a fix for a bug.
- [ ] Not Apply.
- [ ] Before and after, if it's a fix for a bug.

## 📄 References

- Links do external documentation
- Diagrams
- Useful links
- [ ] Not Apply.
- [ ] Links do external documentation.
- [ ] Diagrams.
- [ ] Useful links.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![SDK Node MErcado Pago](https://github.com/lucmkz/sdk-nodejs/assets/31546923/84211022-6fc5-4db1-8772-117eca84f2d9)
![SDK Node Mercado Pago](https://github.com/lucmkz/sdk-nodejs/assets/31546923/84211022-6fc5-4db1-8772-117eca84f2d9)


# Mercado Pago SDK for NodeJS
Expand Down Expand Up @@ -32,7 +32,7 @@ That's it! Mercado Pago SDK has been successfully installed.

```javascript
// Step 1: Import the parts of the module you want to use
import MercadoPago, { Payment } from 'mercadopago';
import { MercadoPago, Payment } from 'mercadopago';

// Step 2: Initialize the client object
const client = new MercadoPago({ accessToken: 'access_token', options: { timeout: 5000, idempotencyKey: 'abc' } });
Expand All @@ -59,7 +59,7 @@ payment.create({ body }).then(console.log).catch(console.log);
Import `MercadoPago` and API objects from the MercadoPago module.

``` javascript
import MercadoPago, { Payment } from 'mercadopago';
import { MercadoPago, Payment } from 'mercadopago';
```

### Step 2: Initialize the client object
Expand Down Expand Up @@ -103,7 +103,7 @@ const body = {

Use the API object's method to make the request. For example, to make a request to the `/v1/payments` endpoint using the `payment` object:

```
```javascript
payment.create({ body }).then(console.log).catch(console.log);
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mercadopago",
"version": "2.0.0",
"version": "2.0.1",
"description": "Mercadopago SDK for Node.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { MercadoPagoConfig } from './mercadoPagoConfig';
export default MercadoPagoConfig;
import { MercadoPagoConfig as MercadoPago } from './mercadoPagoConfig';
export default MercadoPago;
export { MercadoPago };

export { CardToken } from './clients/cardToken';
export { CustomerCard } from './clients/customerCard';
Expand Down
2 changes: 1 addition & 1 deletion src/utils/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class AppConfig {
static readonly BASE_URL = 'https://api.mercadopago.com';
static readonly PRODUCT_ID = 'bc32b6ntrpp001u8nhkg';

static SDK_VERSION = '2.0.0';
static SDK_VERSION = '2.0.1';

static readonly Headers = {
AUTHORIZATION: 'Authorization',
Expand Down

0 comments on commit 989e7b4

Please sign in to comment.