neon_api 0.1.1 → 0.1.2
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/README.md +4 -3
- data/lib/neon_api/client.rb +4 -1
- data/lib/neon_api/configuration.rb +2 -2
- data/lib/neon_api/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: b9cbcc594765a8c810227d2f29af457059aff266
|
4
|
+
data.tar.gz: 9e3506ceabc14c6c207668b06ee9d99d826b204b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f09560d2d7052d5c9d93d47322019608857d56f464520de9d6465b02677001bb305ad5a19d4f14213a6c343b661a6e0ac8601a85471abdb9d87bfc9229b455fb
|
7
|
+
data.tar.gz: a4a08ee849df72b3ea945a3bb715c7371d74a5d775ee2d097665f38a844b7931750b72a24b42e13a9ed3cb6bdefd20e352599ced74154886dda3aff09d44c8f7
|
data/README.md
CHANGED
@@ -31,9 +31,10 @@ NeonApi.configure do |config|
|
|
31
31
|
config.token = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
|
32
32
|
config.username = 'user@name.com'
|
33
33
|
config.password = 'password'
|
34
|
-
config.
|
35
|
-
config.
|
36
|
-
config.
|
34
|
+
config.proxy = 'http://dasd:asd@asd.asd.com:80' # neon needs a fixed outbound ip
|
35
|
+
config.encrypt_pem = 'public_encrypt.pem' # path to your encryption pem
|
36
|
+
config.decrypt_pem = 'public_decrypt.pem' # path to your decryption pem
|
37
|
+
config.environment = :development # environment :development of :production
|
37
38
|
end
|
38
39
|
```
|
39
40
|
|
data/lib/neon_api/client.rb
CHANGED
@@ -8,7 +8,7 @@ module NeonApi
|
|
8
8
|
class Client
|
9
9
|
attr_accessor :url, :environment, :payload, :token, :last_authenticated_at, :response,
|
10
10
|
:auth_token, :aes_key, :aes_iv, :expire_time, :client_id, :bank_account, :response
|
11
|
-
def initialize(environment = :development, token, login, password, encrypt_pem, decrypt_pem)
|
11
|
+
def initialize(environment = :development, token, login, password, encrypt_pem, decrypt_pem, proxy)
|
12
12
|
@base_url = if production?
|
13
13
|
'https://apiparceiros.banconeon.com.br/ '
|
14
14
|
else
|
@@ -21,6 +21,9 @@ module NeonApi
|
|
21
21
|
@password = password
|
22
22
|
@encrypt_pem = encrypt_pem
|
23
23
|
@decrypt_pem = decrypt_pem
|
24
|
+
@proxy = proxy
|
25
|
+
|
26
|
+
RestClient.proxy = @proxy if @proxy
|
24
27
|
end
|
25
28
|
|
26
29
|
def authenticate
|
@@ -15,10 +15,10 @@ module NeonApi
|
|
15
15
|
|
16
16
|
# Configuration
|
17
17
|
class Configuration
|
18
|
-
attr_accessor :environment, :token, :client, :username, :password, :encrypt_pem, :decrypt_pem
|
18
|
+
attr_accessor :environment, :token, :client, :username, :password, :encrypt_pem, :decrypt_pem, :proxy
|
19
19
|
|
20
20
|
def client_setup
|
21
|
-
@client ||= Client.new(environment, token, username, password, encrypt_pem, decrypt_pem)
|
21
|
+
@client ||= Client.new(environment, token, username, password, encrypt_pem, decrypt_pem, proxy)
|
22
22
|
@client.authenticate
|
23
23
|
end
|
24
24
|
end
|
data/lib/neon_api/version.rb
CHANGED