gerencianet 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b16286d4676a7d5afef9965e27828c11f510320
4
- data.tar.gz: bd24b83493656bed754715cf849700be2f5ff02f
3
+ metadata.gz: 4744fd39da6069121f6b26fc00fc5686a17c6c46
4
+ data.tar.gz: f332ff2d980523067c427ef9740b8dcbdd272811
5
5
  SHA512:
6
- metadata.gz: db9979088c3c55ab17b98c91a0e426b033cec75898c3d0b93b7b6343dfe7a02f1573e551d5a914c749ad05113d2198d26e3baf542bbf4687cd9cc978f242d732
7
- data.tar.gz: 3dfc5c09a6f11b48e1da299da06d247fe89b5b5030590668f4abf364c3140969315998584b40522014b8e38ad1ed4c51bf5156305d3f0c0a3e237326e7cdd108
6
+ metadata.gz: 230ebd680bae00a7df08a6ff685f88b10b19f7d56ab3e6f04391912a67ba150c2b6fa206b6ef243713c3bf51a87f0d66be101347b5e31a6ab4b5541ca34c9ecb
7
+ data.tar.gz: c55a4ff747e5ee479882a8667ae5e81f722cc3ab3a7b34e9304a640f0f5c516968a9a1b58787cfcf78d0038b07dcd5a1f99307a9ff7b7da72222adee077fcaff
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.0.4
2
+
3
+ - Added: Custom http header
4
+
1
5
  # 0.0.3
2
6
 
3
7
  - Changed: Encode url params for get methods
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 plus expiration date of the first charge **(optional)**:
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 = {
@@ -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
@@ -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 TicketsController < ApplicationController
12
+ class NotificationController < ApplicationController
13
13
  # this is a post route
14
14
  def notification_route
15
15
  params = {
16
- token: params[:token]
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}?#{CGI.escape(mapped)}"
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
 
@@ -1,4 +1,4 @@
1
1
  # :nodoc:
2
2
  module Gerencianet
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gerencianet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francisco Carvalho