omni_kassa 1.3.0 → 1.4.0

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: 80f9c48b4c414542401fe6ed235bffe8c24fd80a
4
- data.tar.gz: 0230889fe5e5eb16b080b58b108df08d9354aafe
3
+ metadata.gz: eab5abea321a39ab96583333535650bfe27f2b71
4
+ data.tar.gz: d58f80f8713e65b814a0901c6bc9343d9b3e37ee
5
5
  SHA512:
6
- metadata.gz: 6057c969480ae4b1ff986ceaf7a39bd24a5e05756bb128c8a6362576ad240d3ba820d2be91e2d0c8404056d6d049426d05172cb25424df48b08584b9481f4908
7
- data.tar.gz: e3821b5f57be3ef3540c5207c0c5a4b0e5823ec456d7aac38bd5cb0f571ad65164d708e766f97bdff7efa7b98100712125d909ea68993714315728f922073925
6
+ metadata.gz: cbd4388db0aa5b98a24fa94ff98246de522611fa937cc00a28be6daa1433f969658fe8c0f8b60bdc5d8e7673902e15fa4229c07c1aa8bf4f535d08f827c5c73e
7
+ data.tar.gz: c3c95e19beaf881408cdc54f5dd67629a124f019e608a4415bbb673dfaafeeb5845621926f588f78bc74590309de1cb15f89694be2a04c83da0479a3202a8945
data/Gemfile.lock CHANGED
@@ -8,27 +8,28 @@ PATH
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (3.2.13)
12
- i18n (= 0.6.1)
13
- multi_json (~> 1.0)
14
- httparty (0.11.0)
11
+ activesupport (3.2.16)
12
+ i18n (~> 0.6, >= 0.6.4)
15
13
  multi_json (~> 1.0)
14
+ httparty (0.12.0)
15
+ json (~> 1.8)
16
16
  multi_xml (>= 0.5.2)
17
- i18n (0.6.1)
18
- minitest (4.4.0)
19
- multi_json (1.7.7)
20
- multi_xml (0.5.4)
21
- rack (1.4.3)
22
- rack-protection (1.3.2)
17
+ i18n (0.6.9)
18
+ json (1.8.1)
19
+ minitest (5.2.0)
20
+ multi_json (1.8.2)
21
+ multi_xml (0.5.5)
22
+ rack (1.5.2)
23
+ rack-protection (1.5.1)
23
24
  rack
24
25
  rack-test (0.6.2)
25
26
  rack (>= 1.0)
26
- rake (10.0.3)
27
- sinatra (1.3.3)
28
- rack (~> 1.3, >= 1.3.6)
29
- rack-protection (~> 1.2)
30
- tilt (~> 1.3, >= 1.3.3)
31
- tilt (1.3.3)
27
+ rake (10.1.1)
28
+ sinatra (1.4.4)
29
+ rack (~> 1.4)
30
+ rack-protection (~> 1.4)
31
+ tilt (~> 1.3, >= 1.3.4)
32
+ tilt (1.4.1)
32
33
 
33
34
  PLATFORMS
34
35
  ruby
