proxypay 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73da497ba92efa4e5d4e1e1ba839ddc40dd230c2
4
- data.tar.gz: b753fc5ce219281dbd801d2d27c62c473b030456
3
+ metadata.gz: 46197a68ddc393acbb36ea650f779f234e108c8b
4
+ data.tar.gz: f08dc15e9f23861fd0ba0a45355ede676638fd6f
5
5
  SHA512:
6
- metadata.gz: 3750f0b57ffc790a85c36ea27a6d956f6ef62e19e7687071d017b3c513452230309d0d4dd7b189685cc79f751096c30fd9daedb4f9cb781340ccbb5060b48534
7
- data.tar.gz: f40963b98bb6bc1086ffaed77002a8ee8b3df9ccc6b94f652880f212056792707034b6763da5f4d5d66fd52c3b7339c288899169c45757a20dd749551349c145
6
+ metadata.gz: 5f3cd97f4ffdb5220173feceda72921eb309ade4c9cc2810623c0100c100e0692fd619c1ec8e8f985959d47c6e2145ce47636eefcb466281ed334d9ce1bfef76
7
+ data.tar.gz: 12f494f5e1f3ee11bc852d99944c675490ff53b36fb24962d11b4ec369d0b061b6489471dab2d256f1f8fb8649835a79829c42a3a8f3cd0b6f31477e21b85bfa
data/README.md CHANGED
@@ -42,24 +42,37 @@ Proxypay.new_reference("2000.00", "2015-10-10")
42
42
  other_data = {invoice:"001-2015", description:"Client #{client_number} - monthly payment"}
43
43
  Proxypay.new_reference("2000.00", "2015-10-10", other_data)
44
44
 
45
+ ## Request a reference and add custom fields to your reference for your identification on using a specific API_KEY
46
+ other_data = {invoice:"001-2015", description:"Client #{client_number} - monthly payment"}
47
+ api_key = "OcSLBANU4tjRi9gfW5VUcMqkvzLOcSLBANU4tjRi9gfW5VUcMqkvzL"
48
+ Proxypay.other_new_reference("2000.00", "2015-10-10", other_data, api_key)
49
+
45
50
  # Payments
46
51
  ## Fetch all payments that haven't been acknowledged
47
52
  Proxypay.get_payments
48
53
 
54
+ ## Fetch all payments that haven't been acknowledged for an specific API KEY
55
+ api_key = "OcSLBANU4tjRi9gfW5VUcMqkvzLOcSLBANU4tjRi9gfW5VUcMqkvzL"
56
+ Proxypay.other_get_payments(api_key)
57
+
49
58
  ## Fetch a specific payment by passing his ID
50
59
  Proxypay.get_payment("OcSLBANU4tjRi9gfW5VUcMqkvzL")
51
60
 
52
61
  ## Acknowledge a payment by passing his ID
53
62
  Proxypay.new_payment("OcSLBANU4tjRi9gfW5VUcMqkvzL")
54
63
 
55
- ## Acknowledge a payment by passing and array of ID's
64
+ ## Acknowledge a payment by passing his ID for an specific API KEY
65
+ api_key = "OcSLBANU4tjRi9gfW5VUcMqkvzLOcSLBANU4tjRi9gfW5VUcMqkvzL"
66
+ Proxypay.new_payment("OcSLBANU4tjRi9gfW5VUcMqkvzL", api_key)
67
+
68
+ ## Acknowledge multiple payments by passing and array of ID's
56
69
  ids = ["OcSLBANU4tjRi9gfW5VUcMqkvzL", "EcJLBANU4trUi8gfM6MOcMqkvzH","VxELBANU4tjRi9gfW5VUcMqkvzZ"]
57
70
  Proxypay.new_payments(ids)
58
71
  ```
59
72
 
60
73
  ## Help and Docs
61
74
  - [ProxyPay API](https://developer.proxypay.co.ao)
62
- - [RDOC](http://www.rubydoc.info/gems/proxypay/0.1.7)
75
+ - [RDOC](http://www.rubydoc.info/gems/proxypay/0.1.8)
63
76
 
64
77
  ## Development
65
78
  - You can fork the project
@@ -1,3 +1,3 @@
1
1
  module Proxypay
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
data/lib/proxypay.rb CHANGED
@@ -26,15 +26,42 @@ module Proxypay
26
26
  :headers => { 'Content-Type' => 'application/json'}).parsed_response
27
27
  end
28
28
 
29
+ # Submit a request to create a new reference on behalf of other API_KEY
30
+ def self.other_new_reference(amount, expiry_date, other_data={}, api_key)
31
+ auth = {
32
+ username:"api",
33
+ password:"#{api_key}"
34
+ }
35
+ post("/references",
36
+ :body =>{ :reference => {:amount => amount, :expiry_date => expiry_date, :custom_fields => other_data } }.to_json,
37
+ :basic_auth => auth,
38
+ :headers => { 'Content-Type' => 'application/json'}).parsed_response
39
+ end
40
+
41
+ # Fetch all the payments that have not been acknoledged (by submiting the api key)
42
+ def self.other_get_payments(api_key)
43
+ auth = {
44
+ username:"api",
45
+ password:"#{api_key}"
46
+ }
47
+ options = {:basic_auth => auth}
48
+ get("/events/payments", options).parsed_response
49
+ end
50
+
29
51
  # Fetch all availables payments that have not been acknowledged.
30
- def self.get_payments(options={})
52
+ def self.get_payments
31
53
  options = {:basic_auth => authenticate}
32
54
  get("/events/payments", options).parsed_response
33
55
  end
34
56
 
35
57
  # Acknowledge a payment by submitting his ID
36
- def self.new_payment(id)
37
- delete("/events/payments/#{id}", :basic_auth => authenticate).parsed_response
58
+ def self.new_payment(id, api_key)
59
+ auth = {
60
+ username:"api",
61
+ password:"#{api_key}"
62
+ }
63
+ options = {:basic_auth => auth}
64
+ delete("/events/payments/#{id}", options).parsed_response
38
65
  end
39
66
 
40
67
  # Acknowledge multiple payments by submitting an array of ids
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.7
4
+ version: 0.1.8
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-11-10 00:00:00.000000000 Z
11
+ date: 2015-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler