active_merchant-epsilon 0.5.3 → 0.5.4

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: 1f4e1c7df6de6aabe6c638527d60444b893a92db
4
- data.tar.gz: 5844189d36278b609458760dced58f7fa7b44d00
3
+ metadata.gz: 21731c597893be5cdf7c104d2b8401b23a50c94c
4
+ data.tar.gz: 59c99f9120cdb5d08805d36847f4c4e71f1d7c49
5
5
  SHA512:
6
- metadata.gz: 24bbae695fbc0cedf0a19295d281735306a68e37ba636f1c398936a49c343eec7e76d1c5cf3009ae7a7158c5d7b9a88c4b90cea7fcf6760c26ddf4b98ffd919b
7
- data.tar.gz: 6416a376a722d6671e3d9d3d6b991416bf2eca807bf01dda97a3157fca21fc9bdc7063610bb6e243ed8ea26ba239fb4ce3bc813156ff82cbadae8799b94839b6
6
+ metadata.gz: ead8517eff83884440b66bf11d21dd3d6e79ad1149223207f2fbbb4888235597a62e8310aca937c5cb9dadacaf5fffbe96eb319e56ad1203e29f076f39ff86f0
7
+ data.tar.gz: cd7c1c310052e5fed03e431cdba28565e6f1e689b91f6d49306c8367d77a380fd5adc6ee5e8e1bc554b7b4fda662f521cea42f663b8b4cfc52e78e49d8809aa9
@@ -46,6 +46,7 @@ module ActiveMerchant
46
46
 
47
47
  errors << [:full_name_kana, "is required"] if name.blank?
48
48
  errors << [:phone_number, "is required"] if phone_number.blank?
49
+ errors << [:phone_number, "is not number"] if phone_number.present? && /\D+/.match(phone_number)
49
50
 
50
51
  errors
51
52
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveMerchant
2
2
  module Epsilon
3
- VERSION = "0.5.3"
3
+ VERSION = "0.5.4"
4
4
  end
5
5
  end
@@ -0,0 +1,29 @@
1
+ require 'test_helper'
2
+
3
+ class EpsilonConvenienceStoreTest < MiniTest::Test
4
+ def test_blank_parameter_generate_error
5
+ convenience_store = ActiveMerchant::Billing::ConvenienceStore.new(code: "",
6
+ full_name_kana: "",
7
+ phone_number: "")
8
+ errors = convenience_store.validate
9
+
10
+ assert_includes errors.keys, :code
11
+ assert_includes errors.keys, :full_name_kana
12
+ assert_includes errors.keys, :phone_number
13
+
14
+ assert_includes errors[:code], "is required"
15
+ assert_includes errors[:full_name_kana], "is required"
16
+ assert_includes errors[:phone_number], "is required"
17
+ end
18
+
19
+ def test_phone_number_only_accept_number
20
+ convenience_store = ActiveMerchant::Billing::ConvenienceStore.new(code: 31,
21
+ full_name_kana: "テスト",
22
+ phone_number: "test")
23
+
24
+ errors = convenience_store.validate
25
+
26
+ assert_includes errors.keys, :phone_number
27
+ assert_includes errors[:phone_number], "is not number"
28
+ end
29
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_merchant-epsilon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenichi TAKAHASHI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-27 00:00:00.000000000 Z
11
+ date: 2015-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -189,6 +189,7 @@ files:
189
189
  - test/remote/gateways/remote_epsilon_convenience_store_test.rb
190
190
  - test/remote/gateways/remote_epsilon_test.rb
191
191
  - test/test_helper.rb
192
+ - test/unit/billing/convenience_store_test.rb
192
193
  - test/unit/gateways/epsilon_test.rb
193
194
  - wercker.yml
194
195
  homepage: http://github.com/pepabo/active_merchant-epsilon
@@ -246,4 +247,5 @@ test_files:
246
247
  - test/remote/gateways/remote_epsilon_convenience_store_test.rb
247
248
  - test/remote/gateways/remote_epsilon_test.rb
248
249
  - test/test_helper.rb
250
+ - test/unit/billing/convenience_store_test.rb
249
251
  - test/unit/gateways/epsilon_test.rb