proxypay 0.2.0 → 0.2.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 +44 -15
- data/lib/proxypay.rb +18 -15
- data/lib/proxypay/version.rb +1 -1
- data/proxypay-0.2.0.gem +0 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc946694f10a39fd9c0ad3abc069a1cbd2dfe86e
|
4
|
+
data.tar.gz: 7cdc43d75e8cf8f4de861d96e9ac4132cf4cbe91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2f78b2ec08c2f79ade238e7e4ee0cd28c26bd0be5f17be2f1edede609e16945615ebc6d6d5852b4be31dd3e9e6835458cd37de28e98520a90829c19dddd9685
|
7
|
+
data.tar.gz: ed13d322202e59943814c5cd3486298f6b72b1f7294e5e04114f606f52a041b581394070da6ce75a1cbb086746e4fc88ffedc4c81e8b88537d666b9cb48b9a9f
|
data/README.md
CHANGED
@@ -28,51 +28,80 @@ PROXYPAY_API_KEY=your_api_key_obtained_from_proxypay_folks
|
|
28
28
|
|
29
29
|
## Usage
|
30
30
|
|
31
|
-
|
32
|
-
## Use the class methods to get it going
|
31
|
+
### Use the class methods to get it going
|
33
32
|
|
34
|
-
|
35
|
-
|
33
|
+
## References
|
34
|
+
### Fetch all available references
|
35
|
+
```ruby
|
36
36
|
Proxypay.get_references
|
37
|
+
```
|
38
|
+
### Fetch references by using query's
|
39
|
+
or you can pass one or several query's parameters and even use the custom_fields defined at proxypay.
|
40
|
+
```ruby
|
41
|
+
options = {status:"paid", offset:15, limit:13, q:{custom_fields:{your_fild:"some_data", some_other_filed:{that_takes:"an_hash"}}}}
|
42
|
+
Proxypay.get_reference(options)
|
43
|
+
```
|
37
44
|
|
38
|
-
|
45
|
+
### Request a new reference - amount and expiration_date for the reference are mandatory
|
46
|
+
```ruby
|
39
47
|
Proxypay.new_reference("2000.00", "2015-10-10")
|
48
|
+
```
|
40
49
|
|
41
|
-
|
50
|
+
### Request a reference and add custom fields to your reference for your identification.
|
51
|
+
```ruby
|
42
52
|
other_data = {invoice:"001-2015", description:"Client #{client_number} - monthly payment"}
|
43
53
|
Proxypay.new_reference("2000.00", "2015-10-10", other_data)
|
54
|
+
```
|
44
55
|
|
45
|
-
|
56
|
+
### Request a reference and add custom fields to your reference for your identification on using a specific API_KEY
|
57
|
+
```ruby
|
46
58
|
other_data = {invoice:"001-2015", description:"Client #{client_number} - monthly payment"}
|
47
59
|
api_key = "OcSLBANU4tjRi9gfW5VUcMqkvzLOcSLBANU4tjRi9gfW5VUcMqkvzL"
|
48
60
|
Proxypay.other_new_reference("2000.00", "2015-10-10", other_data, api_key)
|
61
|
+
```
|
49
62
|
|
50
|
-
|
51
|
-
|
63
|
+
## Payments
|
64
|
+
### Fetch all payments that haven't been acknowledged
|
65
|
+
```ruby
|
52
66
|
Proxypay.get_payments
|
67
|
+
```
|
68
|
+
### Fetch all the payments with limitation by the specified number(quantity)
|
69
|
+
```ruby
|
70
|
+
options = {n:48}
|
71
|
+
Proxypay.get_payments(options)
|
72
|
+
```
|
53
73
|
|
54
|
-
|
74
|
+
### Fetch all payments that haven't been acknowledged for an specific API KEY
|
75
|
+
```ruby
|
55
76
|
api_key = "OcSLBANU4tjRi9gfW5VUcMqkvzLOcSLBANU4tjRi9gfW5VUcMqkvzL"
|
56
77
|
Proxypay.other_get_payments(api_key)
|
78
|
+
```
|
57
79
|
|
58
|
-
|
80
|
+
### Fetch a specific payment by passing his ID
|
81
|
+
```ruby
|
59
82
|
Proxypay.get_payment("OcSLBANU4tjRi9gfW5VUcMqkvzL")
|
83
|
+
```
|
60
84
|
|
61
|
-
|
85
|
+
### Acknowledge a payment by passing his ID
|
86
|
+
```ruby
|
62
87
|
Proxypay.new_payment("OcSLBANU4tjRi9gfW5VUcMqkvzL")
|
88
|
+
```
|
63
89
|
|
64
|
-
|
90
|
+
### Acknowledge a payment by passing his ID for an specific API KEY
|
91
|
+
```ruby
|
65
92
|
api_key = "OcSLBANU4tjRi9gfW5VUcMqkvzLOcSLBANU4tjRi9gfW5VUcMqkvzL"
|
66
93
|
Proxypay.other_new_payment("OcSLBANU4tjRi9gfW5VUcMqkvzL", api_key)
|
94
|
+
```
|
67
95
|
|
68
|
-
|
96
|
+
### Acknowledge multiple payments by passing and array of ID's
|
97
|
+
```ruby
|
69
98
|
ids = ["OcSLBANU4tjRi9gfW5VUcMqkvzL", "EcJLBANU4trUi8gfM6MOcMqkvzH","VxELBANU4tjRi9gfW5VUcMqkvzZ"]
|
70
99
|
Proxypay.new_payments(ids)
|
71
100
|
```
|
72
101
|
|
73
102
|
## Help and Docs
|
74
103
|
- [ProxyPay API](https://developer.proxypay.co.ao)
|
75
|
-
- [RDOC](http://www.rubydoc.info/gems/proxypay/0.1
|
104
|
+
- [RDOC](http://www.rubydoc.info/gems/proxypay/0.2.1)
|
76
105
|
|
77
106
|
## Development
|
78
107
|
- You can fork the project
|
data/lib/proxypay.rb
CHANGED
@@ -18,19 +18,19 @@ module Proxypay
|
|
18
18
|
options = {limit: 20, offset: 0, status: nil, q: nil}.merge!(options)
|
19
19
|
# query options
|
20
20
|
case options != nil
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
21
|
+
# get refs with provided status w/o specific custom query
|
22
|
+
when options.fetch(:status) != nil && options.fetch(:q) == nil
|
23
|
+
get("/references?limit=#{options[:limit]}&offset=#{options[:offset]}&status=#{options[:status]}", content).parsed_response
|
24
|
+
# get refs with provided custom query with specifc status
|
25
|
+
when options.fetch(:status) != nil && options.fetch(:q) != nil
|
26
|
+
get("/references?q=#{options[:q]}&limit=#{options[:limit]}&offset=#{options[:offset]}&status=#{options[:status]}", content).parsed_response
|
27
|
+
# get refs with provided custom query w/o providing specific status
|
28
|
+
when options.fetch(:status) == nil && options.fetch(:q) != nil
|
29
|
+
get("/references?q=#{options[:q]}&limit=#{options[:limit]}&offset=#{options[:offset]}", content).parsed_response
|
30
|
+
else
|
31
|
+
# just get all the reference as per the api defaults (when there is no args provided)
|
32
|
+
get("/references", content).parsed_response
|
33
|
+
end
|
34
34
|
end
|
35
35
|
|
36
36
|
# Fetch a specific reference by his ID string
|
@@ -41,8 +41,11 @@ module Proxypay
|
|
41
41
|
|
42
42
|
# Submit a request to create a new reference
|
43
43
|
def self.new_reference(amount, expiry_date, other_data={})
|
44
|
-
|
45
|
-
|
44
|
+
# request body and header
|
45
|
+
auth = {:basic_auth => authenticate}
|
46
|
+
|
47
|
+
post("/references",
|
48
|
+
:body =>{ :reference => {:amount => amount, :expiry_date => expiry_date, :custom_fields => other_data } }.to_json,
|
46
49
|
:basic_auth => authenticate,
|
47
50
|
:headers => { 'Content-Type' => 'application/json'}).parsed_response
|
48
51
|
end
|
data/lib/proxypay/version.rb
CHANGED
data/proxypay-0.2.0.gem
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proxypay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergio Maziano
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -71,6 +71,7 @@ files:
|
|
71
71
|
- bin/setup
|
72
72
|
- lib/proxypay.rb
|
73
73
|
- lib/proxypay/version.rb
|
74
|
+
- proxypay-0.2.0.gem
|
74
75
|
- proxypay.gemspec
|
75
76
|
homepage: https://github.com/smaziano/proxypay
|
76
77
|
licenses:
|
@@ -92,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
93
|
version: '0'
|
93
94
|
requirements: []
|
94
95
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.6.
|
96
|
+
rubygems_version: 2.6.10
|
96
97
|
signing_key:
|
97
98
|
specification_version: 4
|
98
99
|
summary: A Ruby gem for ProxyPay API(https://proxypay.co.ao) made by SmartTechys(http://smarttechys.co.ao)
|