Skip to content

Commit e395041

Browse files
committed
Update docs
1 parent d225d3a commit e395041

File tree

9 files changed

+39
-34
lines changed

9 files changed

+39
-34
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# 0.0.8
2+
3+
- Updated: docs
4+
- Updated: getPaymentMethods endpoint now is getPaymentData
5+
6+
# 0.0.7
7+
8+
- Updated: node modules dependencies
9+
110
# 0.0.6
211

312
- Fixed: nock net connection issues

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,14 @@ $ npm test
9898
```
9999

100100
## Additional docs
101+
101102
- [Creating charges with shippings](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/charge-with-shippings.md)
102103
- [Creating charges associated to customers](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/charge-with-customer.md)
103104
- [Creating charges with marketplace](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/charge-with-marketplace.md)
104105
- [Associating customers to charges subsequently](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/associate-customer.md)
105106
- [Subscriptions](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/subscriptions.md)
106107
- [Detailing charges and subscriptions](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/detailing.md)
107-
- [Listing installments in advance](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/payment-methods.md)
108+
- [Listing installments in advance](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/payment-data.md)
108109
- [Paying a charge](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/payments.md)
109110
- [Notifications](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/notifications.md)
110111
- [All in one](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/all-in-one.md)

docs/all-in-one.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var paymentInput = {
3535
charge_id: 223,
3636
payment: {
3737
credit_card: {
38-
parcels: 1,
38+
installments: 1,
3939
payment_token: 'fec500b1f3eb16615ca61f7c4781f51dcde49131',
4040
billing_address: {
4141
street: 'Street 3',

docs/charge-with-marketplace.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ gerencianet
4444
.catch(console.log);
4545
```
4646

47-
The attribute `payee_code` identifies a Gerencianet account, just like in [creating charges with shippings](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/charge-with-shippings.md). In order to get someone else's `payee_code` you need to ask the account owner. There is no other way. To visualize yours, log in your Gerencianet account and search for *account code* under *Dados Cadastrais*.
47+
The attribute `payee_code` identifies a Gerencianet account, just like in [creating charges with shippings](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/charge-with-shippings.md). In order to get someone else's `payee_code` you need to ask the account owner. There is no other way. To visualize yours, log in your Gerencianet account and search for *Identificador de Conta* under *Dados Cadastrais*.
4848

4949
In the example above, there are two repasses, both of 25%, but each one for a different account, whereas the `payee_code` differs. The integrator account will receive, at the end, 50% of the total value. Disregarding the rates, the integrator account would receive R$5,00. The other two accounts would receive R$ 2,50 each.
5050

docs/examples/allInOne.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,12 @@ var customerInput = {
3333
phone_number: '5044916523'
3434
}
3535

