Skip to content

Commit

Permalink
Merge branch 'master' into feature/preference-integration-test
Browse files Browse the repository at this point in the history
  • Loading branch information
brunacamposxx committed Oct 10, 2023
2 parents ecd1f38 + 544b3e6 commit 3248865
Show file tree
Hide file tree
Showing 9 changed files with 1,564 additions and 2,966 deletions.
14 changes: 7 additions & 7 deletions .github/worflows/ci.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: Node.js CI
name: CI

on:
push:
branches: [ "master", "master-v2" ]
branches: [ "master" ]
pull_request:
branches: [ "*" ]
branches: [ "master" ]

jobs:
build:

test:
name: Test on Node v${{ matrix.node-version }}
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 18.x]
node-version: [14.x, 16.x, 18.x, 19.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -22,5 +22,5 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm ci --legacy-peer-deps
- run: npm test
18 changes: 4 additions & 14 deletions .github/worflows/publish.yml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
name: Node.js Publish Package
name: Publish to NPM

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm test

publish-npm:
needs: build
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm ci --legacy-peer-deps
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
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.
14 changes: 7 additions & 7 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,10 +32,10 @@ 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 { MercadoPagoConfig, Payment } from 'mercadopago';

// Step 2: Initialize the client object
const client = new MercadoPago({ accessToken: 'access_token', options: { timeout: 5000, idempotencyKey: 'abc' } });
const client = new MercadoPagoConfig({ accessToken: 'access_token', options: { timeout: 5000, idempotencyKey: 'abc' } });

// Step 3: Initialize the API object
const payment = new Payment(client);
Expand All @@ -56,10 +56,10 @@ payment.create({ body }).then(console.log).catch(console.log);

### Step 1: Import the parts of the module you want to use

Import `MercadoPago` and API objects from the MercadoPago module.
Import `MercadoPagoConfig` and API objects from the MercadoPago module.

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

### Step 2: Initialize the client object
Expand All @@ -73,7 +73,7 @@ Initialize the client object, passing the following:
For example:

``` javascript
const client = new MercadoPago({ accessToken: 'access_token', options: { timeout: 5000, idempotencyKey: 'abc' } });
const client = new MercadoPagoConfig({ accessToken: 'access_token', options: { timeout: 5000, idempotencyKey: 'abc' } });
```

### Step 3: Initialize the API 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
Loading

0 comments on commit 3248865

Please sign in to comment.