payhyper 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a0765918e4ad00fc1a1efb9c21030831110d50fe
4
- data.tar.gz: 5f424f23813782dc5cdc916bd1c7ad03dbc09574
3
+ metadata.gz: 2129a8ecbc0b73e5378794a46a5c439d5f8f490a
4
+ data.tar.gz: 0e987eba5a23fa3ba059fc6dc8fc67ccfa1f984c
5
5
  SHA512:
6
- metadata.gz: 69080fb75e1f6cfb4eaa815100524d14f2c40c64bff2fc0eec990e1c92126119921259793f3d3b029a280e603f787d5f7cd8f6e146fea156afba1cb7481d3a4a
7
- data.tar.gz: ee023675b08c6964f5d7644d5bc17516f67dde123760c98d80c9b981c10957c5c80e830399a9d265d94bf0ffcc55e6ad68e804c5f66a8bf804583bf21e97d171
6
+ metadata.gz: 94966e3e3628a2b52f37ca4d62a2be59701eea107360bd6a68c7b8e175b93066a41ab2f03d264b4e5103daa1c47d8be1df8d5c577d30bf41dfba60066ea6eac6
7
+ data.tar.gz: bf0e589d78df0c381f5ef70ea62262cc648337c1eff521d7a73ccf318967dde0669f5fbe2d72a28060299bff621606bd96832b01ba78da5b9a5f6cf3ba189e17
@@ -1,3 +1,3 @@
1
1
  module PayHyper
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
data/lib/payhyper.rb CHANGED
@@ -25,6 +25,7 @@ module PayHyper
25
25
  CURRENCIES = %w{JOD USD BHD GBP EGP KWD OMR QAR SAR TRY AED}
26
26
  COUNTRY_CODES = {
27
27
  "JO" => "962",
28
+ "SA" => "966",
28
29
  }
29
30
  COUNTRIES = COUNTRY_CODES.keys
30
31
 
@@ -51,7 +52,7 @@ module PayHyper
51
52
  raise ValidationError, "Country specified is incorrect or not supported." unless COUNTRIES.include?(country)
52
53
  raise ValidationError, "Incorrect amount, must be positive." if amount.to_i <= 0
53
54
  raise ValidationError, "Currency is incorrect or not supported." unless CURRENCIES.include?(currency)
54
- raise ValidationError, "Incorrect phone, or not in a supported country." if phone.nil? || !phone.match(/\A962[0-9]{8,9}\z/)
55
+ raise ValidationError, "Incorrect phone, or not in a supported country." if phone.nil? || !phone.match(/\A#{COUNTRY_CODES[country]}[0-9]{8,9}\z/)
55
56
  raise ValidationError, "Invalid email." if email.nil? || !email.match(/\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/)
56
57
  raise ValidationError, "Name is mandatory." if name.nil? || name.strip.length == 0
57
58
  # == Do the request ==
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payhyper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sinan Taifour
@@ -14,34 +14,34 @@ dependencies:
14
14
  name: rest-client
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.4'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: multi_json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.0.4
34
- - - <
34
+ - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: '2'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - '>='
41
+ - - ">="
42
42
  - !ruby/object:Gem::Version
43
43
  version: 1.0.4
44
- - - <
44
+ - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '2'
47
47
  description: Hyper is an API for cash collection. See http://payhyper.com for more.
@@ -65,17 +65,17 @@ require_paths:
65
65
  - lib
66
66
  required_ruby_version: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - '>='
68
+ - - ">="
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  requirements: []
77
77
  rubyforge_project:
78
- rubygems_version: 2.2.2
78
+ rubygems_version: 2.5.1
79
79
  signing_key:
80
80
  specification_version: 4
81
81
  summary: The Ruby bindings of the Hyper API