proxypay 0.2.3 → 0.2.5
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 +5 -5
- data/.proxypay.gemspec.swp +0 -0
- data/_config.yml +1 -0
- data/lib/.proxypay.rb.swp +0 -0
- data/lib/proxypay.rb +20 -31
- data/lib/proxypay/version.rb +1 -1
- data/proxypay.gemspec +2 -2
- metadata +10 -10
- data/proxypay-0.2.1.gem +0 -0
- data/proxypay-0.2.2.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f349c8d71717e5ef586594a28533d20e31a69a82729ecc3e0da459f3d5efa83e
|
4
|
+
data.tar.gz: c44960d559e264a11d7174a2c95b5873c49b44c97b4d1785a2a75900e29d8d16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbaf8112a89acd8425edda556deaa260d8213548e0adab80ffe7d5447d290588d188f4f519cdea7a283307f1d5f39c7e5e90846752e98f89fb5b7d11fbe24ccf
|
7
|
+
data.tar.gz: 988418b5a2e0bfed4a3b531d19848c8ab16ddea29f871ab200d9eef5f0119c35bae36ee9f448a0a33ba6f229e1327b1c109efa1fdcdd89a02709246cad7336db
|
Binary file
|
data/_config.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
theme: jekyll-theme-slate
|
Binary file
|
data/lib/proxypay.rb
CHANGED
@@ -1,19 +1,15 @@
|
|
1
|
-
#require "./lib/proxypay/version.rb"
|
2
1
|
require "proxypay/version"
|
3
2
|
require "httparty"
|
4
3
|
|
5
4
|
module Proxypay
|
6
5
|
include HTTParty
|
6
|
+
debug_output $stdout
|
7
7
|
base_uri "https://api.proxypay.co.ao"
|
8
8
|
|
9
9
|
# Fetch all available references
|
10
10
|
def self.get_references(options = {})
|
11
|
-
# Proxypay.get_references(query: {limit: 20}, is_test: true, api_key: '0djwano5yth94ihrtw34ot9cehn9emo')
|
12
11
|
set_base_url(options.delete(:is_test))
|
13
|
-
|
14
|
-
content = {}
|
15
|
-
content[:basic_auth] = authenticate(options.delete(:api_key))
|
16
|
-
content[:headers] = {'Content-Type' => 'application/json'}
|
12
|
+
content = set_headers(options)
|
17
13
|
content[:query] = options.delete(:query) || {}
|
18
14
|
get("/references", content).parsed_response
|
19
15
|
end
|
@@ -21,29 +17,22 @@ module Proxypay
|
|
21
17
|
# Fetch a specific reference by his ID string
|
22
18
|
def self.get_reference(id, options = {})
|
23
19
|
set_base_url(options.delete(:is_test))
|
24
|
-
|
25
|
-
get("/references/#{id}",
|
20
|
+
content = set_headers(options)
|
21
|
+
get("/references/#{id}", content).parsed_response
|
26
22
|
end
|
27
23
|
|
28
24
|
# Submit a request to create a new reference
|
29
25
|
def self.new_reference(amount, expiry_date, options={})
|
30
|
-
# new_reference(78654.90, '12-12-2012', custom_fields: {foo: 'F0000-45', bar: 'MMM'}, api_key: 'ctsrxte56v8my_keyv7fuf676t7o89099y85ce6f', is_test: true)
|
31
26
|
set_base_url(options.delete(:is_test))
|
32
|
-
content =
|
33
|
-
content[:basic_auth] = authenticate(options.delete(:api_key))
|
27
|
+
content = set_headers(options)
|
34
28
|
content[:body] = {:reference => {:amount => amount.to_s, :expiry_date => expiry_date.to_s, custom_fields: (options.delete(:custom_fields) || {})}}.to_json
|
35
|
-
content[:headers] = {'Content-Type' => 'application/json'}
|
36
29
|
post("/references", content).parsed_response
|
37
30
|
end
|
38
31
|
|
39
32
|
# Fetch all availables payments that have not been acknowledged.
|
40
33
|
def self.get_payments(options={})
|
41
|
-
# Proxypay.get_payments(query: {limit: 20}, is_test: true, api_key: '0djwano5yth94ihrtw34ot9cehn9emo')
|
42
34
|
set_base_url(options.delete(:is_test))
|
43
|
-
|
44
|
-
content = {}
|
45
|
-
content[:basic_auth] = authenticate(options.delete(:api_key))
|
46
|
-
content[:headers] = {'Content-Type' => 'application/json'}
|
35
|
+
content = set_headers(options)
|
47
36
|
content[:query] = options.delete(:query) || {}
|
48
37
|
get("/events/payments", content).parsed_response
|
49
38
|
end
|
@@ -51,27 +40,22 @@ module Proxypay
|
|
51
40
|
# Acknowledge a payment by submitting his ID
|
52
41
|
def self.new_payment(id, options = {})
|
53
42
|
set_base_url(options.delete(:is_test))
|
54
|
-
content =
|
43
|
+
content = set_headers(options)
|
55
44
|
delete("/events/payments/#{id}", content).parsed_response
|
56
45
|
end
|
57
46
|
|
58
47
|
# Acknowledge multiple payments by submitting an array of ids
|
59
48
|
def self.new_payments(ids, options = {})
|
60
49
|
set_base_url(options.delete(:is_test))
|
61
|
-
content =
|
50
|
+
content = set_headers(options)
|
62
51
|
content[:body] = { :ids => ids }.to_json
|
63
|
-
content[:basic_auth] = authenticate(options.delete(:api_key))
|
64
|
-
content[:headers] = {'Content-Type' => 'application/json'}
|
65
52
|
delete("/events/payments", content).parsed_response
|
66
53
|
end
|
67
54
|
|
68
55
|
# Get a list of customers
|
69
56
|
def self.get_customers(options = {})
|
70
57
|
set_base_url(options.delete(:is_test))
|
71
|
-
|
72
|
-
content = {}
|
73
|
-
content[:basic_auth] = authenticate(options.delete(:api_key))
|
74
|
-
content[:headers] = {'Content-Type' => 'application/json'}
|
58
|
+
content = set_headers(options)
|
75
59
|
content[:query] = options.delete(:query) || {}
|
76
60
|
get("/customers", content).parsed_response
|
77
61
|
end
|
@@ -79,25 +63,30 @@ module Proxypay
|
|
79
63
|
# get a customer by id
|
80
64
|
def self.get_customer(id, options = {})
|
81
65
|
set_base_url(options.delete(:is_test))
|
82
|
-
|
83
|
-
get("/customers/#{id}",
|
66
|
+
content = set_headers(options)
|
67
|
+
get("/customers/#{id}", content).parsed_response
|
84
68
|
end
|
85
69
|
|
86
70
|
# Store a new customer or update one
|
87
71
|
def self.new_customer(id, nome, telemovel, email, options = {})
|
88
72
|
set_base_url(options.delete(:is_test))
|
89
|
-
content =
|
90
|
-
content[:basic_auth] = authenticate(options.delete(:api_key))
|
73
|
+
content = set_headers(options)
|
91
74
|
content[:body] = {:customer => {:name => nome.to_s, :mobile => telemovel.to_s, :email => email.to_s}}.to_json
|
92
|
-
content[:headers] = {'Content-Type' => 'application/json'}
|
93
75
|
put("/customers/#{id}", content).parsed_response
|
94
76
|
end
|
95
77
|
|
96
78
|
def self.set_base_url(is_test = false)
|
97
|
-
self.base_uri is_test == true ? "https://api.proxypay.co.ao
|
79
|
+
self.base_uri is_test == true ? "https://api.sandbox.proxypay.co.ao" : "https://api.proxypay.co.ao"
|
98
80
|
end
|
99
81
|
|
100
82
|
private
|
83
|
+
def self.set_headers(options)
|
84
|
+
content = {}
|
85
|
+
content[:basic_auth] = authenticate(options.delete(:api_key))
|
86
|
+
content[:headers] = {'Content-Type' => 'application/json', 'Accept' => 'application/vnd.proxypay.v1+json'}
|
87
|
+
return content
|
88
|
+
end
|
89
|
+
|
101
90
|
def self.authenticate(api_key = nil)
|
102
91
|
auth = {
|
103
92
|
username: api_key.nil? ? ENV["PROXYPAY_USER"] : 'api',
|
data/lib/proxypay/version.rb
CHANGED
data/proxypay.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
29
|
spec.require_paths = ["lib"]
|
30
30
|
|
31
|
-
spec.add_development_dependency "bundler", "~> 1.
|
32
|
-
spec.add_development_dependency "rake", "~>
|
31
|
+
spec.add_development_dependency "bundler", "~> 2.1.4"
|
32
|
+
spec.add_development_dependency "rake", "~> 13.0.1"
|
33
33
|
spec.add_dependency "httparty", "~> 0.13.7"
|
34
34
|
end
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergio Maziano
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.1.4
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.1.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 13.0.1
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 13.0.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: httparty
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -63,17 +63,18 @@ extra_rdoc_files: []
|
|
63
63
|
files:
|
64
64
|
- ".DS_Store"
|
65
65
|
- ".gitignore"
|
66
|
+
- ".proxypay.gemspec.swp"
|
66
67
|
- CODE_OF_CONDUCT.md
|
67
68
|
- Gemfile
|
68
69
|
- LICENSE.txt
|
69
70
|
- README.md
|
70
71
|
- Rakefile
|
72
|
+
- _config.yml
|
71
73
|
- bin/console
|
72
74
|
- bin/setup
|
75
|
+
- lib/.proxypay.rb.swp
|
73
76
|
- lib/proxypay.rb
|
74
77
|
- lib/proxypay/version.rb
|
75
|
-
- proxypay-0.2.1.gem
|
76
|
-
- proxypay-0.2.2.gem
|
77
78
|
- proxypay.gemspec
|
78
79
|
homepage: https://github.com/smaziano/proxypay
|
79
80
|
licenses:
|
@@ -94,8 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
95
|
- !ruby/object:Gem::Version
|
95
96
|
version: '0'
|
96
97
|
requirements: []
|
97
|
-
|
98
|
-
rubygems_version: 2.6.6
|
98
|
+
rubygems_version: 3.1.2
|
99
99
|
signing_key:
|
100
100
|
specification_version: 4
|
101
101
|
summary: A Ruby gem for ProxyPay API(https://proxypay.co.ao) made by SmartTechys(http://smarttechys.co.ao)
|
data/proxypay-0.2.1.gem
DELETED
Binary file
|
data/proxypay-0.2.2.gem
DELETED
Binary file
|