proxypay 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 +32 -8
- data/lib/proxypay/version.rb +1 -1
- data/lib/proxypay.rb +14 -14
- data/proxypay.gemspec +2 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83b2dac7bae8d7ee1ae82c086762f08fef916e61
|
4
|
+
data.tar.gz: faecc885993aaef5a094ca3107ec46e00e3f27ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 942a918b34b2a1f64784d73046181c3afa8dedf74da3986c25c9d54f6b293ef65428a9dd5cf494b435a679db41371836e72d7ddba8b84de2fe0289c61bbffb79
|
7
|
+
data.tar.gz: d9b8c4b3f0fe0ae4c70bae7d9f38f7899fcd1b9e200c909e7ed0e7ed9b6858529edb30fc8bc4ce0ef808fe73d006f38974576571c970a28fbb87962a199432fd
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# Proxypay
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
A ruby gem to connect your application with [ProxyPay](http://www.proxypay.co.ao) API that allows your application to interact with the Angolan ATM system knows as Multicaixa for online payments by reference.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -20,19 +18,45 @@ Or install it yourself as:
|
|
20
18
|
|
21
19
|
$ gem install proxypay
|
22
20
|
|
21
|
+
## Setup
|
22
|
+
Make sure you setup the environment variables PROXYPAY_USER and PROXYPAY_API_KEY:
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
PROXYPAY_USER=api
|
26
|
+
PROXYPAY_API_KEY=your_api_key_obtained_from_proxypay_folks
|
27
|
+
```
|
28
|
+
|
23
29
|
## Usage
|
24
30
|
|
25
|
-
|
31
|
+
```ruby
|
32
|
+
## Use the class methods to get it going
|
33
|
+
# Get References
|
34
|
+
Proxypay.get_references
|
26
35
|
|
27
|
-
|
36
|
+
# Request a new reference - amount and expiration_date for the reference are mandatory
|
37
|
+
Proxypay.new_reference("2000.00", "2015-10-10")
|
28
38
|
|
29
|
-
|
39
|
+
# You can pass a hash of other custom columns to help you track the references.
|
40
|
+
other_data = {invoice:"001-2015", description:"Client #{client_number} - monthly payment"}
|
41
|
+
Proxypay.new_reference("2000.00", "2015-10-10", other_data)
|
42
|
+
```
|
43
|
+
work in progress...
|
30
44
|
|
31
|
-
|
45
|
+
## Help and Docs for Proxypay API and proxypay gem
|
46
|
+
- [ProxyPay API](https://developer.proxypay.co.ao)
|
47
|
+
- [proxypay gem RDOC](http://www.rubydoc.info/gems/proxypay/0.1.1)
|
48
|
+
|
49
|
+
## Development
|
50
|
+
- You can fork the project
|
51
|
+
- bundle
|
52
|
+
- bundle rake exec
|
53
|
+
- Make your feature addition or fix a bug
|
54
|
+
- Do not mess with rakefile, version or history (do not submit version bump PLEASE or put it in a different commit so we can ignore it when pull)
|
55
|
+
- Send us the pull request
|
32
56
|
|
33
57
|
## Contributing
|
34
58
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
59
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/smaziano/proxypay. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
36
60
|
|
37
61
|
|
38
62
|
## License
|
data/lib/proxypay/version.rb
CHANGED
data/lib/proxypay.rb
CHANGED
@@ -7,30 +7,30 @@ module Proxypay
|
|
7
7
|
|
8
8
|
# Fetch all available references
|
9
9
|
def self.get_references(options={})
|
10
|
-
|
11
|
-
username:ENV["PROXY_PAY_USER"],
|
12
|
-
password:ENV["PROXY_PAY_PASSWORD"]
|
13
|
-
}
|
14
|
-
options = {basic_auth:auth}
|
10
|
+
options = {:basic_auth => authenticate}
|
15
11
|
get('/references', options).parsed_response
|
16
12
|
end
|
17
13
|
|
18
14
|
# Submit a request to create a new reference
|
19
|
-
def self.new_reference(amount, expiry_date)
|
20
|
-
post('/references',
|
21
|
-
|
22
|
-
|
23
|
-
|
15
|
+
def self.new_reference(amount, expiry_date, other_data={})
|
16
|
+
post('/references',
|
17
|
+
:body =>{ :reference => {:amount => amount, :expiry_date => expiry_date, :custom_fields => other_data } }.to_json,
|
18
|
+
:basic_auth => authenticate,
|
19
|
+
:headers => { 'Content-Type' => 'application/json'}).parsed_response
|
24
20
|
end
|
25
21
|
|
26
22
|
# Fetch all availables payments
|
27
23
|
def self.get_payments(options={})
|
24
|
+
options = {:basic_auth => authenticate}
|
25
|
+
get('/events/payments', options).parsed_response
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
def self.authenticate
|
28
30
|
auth = {
|
29
|
-
username:ENV["
|
30
|
-
password:ENV["
|
31
|
+
username:ENV["PROXYPAY_USER"],
|
32
|
+
password:ENV["PROXYPAY_API_KEY"]
|
31
33
|
}
|
32
|
-
options = {basic_auth:auth}
|
33
|
-
get('/events/payments', options).parsed_response
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
data/proxypay.gemspec
CHANGED
@@ -10,7 +10,8 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["sergio.maziano@gmail.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{A Ruby gem for ProxyPay API(https://proxypay.co.ao) made by SmartTechys(http://smarttechys.co.ao) }
|
13
|
-
spec.description = %q{A ruby
|
13
|
+
spec.description = %q{A ruby gem to connect your application with ProxyPay(https://www.proxypay.co.ao) API that allows your application to interact with the Angolan ATM system knows as Multicaixa for online payments by reference.}
|
14
|
+
|
14
15
|
spec.homepage = "https://github.com/smaziano/proxypay"
|
15
16
|
spec.license = "MIT"
|
16
17
|
|
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.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergio Maziano
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,9 +52,9 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.13.7
|
55
|
-
description: A ruby
|
56
|
-
API that allows
|
57
|
-
|
55
|
+
description: A ruby gem to connect your application with ProxyPay(https://www.proxypay.co.ao)
|
56
|
+
API that allows your application to interact with the Angolan ATM system knows as
|
57
|
+
Multicaixa for online payments by reference.
|
58
58
|
email:
|
59
59
|
- sergio.maziano@gmail.com
|
60
60
|
executables: []
|