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: c2e3769a9f0be9e6d523008eb49745f161c6f2ed8c08c37b4c6e932b8e9f8807
4
- data.tar.gz: 4fcbda3d51c0461e4f5011354cebc1a809fe6807ab80404eaa2ff5006daab329
3
+ metadata.gz: 424f5d26b8f87ed1c12e04dfac4bec89b0c343c03425e8776aefb29dd9715a83
4
+ data.tar.gz: 6458602edb50b0b5cd64e91cd1a2ec1b7dc68734c867e3a495ce33ceee7e8317
5
5
  SHA512:
6
- metadata.gz: 8db92b154356ccc5a3aa826ceefbf8f1a8e82967c919a018e732536e72e5bfde33932f1e3be6e330b9370758f0262f9758186410776845a8b9277616646ca316
7
- data.tar.gz: 43a429e8ac9d2e6ff30dfcaf2d21423d6f3b38ae79c6a58bc52f30ce59637b6b52d1c49c48d944f4666927b2ad8c8872124926d085b39897079e82ab5346226a
6
+ metadata.gz: 07afb01c11f0ccd32b68b5e9c12da15752fa295ad0998222a453e66762220bec4487ac20b9a8edb514ea44f5af30e20714a765a35160a123ed32ef77108bf245
7
+ data.tar.gz: 4ae925aa06bcf46c2e985caff9b447e4ccdf346bdc1f4051b1facea487a234bedbdcd049b035a94b0f34bf3e605a6bf943975e16e3375c51ad763b2a5cec2a33
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- online_payment_platform (0.0.0)
4
+ online_payment_platform (0.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -45,4 +45,4 @@ DEPENDENCIES
45
45
  webmock
46
46
 
47
47
  BUNDLED WITH
48
- 2.1.4
48
+ 2.2.3
@@ -21,7 +21,7 @@ module OnlinePaymentPlatform
21
21
 
22
22
  def initialize
23
23
  @sandbox_mode = true
24
- @base_uri = @sandbox_mode ? 'https://api-sandbox.onlinebetaalplatform.nl/v1/' : 'https://api.onlinebetaalplatform.nl/v1/'
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OnlinePaymentPlatform
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  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.1
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-16 00:00:00.000000000 Z
11
+ date: 2021-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec