proxypay 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83b2dac7bae8d7ee1ae82c086762f08fef916e61
4
- data.tar.gz: faecc885993aaef5a094ca3107ec46e00e3f27ec
3
+ metadata.gz: c8c18053dd00e0088e46c13a4e0f8da032bb195a
4
+ data.tar.gz: 958d452fba093c97ebbe1d56afed8ead00615eef
5
5
  SHA512:
6
- metadata.gz: 942a918b34b2a1f64784d73046181c3afa8dedf74da3986c25c9d54f6b293ef65428a9dd5cf494b435a679db41371836e72d7ddba8b84de2fe0289c61bbffb79
7
- data.tar.gz: d9b8c4b3f0fe0ae4c70bae7d9f38f7899fcd1b9e200c909e7ed0e7ed9b6858529edb30fc8bc4ce0ef808fe73d006f38974576571c970a28fbb87962a199432fd
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
- # Get References
33
+
34
+ # References
35
+ ## Fetch all available references
34
36
  Proxypay.get_references
35
37
 
36
- # Request a new reference - amount and expiration_date for the reference are mandatory
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
- # You can pass a hash of other custom columns to help you track the references.
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
- - [proxypay gem RDOC](http://www.rubydoc.info/gems/proxypay/0.1.1)
59
+ - [RDOC](http://www.rubydoc.info/gems/proxypay/0.1.1)
48
60
 
49
61
  ## Development
50
62
  - You can fork the project
@@ -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('/references', options).parsed_response
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('/references',
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('/events/payments', options).parsed_response
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)
@@ -1,3 +1,3 @@
1
1
  module Proxypay
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proxypay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Maziano