gn-api-sdk-node
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -0,1 +1,10 @@ | ||
# 0.0.8 | ||
- Updated: docs | ||
- Updated: getPaymentMethods endpoint now is getPaymentData | ||
# 0.0.7 | ||
- Updated: node modules dependencies | ||
# 0.0.6 | ||
@@ -2,0 +11,0 @@ |
@@ -38,3 +38,3 @@ ## Create charge, customer, payment | ||
credit_card: { | ||
parcels: 1, | ||
installments: 1, | ||
payment_token: 'fec500b1f3eb16615ca61f7c4781f51dcde49131', | ||
@@ -41,0 +41,0 @@ billing_address: { |
@@ -47,3 +47,3 @@ ## Creating charges with marketplace | ||
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*. | ||
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*. | ||
@@ -50,0 +50,0 @@ 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. |
@@ -36,7 +36,2 @@ 'use strict'; | ||
var paymentMethodInput = { | ||
method: 'visa', | ||
total: 5000 | ||
} | ||
var paymentInput = { | ||
@@ -46,4 +41,4 @@ charge_id: 223, | ||
credit_card: { | ||
parcels: 1, | ||
payment_token: 'fec500b1f3eb16615ca61f7c4781f51dcde49131', | ||
installments: 1, | ||
payment_token: '71d0821e79e5d54e17472a9ef1dce3d0a715a39d', | ||
billing_address: { | ||
@@ -50,0 +45,0 @@ street: 'Street 3', |
@@ -10,7 +10,7 @@ ## Paying charges | ||
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. | ||
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. | ||
### 1. Boletos | ||
### 1. Banking billets | ||
Generating a bol from a charge is deadly simple. Provide the charge id and an optional expiration date: | ||
Generating banking billets from a charge is deadly simple. Provide the charge id and an optional expiration date: | ||
@@ -25,3 +25,3 @@ ```js | ||
payment: { | ||
bol: { | ||
banking_billet: { | ||
expire_at: tenDaysFromNow | ||
@@ -39,3 +39,3 @@ } | ||
If you don't need to supply the `expire_at` attribute, keep the `bol` object empty like this: | ||
If you don't need an expiration date, keep the `banking_billet` object empty like this: | ||
@@ -46,3 +46,3 @@ ```js | ||
payment: { | ||
bol: {} | ||
banking_billet: {} | ||
} | ||
@@ -52,3 +52,3 @@ } | ||
You'll receive the payment info in the callback, such as the barcode and the bol link: | ||
You'll receive the payment info in the callback, such as the barcode and the billet link: | ||
@@ -61,3 +61,3 @@ ```js | ||
"total": 1150, | ||
"payment": "bol", | ||
"payment": "banking_billet", | ||
"barcode": "00190.00009 01523.894002 00059.161182 9 64350000001150", | ||
@@ -72,3 +72,3 @@ "link": "https://visualizacao.gerencianet.com.br/emissao/28333_2139_RRABRA7/A4XB-28333-59161-BRANAE4", | ||
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. | ||
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. | ||
@@ -105,3 +105,3 @@ 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. | ||
If everything went well, the response will come with the total value, installments number e the value of each installment: | ||
If everything went well, the response will come with the total value, installments number and the value of each installment: | ||
@@ -108,0 +108,0 @@ ```js |
@@ -14,3 +14,3 @@ 'use strict'; | ||
pay: '/payment/pay', | ||
paymentMethods: '/payment/methods', | ||
paymentData: '/payment/data', | ||
notification: '/notification', | ||
@@ -17,0 +17,0 @@ updateNotification: '/notification/update', |
@@ -41,6 +41,6 @@ 'use strict'; | ||
GnSdk.prototype.getPaymentMethods = function (options) { | ||
return this.endpoints.run('paymentMethods', options); | ||
GnSdk.prototype.getPaymentData = function (options) { | ||
return this.endpoints.run('paymentData', options); | ||
}; | ||
module.exports = GnSdk; |
{ | ||
"name": "gn-api-sdk-node", | ||
"description": "Module for integration with Gerencianet API", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"author": "Francisco Carvalho <f.thiene@gmail.com>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -101,2 +101,3 @@ # gn-api-sdk-node | ||
## Additional docs | ||
- [Creating charges with shippings](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/charge-with-shippings.md) | ||
@@ -108,3 +109,3 @@ - [Creating charges associated to customers](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/charge-with-customer.md) | ||
- [Detailing charges and subscriptions](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/detailing.md) | ||
- [Listing installments in advance](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/payment-methods.md) | ||
- [Listing installments in advance](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/payment-data.md) | ||
- [Paying a charge](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/payments.md) | ||
@@ -111,0 +112,0 @@ - [Notifications](https://github.com/franciscotfmc/gn-api-sdk-node/tree/master/docs/notifications.md) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50803
120
797