data/README.md CHANGED
@@ -23,6 +23,7 @@ Run `bundle` and add your personal configuration. The example below is the offic
23
23
  OmniKassa.config(
24
24
  secret_key: '002020000000001_KEY1',
25
25
  merchant_id: '002020000000001',
26
+ key_version: 1,
26
27
  currency_code: 978, # Euro
27
28
  url: 'https://payment-webinit.simu.omnikassa.rabobank.nl/paymentServlet',
28
29
  transaction_reference: lambda { |order_id| "omnikassatest#{Time.now.to_i}" },
@@ -65,6 +66,8 @@ class PaymentsController
65
66
  response = OmniKassa::Response.new(params)
66
67
 
67
68
  @order = Order.find(response.order_id)
69
+
70
+ return if response.pending? # Payment is pending; serve an explanation to the customer
68
71
 
69
72
  if response.successful?
70
73
  @order.payed = true
@@ -36,7 +36,7 @@ module OmniKassa
36
36
 
37
37
  def response_code=(response_code)
38
38
  raise ResponseCodeError if response_code.to_s.scan(/\D/).present?
39
- @response_code = response_code.to_i
39
+ @response_code = Integer(response_code)
40
40
  end
41
41
 
42
42
  protected
data/lib/omni_kassa.rb CHANGED
@@ -3,7 +3,7 @@ require 'active_support/core_ext/string'
3
3
 
4
4
  module OmniKassa
5
5
  REQUEST_SETTINGS = :merchant_id, :currency_code, :transaction_reference,
6
- :customer_language
6
+ :customer_language, :key_version
7
7
  SETTINGS = REQUEST_SETTINGS + [:secret_key, :url]
8
8
 
9
9
  def self.config(settings)
Binary file
data/omni_kassa.gemspec CHANGED
@@ -1,10 +1,11 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'omni_kassa'
3
- s.version = '1.3.0'
3
+ s.version = '1.4.0'
4
4
  s.author = 'Pepijn Looije'
5
5
  s.email = 'pepijn@plict.nl'
6
6
  s.description = s.summary = 'Easier Rabobank OmniKassa payments'
7
7
  s.homepage = 'https://github.com/pepijn/omni_kassa'
8
+ s.licenses = 'MIT'
8
9
 
9
10
  s.required_ruby_version = '>= 1.9'
10
11
 
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'bundler/setup'
3
3
  require 'omni_kassa'
4
4
 
5
- require 'minitest/unit'
5
+ require 'minitest/autorun'
6
6
  require 'rack/test'
7
7
 
8
8
  require './test_settings'
@@ -12,5 +12,5 @@ require './test_settings'
12
12
  #require 'sinatra'
13
13
  #require './app'
14
14
 
15
- MiniTest::Unit.autorun
15
+ MiniTest.autorun
16
16
 
data/test/request_test.rb CHANGED
@@ -3,7 +3,7 @@ require 'omni_kassa/test_helper'
3
3
  ORDER_ID = rand(10000)
4
4
  AMOUNT = rand(10000)
5
5
 
6
- class RequestTest < MiniTest::Unit::TestCase
6
+ class RequestTest < MiniTest::Test
7
7
  def setup
8
8
  @request = OmniKassa::Request.new
9
9
  @request.order_id = ORDER_ID
@@ -50,12 +50,12 @@ class RequestTest < MiniTest::Unit::TestCase
50
50
  def test_perform_valid
51
51
  refute_match /ERROR/, @request.perform
52
52
  end
53
-
53
+
54
54
  def test_optional_params
55
55
  @request.payment_mean_brand_list = 'IDEAL'
56
-
56
+
57
57
  assert_equal 'IDEAL', @request.payment_mean_brand_list
58
-
58
+
59
59
  assert_match /paymentMeanBrandList=IDEAL/, @request.send(:data)
60
60
  end
61
61
  end
@@ -7,7 +7,7 @@ RESPONSE_PARAMS = {
7
7
  Seal: '46204f0e97394293c9270b6313e78524027acba1f83d4ce9682848e1f5927ab3'
8
8
  }
9
9
 
10
- class ResponseTest < MiniTest::Unit::TestCase
10
+ class ResponseTest < MiniTest::Test
11
11
  def setup
12
12
  @params = RESPONSE_PARAMS.clone
13
13
  @response = OmniKassa::Response.new(@params)
data/test_settings.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  OmniKassa.config(
2
2
  secret_key: '002020000000001_KEY1',
3
3
  merchant_id: '002020000000001',
4
+ key_version: 1,
4
5
  currency_code: 978,
5
6
  transaction_reference: lambda {|order_id| "omnikassatest#{Time.now.to_i}" },
6
7
  url: 'https://payment-webinit.simu.omnikassa.rabobank.nl/paymentServlet',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omni_kassa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pepijn Looije
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-15 00:00:00.000000000 Z
11
+ date: 2013-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -109,6 +109,7 @@ files:
109
109
  - ./lib/omni_kassa.rb
110
110
  - ./LICENSE
111
111
  - ./omni_kassa-1.2.1.gem
112
+ - ./omni_kassa-1.4.0.gem
112
113
  - ./omni_kassa.gemspec
113
114
  - ./Rakefile
114
115
  - ./README.md
@@ -118,7 +119,8 @@ files:
118
119
  - ./test/response_test.rb
119
120
  - ./test_settings.rb
120
121
  homepage: https://github.com/pepijn/omni_kassa
121
- licenses: []
122
+ licenses:
123
+ - MIT
122
124
  metadata: {}
123
125
  post_install_message:
124
126
  rdoc_options: []
@@ -136,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
138
  version: '0'
137
139
  requirements: []
138
140
  rubyforge_project:
139
- rubygems_version: 2.0.3
141
+ rubygems_version: 2.1.10
140
142
  signing_key:
141
143
  specification_version: 4
142
144
  summary: Easier Rabobank OmniKassa payments