paggi 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -13
- data/lib/generators/paggi/install/templates/config/initializers/paggi.rb +1 -1
- data/lib/paggi/resource.rb +1 -1
- data/paggi.gemspec +2 -1
- data/test/test_helper.rb +1 -1
- data/test/test_mock.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18d6a5181a514f7e0faab310abec995a7529202f
|
4
|
+
data.tar.gz: 2db1523d2a0a5d301a6e6a71f572fe485c83b93a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97f1f67790d3605317af9f39026f5aa9801397b85bd48daf40dcf43ae97fca7a86ffb3e2affbc18fc0c87d4ebffacd37e91a45f88db3cabaf3fbea0229eafd24
|
7
|
+
data.tar.gz: 40923291cdbb50bf61427a164e0d51997c1b309253cd4676d0612488925b32fc70362628eeeb3f71d7d9711f859666fc7a973988a180c6d04c96d1abc57ac3e1
|
data/README.md
CHANGED
@@ -43,27 +43,27 @@ It is recommended to create a YAML configuration file and a Ruby initializer fil
|
|
43
43
|
# paggi.yml
|
44
44
|
development:
|
45
45
|
api_key: payos_test
|
46
|
-
host: http://localhost:
|
47
|
-
version: '
|
46
|
+
host: http://localhost:4000
|
47
|
+
version: 'v4'
|
48
48
|
staging:
|
49
49
|
api_key: B31DCE74-E768-43ED-86DA-85501612548F
|
50
|
-
host: https://
|
51
|
-
version: '
|
50
|
+
host: https://online.paggi.com
|
51
|
+
version: 'v4'
|
52
52
|
production:
|
53
53
|
api_key: B31DCE74-E768-43ED-86DA-85501612548F
|
54
|
-
host: https://
|
55
|
-
version: '
|
54
|
+
host: https://online.paggi.com
|
55
|
+
version: 'v4'
|
56
56
|
```
|
57
57
|
|
58
58
|
```ruby
|
59
59
|
# paggi.rb
|
60
|
-
|
61
|
-
|
60
|
+
PAGGI_ENV = ENV['PAGGI_ENV'] || ENV['RAILS_ENV'] || 'development'
|
61
|
+
PAGGI_CONFIG = YAML.load_file("#{Rails.root}/config/kiik.yml")[PAGGI_ENV]
|
62
62
|
|
63
|
-
|
64
|
-
config.host =
|
65
|
-
config.api_key =
|
66
|
-
config.version =
|
63
|
+
Paggi.setup do |config|
|
64
|
+
config.host = PAGGI_CONFIG['host']
|
65
|
+
config.api_key = PAGGI_CONFIG['api_key']
|
66
|
+
config.version = PAGGI_CONFIG['version']
|
67
67
|
end
|
68
68
|
```
|
69
69
|
|
@@ -73,7 +73,7 @@ end
|
|
73
73
|
|
74
74
|
```ruby
|
75
75
|
#Create customer
|
76
|
-
customer =
|
76
|
+
customer = Paggi::Customer.create({name: "User name", email: "user@email.com"})
|
77
77
|
```
|
78
78
|
|
79
79
|
### Production
|
@@ -1,5 +1,5 @@
|
|
1
1
|
PAGGI_ENV = ENV['PAGGI_ENV'] || ENV['RAILS_ENV'] || 'development'
|
2
|
-
PAGGI_CONFIG = YAML.load_file("#{Rails.root}/config/
|
2
|
+
PAGGI_CONFIG = YAML.load_file("#{Rails.root}/config/paggi.yml")[PAGGI_ENV]
|
3
3
|
|
4
4
|
Paggi.setup do |config|
|
5
5
|
config.host = PAGGI_CONFIG['host']
|
data/lib/paggi/resource.rb
CHANGED
@@ -11,7 +11,7 @@ module Paggi
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def url
|
14
|
-
"#{Paggi.configuration.host}api/#{Paggi.configuration.version}/#{Paggi::Util.underscore(class_name)}s"
|
14
|
+
"#{Paggi.configuration.host}/api/#{Paggi.configuration.version}/#{Paggi::Util.underscore(class_name)}s"
|
15
15
|
end
|
16
16
|
|
17
17
|
def opts(headers={})
|
data/paggi.gemspec
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
+
# coding: utf-8
|
1
2
|
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
|
2
3
|
|
3
4
|
Gem::Specification.new do |s|
|
4
5
|
s.name = 'paggi'
|
5
|
-
s.version = '0.1.
|
6
|
+
s.version = '0.1.1'
|
6
7
|
s.summary = 'Integrate Paggi with your Ruby app'
|
7
8
|
s.description = 'Paggi\'s official gem that helps you to integrate with our services. See https://docs.paggi.com for details.'
|
8
9
|
s.authors = ['Esdras Eduardo', 'Flávio Vieira']
|
data/test/test_helper.rb
CHANGED
data/test/test_mock.rb
CHANGED
@@ -7,7 +7,7 @@ module Paggi
|
|
7
7
|
headers = {
|
8
8
|
content_type: 'application/json'
|
9
9
|
}
|
10
|
-
uri = Paggi.configuration.api_key + ":@#{host}api/#{version}/#{url}"
|
10
|
+
uri = Paggi.configuration.api_key + ":@#{host}/api/#{version}/#{url}"
|
11
11
|
stub_request(method, uri)
|
12
12
|
.with(headers: headers)
|
13
13
|
.with(body: params)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paggi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esdras Eduardo
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-03-
|
12
|
+
date: 2017-03-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mocha
|
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
version: '0'
|
153
153
|
requirements: []
|
154
154
|
rubyforge_project:
|
155
|
-
rubygems_version: 2.
|
155
|
+
rubygems_version: 2.4.5.1
|
156
156
|
signing_key:
|
157
157
|
specification_version: 4
|
158
158
|
summary: Integrate Paggi with your Ruby app
|