billplz 0.1.0 → 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/CODE_OF_CONDUCT.md +1 -1
- data/Gemfile +0 -2
- data/LICENSE.txt +1 -1
- data/README.md +19 -15
- data/Rakefile +0 -6
- data/billplz.gemspec +3 -7
- data/bin/console +1 -8
- data/lib/billplz/model.rb +2 -0
- data/lib/billplz/version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7bc2357c211f99e8bcb0bd4918f5e45cdd75a4f9
|
|
4
|
+
data.tar.gz: d7b1d3a4472c00408f05b89375c075827523c4b3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 93d382a657af60e32b115152db55f5a4d405df0dcf1844e49b0361ba5405769590ea65801bbf687f3df8988e699687ba903cd1c8501d68e1e3d5089d2b2d2943
|
|
7
|
+
data.tar.gz: 805ab40c6c00412ba1b21a46aeebcfe9ac03b33a95db5511972929bb26e35dd048f4403fb315931915ff7bd8ce456168531a6e2f7524548bf10dab6940a7cf2c
|
data/CODE_OF_CONDUCT.md
CHANGED
|
@@ -35,7 +35,7 @@ This code of conduct applies both within project spaces and in public spaces
|
|
|
35
35
|
when an individual is representing the project or its community.
|
|
36
36
|
|
|
37
37
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
38
|
-
reported by contacting a project maintainer at
|
|
38
|
+
reported by contacting a project maintainer at syamilmj@tideee.com. All
|
|
39
39
|
complaints will be reviewed and investigated and will result in a response that
|
|
40
40
|
is deemed necessary and appropriate to the circumstances. Maintainers are
|
|
41
41
|
obligated to maintain confidentiality with regard to the reporter of an
|
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Billplz
|
|
2
2
|
|
|
3
|
+
[](https://badge.fury.io/rb/billplz)
|
|
3
4
|
[](https://circleci.com/gh/syamilmj/billplz)
|
|
5
|
+
[](https://codeclimate.com/github/syamilmj/billplz)
|
|
4
6
|
|
|
5
7
|
An abstraction library to interface with the [Billplz API](https://www.billplz.com/api)
|
|
6
8
|
|
|
@@ -14,11 +16,15 @@ gem 'billplz'
|
|
|
14
16
|
|
|
15
17
|
And then execute:
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
```
|
|
20
|
+
$ bundle
|
|
21
|
+
```
|
|
18
22
|
|
|
19
23
|
Or install it yourself as:
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
```
|
|
26
|
+
$ gem install billplz
|
|
27
|
+
```
|
|
22
28
|
|
|
23
29
|
## Usage
|
|
24
30
|
|
|
@@ -29,14 +35,14 @@ You may store your Billplz configuration during runtime:
|
|
|
29
35
|
```ruby
|
|
30
36
|
# config/initializers/billplz.rb
|
|
31
37
|
Billplz.configure do |config|
|
|
32
|
-
config.api_key
|
|
38
|
+
config.api_key = ENV['BILLPLZ_API_KEY']
|
|
33
39
|
end
|
|
34
40
|
```
|
|
35
41
|
|
|
36
42
|
All the options above can be overridden manually:
|
|
37
43
|
|
|
38
44
|
```ruby
|
|
39
|
-
Billplz.configuration.api_key
|
|
45
|
+
Billplz.configuration.api_key = 'your-api-key'
|
|
40
46
|
```
|
|
41
47
|
|
|
42
48
|
Or, as a hash:
|
|
@@ -83,28 +89,26 @@ Standard Net::HTTP response will be returned by all of the above methods. Howeve
|
|
|
83
89
|
|
|
84
90
|
1. `#success?`
|
|
85
91
|
|
|
86
|
-
You can check for a successfull request using `success?`, example:
|
|
92
|
+
You can check for a successfull request using `success?`, example:
|
|
87
93
|
|
|
88
|
-
```
|
|
89
|
-
bill.success?
|
|
90
|
-
```
|
|
94
|
+
```
|
|
95
|
+
bill.success?
|
|
96
|
+
```
|
|
91
97
|
|
|
92
98
|
2. `#parsed_json`
|
|
93
99
|
|
|
94
|
-
|
|
100
|
+
A convenient helper to parse the JSON response from the API, example:
|
|
95
101
|
|
|
96
|
-
```ruby
|
|
97
|
-
bill_id = bill.parsed_json['id']
|
|
98
|
-
```
|
|
102
|
+
```ruby
|
|
103
|
+
bill_id = bill.parsed_json['id']
|
|
104
|
+
```
|
|
99
105
|
|
|
100
106
|
## Development
|
|
101
107
|
|
|
102
|
-
|
|
108
|
+
Run `rake test` to run the unit tests.
|
|
103
109
|
|
|
104
110
|
Running `rake test:remote` will run tests that performs actual communication with the API server. Proceed with caution.
|
|
105
111
|
|
|
106
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
107
|
-
|
|
108
112
|
## Contributing
|
|
109
113
|
|
|
110
114
|
Bug reports and pull requests are welcome on GitHub at https://github.com/syamilmj/billplz. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
data/Rakefile
CHANGED
data/billplz.gemspec
CHANGED
|
@@ -8,19 +8,15 @@ Gem::Specification.new do |spec|
|
|
|
8
8
|
spec.version = Billplz::VERSION
|
|
9
9
|
|
|
10
10
|
spec.summary = 'Abstraction library to interface with the Billplz API'
|
|
11
|
-
spec.homepage = 'http://tideee.com'
|
|
12
11
|
spec.license = 'MIT'
|
|
13
|
-
|
|
14
12
|
spec.author = 'Syamil MJ'
|
|
15
13
|
spec.email = 'syamilmj@tideee.com'
|
|
16
|
-
spec.homepage = '
|
|
14
|
+
spec.homepage = 'https://github.com/tideee/billplz'
|
|
17
15
|
|
|
18
16
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
19
|
-
spec.bindir = "exe"
|
|
20
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
21
17
|
spec.require_paths = ["lib"]
|
|
22
18
|
|
|
23
19
|
spec.add_development_dependency "rake"
|
|
24
|
-
spec.add_development_dependency "test-unit"
|
|
25
|
-
spec.add_development_dependency "mocha"
|
|
20
|
+
spec.add_development_dependency "test-unit", "~> 1"
|
|
21
|
+
spec.add_development_dependency "mocha", "~> 3"
|
|
26
22
|
end
|
data/bin/console
CHANGED
|
@@ -2,13 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require "bundler/setup"
|
|
4
4
|
require "billplz"
|
|
5
|
-
|
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
-
|
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
-
# require "pry"
|
|
11
|
-
# Pry.start
|
|
12
|
-
|
|
13
5
|
require "irb"
|
|
6
|
+
|
|
14
7
|
IRB.start
|
data/lib/billplz/model.rb
CHANGED
|
@@ -61,6 +61,8 @@ module Billplz
|
|
|
61
61
|
def http
|
|
62
62
|
http = Net::HTTP.new(endpoint.host, endpoint.port)
|
|
63
63
|
http.use_ssl = true
|
|
64
|
+
http.open_timeout = Billplz.configuration.http_timeout
|
|
65
|
+
http.read_timeout = Billplz.configuration.http_timeout
|
|
64
66
|
# http.set_debug_output($stdout)
|
|
65
67
|
http
|
|
66
68
|
end
|
data/lib/billplz/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: billplz
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Syamil MJ
|
|
8
8
|
autorequire:
|
|
9
|
-
bindir:
|
|
9
|
+
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-01-
|
|
11
|
+
date: 2016-01-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -28,30 +28,30 @@ dependencies:
|
|
|
28
28
|
name: test-unit
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
33
|
+
version: '1'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- - "
|
|
38
|
+
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
40
|
+
version: '1'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: mocha
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - "
|
|
45
|
+
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
47
|
+
version: '3'
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- - "
|
|
52
|
+
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
54
|
+
version: '3'
|
|
55
55
|
description:
|
|
56
56
|
email: syamilmj@tideee.com
|
|
57
57
|
executables: []
|
|
@@ -74,7 +74,7 @@ files:
|
|
|
74
74
|
- lib/billplz/configuration.rb
|
|
75
75
|
- lib/billplz/model.rb
|
|
76
76
|
- lib/billplz/version.rb
|
|
77
|
-
homepage:
|
|
77
|
+
homepage: https://github.com/tideee/billplz
|
|
78
78
|
licenses:
|
|
79
79
|
- MIT
|
|
80
80
|
metadata: {}
|