proxypay 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -4
- data/lib/proxypay.rb +16 -6
- data/lib/proxypay/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: c8c18053dd00e0088e46c13a4e0f8da032bb195a
|
4
|
+
data.tar.gz: 958d452fba093c97ebbe1d56afed8ead00615eef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e3024521dc6775cc3bb99ba286393fb7a3b186d07201499101f1619f3ad5589ba66bf45c294c7333b6d82dce16a8631e9f9d2eee89eb1b7571382cbc59a3fdf
|
7
|
+
data.tar.gz: 6c1be341a1fd02c55f83be0ad017b7a522f25d95d1abad452ee45353a156b69771b292e2e6bf948912451c67ddae3eaab0936a34bdc8eadf28daafc002bcc8db
|
data/README.md
CHANGED
@@ -30,21 +30,33 @@ PROXYPAY_API_KEY=your_api_key_obtained_from_proxypay_folks
|
|
30
30
|
|
31
31
|
```ruby
|
32
32
|
## Use the class methods to get it going
|
33
|
-
|
33
|
+
|
34
|
+
# References
|
35
|
+
## Fetch all available references
|
34
36
|
Proxypay.get_references
|
35
37
|
|
36
|
-
|
38
|
+
## Request a new reference - amount and expiration_date for the reference are mandatory
|
37
39
|
Proxypay.new_reference("2000.00", "2015-10-10")
|
38
40
|
|
39
|
-
|
41
|
+
## Request a reference and add custom fields to your reference for your identification.
|
40
42
|
other_data = {invoice:"001-2015", description:"Client #{client_number} - monthly payment"}
|
41
43
|
Proxypay.new_reference("2000.00", "2015-10-10", other_data)
|
44
|
+
|
45
|
+
# Payments
|
46
|
+
## Fetch all payments that haven't been acknowledged
|
47
|
+
Proxypay.get_payments
|
48
|
+
|
49
|
+
## Fetch a specific payment by passing his ID
|
50
|
+
Proxypay.get_payment("OcSLBANU4tjRi9gfW5VUcMqkvzL")
|
51
|
+
|
52
|
+
## Acknowledge a payment by passing his ID
|
53
|
+
Proxypay.new_payment("OcSLBANU4tjRi9gfW5VUcMqkvzL")
|
42
54
|
```
|
43
55
|
work in progress...
|
44
56
|
|
45
57
|
## Help and Docs for Proxypay API and proxypay gem
|
46
58
|
- [ProxyPay API](https://developer.proxypay.co.ao)
|
47
|
-
- [
|
59
|
+
- [RDOC](http://www.rubydoc.info/gems/proxypay/0.1.1)
|
48
60
|
|
49
61
|
## Development
|
50
62
|
- You can fork the project
|
data/lib/proxypay.rb
CHANGED
@@ -8,21 +8,33 @@ module Proxypay
|
|
8
8
|
# Fetch all available references
|
9
9
|
def self.get_references(options={})
|
10
10
|
options = {:basic_auth => authenticate}
|
11
|
-
get(
|
11
|
+
get("/references", options).parsed_response
|
12
|
+
end
|
13
|
+
|
14
|
+
# Fetch a specific reference by his ID string
|
15
|
+
def self.get_reference(id)
|
16
|
+
options = {:basic_auth => authenticate}
|
17
|
+
get("/references/#{id}", options).parsed_response
|
12
18
|
end
|
13
19
|
|
14
20
|
# Submit a request to create a new reference
|
15
21
|
def self.new_reference(amount, expiry_date, other_data={})
|
16
|
-
post(
|
22
|
+
post("/references",
|
17
23
|
:body =>{ :reference => {:amount => amount, :expiry_date => expiry_date, :custom_fields => other_data } }.to_json,
|
18
24
|
:basic_auth => authenticate,
|
19
25
|
:headers => { 'Content-Type' => 'application/json'}).parsed_response
|
20
26
|
end
|
21
27
|
|
22
|
-
# Fetch all availables payments
|
28
|
+
# Fetch all availables payments that have not been acknowledged.
|
23
29
|
def self.get_payments(options={})
|
24
30
|
options = {:basic_auth => authenticate}
|
25
|
-
get(
|
31
|
+
get("/events/payments", options).parsed_response
|
32
|
+
end
|
33
|
+
|
34
|
+
# Acknowledge a payment by submitting his ID
|
35
|
+
def self.new_payment(id)
|
36
|
+
options = {:basic_auth => authenticate}
|
37
|
+
delete("/events/payments/#{id}", options).parsed_response
|
26
38
|
end
|
27
39
|
|
28
40
|
private
|
@@ -33,5 +45,3 @@ module Proxypay
|
|
33
45
|
}
|
34
46
|
end
|
35
47
|
end
|
36
|
-
|
37
|
-
#ProxyPay.find(123)
|
data/lib/proxypay/version.rb
CHANGED