online_payment_platform 0.0.1 → 0.0.2
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 424f5d26b8f87ed1c12e04dfac4bec89b0c343c03425e8776aefb29dd9715a83
|
4
|
+
data.tar.gz: 6458602edb50b0b5cd64e91cd1a2ec1b7dc68734c867e3a495ce33ceee7e8317
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07afb01c11f0ccd32b68b5e9c12da15752fa295ad0998222a453e66762220bec4487ac20b9a8edb514ea44f5af30e20714a765a35160a123ed32ef77108bf245
|
7
|
+
data.tar.gz: 4ae925aa06bcf46c2e985caff9b447e4ccdf346bdc1f4051b1facea487a234bedbdcd049b035a94b0f34bf3e605a6bf943975e16e3375c51ad763b2a5cec2a33
|
data/Gemfile.lock
CHANGED
@@ -21,7 +21,7 @@ module OnlinePaymentPlatform
|
|
21
21
|
|
22
22
|
def initialize
|
23
23
|
@sandbox_mode = true
|
24
|
-
@base_uri =
|
24
|
+
@base_uri = 'https://api.onlinebetaalplatform.nl/v1/'
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
@@ -35,6 +35,13 @@ module OnlinePaymentPlatform
|
|
35
35
|
Merchant.new response
|
36
36
|
end
|
37
37
|
|
38
|
+
def self.find_or_create(opts = {})
|
39
|
+
assert_required_keys!(opts, :country, :emailaddress, :notify_url, :phone)
|
40
|
+
response = fetch(generate_uri(:merchants) + "?filter[0][name]=emailaddress&filter=[0][operand]=eq&filter[0][value]=#{opts[:emailaddress]}")
|
41
|
+
|
42
|
+
byebug
|
43
|
+
end
|
44
|
+
|
38
45
|
def self.create(opts = {})
|
39
46
|
assert_required_keys!(opts, :country, :emailaddress, :notify_url, :phone)
|
40
47
|
Merchant.new post(generate_uri(:merchants), opts)
|
@@ -12,7 +12,7 @@ module Methods
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def generate_uri(*path)
|
15
|
-
encoded_uri = OnlinePaymentPlatform.configuration.base_uri + path.join('/')
|
15
|
+
encoded_uri = URI.encode(OnlinePaymentPlatform.configuration.base_uri + path.join('/'))
|
16
16
|
URI.parse encoded_uri
|
17
17
|
end
|
18
18
|
|
@@ -36,6 +36,7 @@ module Methods
|
|
36
36
|
req = Net::HTTP::Get.new(uri)
|
37
37
|
req['Authorization'] = "Bearer #{config.api_key}"
|
38
38
|
|
39
|
+
byebug
|
39
40
|
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
|
40
41
|
http.request req
|
41
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: online_payment_platform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis de Vulder
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|