Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RELEASE] 0.2.1 #10

Merged
merged 65 commits into from
Jan 27, 2018
Merged
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
7857fc6
Add customer new features(Listagem, Criação de cartão de credito, Exc…
danielfnz Dec 12, 2017
7a5b87c
Add bankaccount feature(Criação, Consulta, Listagem, Exclusão)
danielfnz Dec 12, 2017
0307ea2
Add account transparent feature(Criação e Consulta)
danielfnz Dec 12, 2017
67b6e82
Update readme
danielfnz Dec 12, 2017
1f295b8
Update readme
danielfnz Dec 12, 2017
573ee52
Refer account+ bankaccount on index.js
danielfnz Dec 12, 2017
35a39ef
Change account basic auth to OAuth
danielfnz Dec 12, 2017
16e6851
Update readme
danielfnz Dec 12, 2017
b7eee8f
Change bankAccount Basic Auth To OAuth
danielfnz Dec 12, 2017
fc56aa2
Update readme bankAccount
danielfnz Dec 12, 2017
a3f5ac5
Fix Extra semicolon semi
danielfnz Dec 12, 2017
6499422
Change patch bankaccount to bankAccount
danielfnz Dec 12, 2017
727b06d
Change patch bankaccount to bankAccount
danielfnz Dec 12, 2017
3ce9724
Change OAuth to accessToken (Pré-Requisito) and README.md
danielfnz Dec 12, 2017
d9236ce
Payment refund, Payment pre-autorized capture, Payment pre-autorized …
danielfnz Dec 14, 2017
c9fca97
Update readme(Pre-Authorization
danielfnz Dec 14, 2017
b142bf7
Update readme(Pre-Authorization
danielfnz Dec 14, 2017
d0339a4
Change Autorization -> Authorization
danielfnz Dec 14, 2017
204fcad
Merge pull request #2 from danielfnz/master
somentelucas Dec 14, 2017
5493c27
Merge pull request #4 from danielfnz/dev
somentelucas Dec 14, 2017
dcf66f7
Merge branch 'master' of https://github.com/moip/moip-sdk-node into d…
Dec 14, 2017
6439525
Updating Moip Account and Refund titles
Dec 14, 2017
4d5d33b
Adjusting indentation of Add Credit Card to Customer section
Dec 14, 2017
b392158
Merge pull request #5 from moip/updates_to_readme
somentelucas Dec 17, 2017
e1fb792
feat(connect): adding authorization URL and tests
Dec 18, 2017
6ff06f0
Removing unused header
Dec 18, 2017
cff807c
Linting
Dec 18, 2017
c5856a2
Fixing authorize payment simulation URL
Dec 18, 2017
4936d0d
Merge pull request #7 from moip/feat/connect
somentelucas Dec 19, 2017
4c30401
Changing to ES6 syntax
Jan 3, 2018
6a2c32b
Adding missing files that were not added in the previous commit
Jan 3, 2018
c2b9e48
Finding a way to get authorization
Jan 3, 2018
dcc1feb
Transforming customers to ES6
Jan 4, 2018
b10c1ac
Transforming Payments to ES6
Jan 5, 2018
a3f986b
Adding /dist to gitignore
Jan 5, 2018
ca592ed
Transforming Notifications in ES6
Jan 5, 2018
e9bb11c
Change connect to ES6 syntax
Jan 5, 2018
a329824
Transforming bank accounts to ES6
Jan 7, 2018
f181ddf
Adding credit card tests to customer
Jan 7, 2018
d7dbe41
Adding escrow
Jan 7, 2018
cd64643
Adding refund to order and refund tests
Jan 7, 2018
f5cee65
Transforming webhooks to ES6
Jan 7, 2018
6cc1e31
Refactoring how to initialize the SDK so it doesn't use global variables
Jan 23, 2018
4744365
Moving specs to root of the project and renaming to 'test'
Jan 24, 2018
4aaa845
Linting
Jan 24, 2018
2ae8127
Fixing Connect tests and adding code coverage
Jan 24, 2018
36e095e
Refactoring all the subscriptions endpoints to ES6
Jan 26, 2018
49efebe
Linting
Jan 26, 2018
9a9296b
Adding delay between refund tests
Jan 26, 2018
e8b3299
Setting delay also for order refund tests
Jan 26, 2018
6084203
Removing space
Jan 26, 2018
e63a322
Showing CI on Readme
Jan 26, 2018
3bd12d2
Adding coverage
Jan 26, 2018
70d73ef
Adding coverage
Jan 26, 2018
6161554
Configuring coverage to run locally
Jan 26, 2018
e2682ce
Adding /dist
Jan 26, 2018
202943f
Defaulting import to /dist
Jan 26, 2018
b381f2a
Updating examples in readme
Jan 26, 2018
55809b3
Translating readme to english
Jan 27, 2018
e4e204e
Reodering readme
Jan 27, 2018
48d7c49
Fixing readme links
Jan 27, 2018
f35c292
0.2.0
Jan 27, 2018
7d56436
Merge pull request #9 from moip/es6_2
somentelucas Jan 27, 2018
46eebe0
Changing package github url
Jan 27, 2018
337a249
0.2.1
Jan 27, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add bankaccount feature(Criação, Consulta, Listagem, Exclusão)
  • Loading branch information
danielfnz committed Dec 12, 2017
commit 7a5b87c9406fabb1d2a3f77273572ab16df2c553
97 changes: 97 additions & 0 deletions lib/bankaccount.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
var request = require('request')
var moip = require('./moip')

var basicAuth = null
var endpoint = null

var bankaccount = {}

bankaccount.create = function (_account_id, bankaccounts, callback) {
var options = {
url: endpoint.v2.url + '/accounts/'+_account_id+'/bankaccounts/',
headers: {
'Authorization': basicAuth
},
method: 'POST',
body: account,
json: true
}

request(options, function (error, response, body) {
if (body) {
callback(error, body, response)
} else {
callback(error)
}
})
}

bankaccount.getOne = function (_id, callback) {
var options = {
url: endpoint.v2.url + '/bankaccounts/' + _id,
headers: {
'Authorization': basicAuth
},
method: 'GET',
json: true
}

request(options, function (error, response, body) {
if (body) {
callback(error, body, response)
} else {
callback(error)
}
})
}

bankaccount.getAll = function (_id, callback) {
var options = {
url: endpoint.v2.url + '/accounts/' + _id+'/bankaccounts',
headers: {
'Authorization': basicAuth
},
method: 'GET',
json: true
}

request(options, function (error, response, body) {
if (body) {
callback(error, body, response)
} else {
callback(error)
}
})
}

bankaccount.deleteOne = function (_id, callback) {
var options = {
url: endpoint.v2.url + '/bankaccounts/' + _id,
headers: {
'Authorization': basicAuth
},
method: 'DELETE',
json: true
}

request(options, function (error, response, body) {
if (body) {
callback(error, body, response)
} else {
callback(error)
}
})
}


module.exports = function (_basicAuth, _production) {
basicAuth = _basicAuth

if (_production) {
endpoint = moip.production
} else {
endpoint = moip.sandbox
}

return bankaccount
}