36-
var paymentMethodInput = {
37-
method: 'visa',
38-
total: 5000
39-
}
40-
4136
var paymentInput = {
4237
charge_id: 223,
4338
payment: {
4439
credit_card: {
45-
parcels: 1,
46-
payment_token: 'fec500b1f3eb16615ca61f7c4781f51dcde49131',
40+
installments: 1,
41+
payment_token: '71d0821e79e5d54e17472a9ef1dce3d0a715a39d',
4742
billing_address: {
4843
street: 'Street 3',
4944
number: 10,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var tomorrow = moment()
1717
var paymentInput = {
1818
charge_id: 242,
1919
payment: {
20-
bol: {
20+
banking_billet: {
2121
expire_at: tomorrow
2222
}
2323
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ var options = {
1010
sandbox: true
1111
}
1212

13-
var paymentMethodInput = {
14-
method: 'visa',
13+
var paymentDataInput = {
14+
type: 'visa',
1515
total: 5000
1616
}
1717

1818
var gerencianet = new Gerencianet(options);
1919

2020
gerencianet
21-
.getPaymentMethods(paymentMethodInput)
21+
.getPaymentData(paymentDataInput)
2222
.then(function (installments) {
2323
console.log('Response:',
2424
util.inspect(installments, false, null));
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Payment methods - listing installments
1+
## Payment data - listing installments
22

33
If you ever need to get the total value for a charge, including rates and interests, as well as each installment value, even before the payment itself, you can.
44

@@ -9,15 +9,15 @@ Sometimes you need to check the total for making a discount, or simple to show a
99
Stop bragging about. Here is the code:
1010

1111
```js
12-
var paymentMethodInput = {
13-
method: 'visa',
12+
var paymentDataInput = {
13+
type: 'visa',
1414
total: 5000
1515
}
1616

1717
var gerencianet = new Gerencianet(options);
1818

1919
gerencianet
20-
.getPaymentMethods(paymentMethodInput)
20+
.getPaymentData(paymentDataInput)
2121
.then(console.log)
2222
.catch(console.log);
2323
```
@@ -27,7 +27,7 @@ And the response:
2727
```js
2828
{
2929
"code": 200,
30-
"method": {
30+
"data": {
3131
"rate": 150,
3232
"interest_percentage": 0,
3333
"name": "visa",
@@ -109,13 +109,13 @@ And the response:
109109
}
110110
```
111111

112-
Observe that the response comes with an installments array of 12 positions. Each position matches one possible option of installment number, containing its value in currency and integer forms. Use it any way you need.
112+
Observe that the response comes with an installments array of 12 positions at maximum. Each position matches one possible option of installment number, containing its value in currency and integer forms. The number of installments will vary according to the selected brand. Use it any way that suits your needs.
113113

114114
If you're curious about what would happen if you did this:
115115

116116
```js
117-
var paymentMethodInput = {
118-
method: 'bol',
117+
var paymentDataInput = {
118+
type: 'banking_billet',
119119
total: 5000
120120
}
121121
```
@@ -125,12 +125,12 @@ Here it goes:
125125
```js
126126
{
127127
"code": 200,
128-
"method": {
128+
"data": {
129129
"total": 5150,
130130
"rate": 150,
131131
"currency": "51,50"
132132
}
133133
}
134134
```
135135

136-
As the payment method being a boleto, the response comes with just the total value and the rate that was applied. The total value comes also parsed in currency, just in case.
136+
As the payment type being *banking billet*, the response comes with just the total value and the rate that was applied. The total value comes also parsed in currency, just in case.

docs/payments.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ var Gerencianet = require('gn-api-sdk-node');
77
var gerencianet = new Gerencianet(options);
88
```
99

10-
There are two ways of giving sequence to a charge. One can generate a boleto so it is payable until its due date, or one can use its credit card to approve the payment.
10+
There are two ways of giving sequence to a charge. One can generate a **banking billet** so it is payable until its due date, or one can use its **credit card** to approve the payment.
1111

12-
### 1. Boletos
12+
### 1. Banking billets
1313

14-
Generating a bol from a charge is deadly simple. Provide the charge id and an optional expiration date:
14+
Generating banking billets from a charge is deadly simple. Provide the charge id and an optional expiration date:
1515

1616
```js
1717
var tenDaysFromNow = moment()
@@ -21,7 +21,7 @@ var tenDaysFromNow = moment()
2121
var paymentInput = {
2222
charge_id: 242,
2323
payment: {
24-
bol: {
24+
banking_billet: {
2525
expire_at: tenDaysFromNow
2626
}
2727
}
@@ -34,26 +34,26 @@ gerencianet
3434
.done();
3535
```
3636

37-
If you don't need to supply the `expire_at` attribute, keep the `bol` object empty like this:
37+
If you don't need an expiration date, keep the `banking_billet` object empty like this:
3838

3939
```js
4040
var paymentInput = {
4141
charge_id: 242,
4242
payment: {
43-
bol: {}
43+
banking_billet: {}
4444
}
4545
}
4646
```
4747

48-
You'll receive the payment info in the callback, such as the barcode and the bol link:
48+
You'll receive the payment info in the callback, such as the barcode and the billet link:
4949

5050
```js
5151
{
5252
"code": 200,
5353
"response": {
5454
"transaction": 137,
5555
"total": 1150,
56-
"payment": "bol",
56+
"payment": "banking_billet",
5757
"barcode": "00190.00009 01523.894002 00059.161182 9 64350000001150",
5858
"link": "https://visualizacao.gerencianet.com.br/emissao/28333_2139_RRABRA7/A4XB-28333-59161-BRANAE4",
5959
"expire_at": "2015-05-21"
@@ -63,7 +63,7 @@ You'll receive the payment info in the callback, such as the barcode and the bol
6363

6464
### 2. Credit card
6565

66-
The most common payment method is to use a credit card in order to make things happen faster. Paying a charge with a credit card in Gerencianet is as simples as generating a boleto, as seen above.
66+
The most common payment method is to use a credit card in order to make things happen faster. Paying a charge with a credit card in Gerencianet is as simples as generating a banking billet, as seen above.
6767

6868
The difference here is that we need to provide some extra information, as a `billing_address` and a `payment_token`. The former is used to make an anti-fraud analyze before accepting/appoving the payment, the latter identifies a credit card at Gerencianet, so that you don't need to bother about keeping track of credit card numbers. The `installments` attribute is self-explanatory.
6969

@@ -95,7 +95,7 @@ gerencianet
9595
.done();
9696
```
9797

98-
If everything went well, the response will come with the total value, installments number e the value of each installment:
98+
If everything went well, the response will come with the total value, installments number and the value of each installment:
9999

100100
```js
101101
{

0 commit comments

Comments
 (0)