gerencianet 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/docs/carnets.md +1 -3
- data/docs/charge-payment.md +0 -2
- data/docs/notifications.md +2 -2
- data/lib/gerencianet/endpoints.rb +2 -2
- data/lib/gerencianet/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4744fd39da6069121f6b26fc00fc5686a17c6c46
|
|
4
|
+
data.tar.gz: f332ff2d980523067c427ef9740b8dcbdd272811
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 230ebd680bae00a7df08a6ff685f88b10b19f7d56ab3e6f04391912a67ba150c2b6fa206b6ef243713c3bf51a87f0d66be101347b5e31a6ab4b5541ca34c9ecb
|
|
7
|
+
data.tar.gz: c55a4ff747e5ee479882a8667ae5e81f722cc3ab3a7b34e9304a640f0f5c516968a9a1b58787cfcf78d0038b07dcd5a1f99307a9ff7b7da72222adee077fcaff
|
data/CHANGELOG.md
CHANGED
data/docs/carnets.md
CHANGED
|
@@ -62,9 +62,7 @@ body = {
|
|
|
62
62
|
|
|
63
63
|
The `notification_url` property will be used for sending notifications once things happen with charges statuses, as when it's payment was approved, for example. More about notifications [here](https://github.com/gerencianet/gn-api-sdk-node/tree/master/docs/notifications.md). The `custom_id` property can be used to set your own reference to the carnet.
|
|
64
64
|
|
|
65
|
-
### Required properties
|
|
66
|
-
|
|
67
|
-
If you don't provide the expiration date of the first charge, the defaut value will be the current day + 8.
|
|
65
|
+
### Required properties:
|
|
68
66
|
|
|
69
67
|
```ruby
|
|
70
68
|
body = {
|
data/docs/charge-payment.md
CHANGED
|
@@ -35,8 +35,6 @@ gerencianet = Gerencianet.new(options)
|
|
|
35
35
|
gerencianet.pay_charge(params: params, body: body)
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
If you don't set the `expire_at` attribute, the date will be the current day + 3.
|
|
39
|
-
|
|
40
38
|
You'll receive the payment info in the callback, such as the barcode and the billet link:
|
|
41
39
|
|
|
42
40
|
```ruby
|
data/docs/notifications.md
CHANGED
|
@@ -9,11 +9,11 @@ Given that a charge has a valid `notification_url`, when the notification time c
|
|
|
9
9
|
The example below assumes that you're using a **Rails** app. It's easier showing than explaining with words:
|
|
10
10
|
|
|
11
11
|
```ruby
|
|
12
|
-
class
|
|
12
|
+
class NotificationController < ApplicationController
|
|
13
13
|
# this is a post route
|
|
14
14
|
def notification_route
|
|
15
15
|
params = {
|
|
16
|
-
token: params[:
|
|
16
|
+
token: params[:notification]
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
gerencianet = Gerencianet.new(options)
|
|
@@ -110,7 +110,7 @@ module Gerencianet
|
|
|
110
110
|
mapped = map_params(params)
|
|
111
111
|
|
|
112
112
|
if !mapped.empty?
|
|
113
|
-
"#{@base_url}#{route}?#{
|
|
113
|
+
"#{@base_url}#{route}?#{mapped}"
|
|
114
114
|
else
|
|
115
115
|
"#{@base_url}#{route}"
|
|
116
116
|
end
|
|
@@ -118,7 +118,7 @@ module Gerencianet
|
|
|
118
118
|
|
|
119
119
|
def map_params(params)
|
|
120
120
|
params.map do |key|
|
|
121
|
-
"#{key[0]}=#{key[1]}"
|
|
121
|
+
"#{key[0]}=#{CGI.escape(key[1].to_s)}"
|
|
122
122
|
end.join("&")
|
|
123
123
|
end
|
|
124
124
|
|
data/lib/gerencianet/version.rb
CHANGED