payhyper 0.3.6 → 0.4.0

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: 3b9c6e5b7c7b5b9393bba89ce3f636f0109f34e5
4
- data.tar.gz: 49fd81185c5ecdd060e197452ef4f019a8d05fb3
3
+ metadata.gz: da28bd603c96a3a9cb540d30fcd833811dfae20d
4
+ data.tar.gz: 12e69092dda839f62ab3c00db2096e2821f31e08
5
5
  SHA512:
6
- metadata.gz: 55bf2aafb1c2876d44600b3570bf4b752991d81879df4fbc25f5a3a7c75594348d0179a0e7a65a5e0ab8be06fbcebb690be5b36ab6c88f26f55e2dbdf3106023
7
- data.tar.gz: 6d0366c7fc282a8561edeafe1aa3087ca5d978a447ac3cbf4686a6f2748dd5183d6048e08d2d899436af0c6df563d2cf57e1046d8a30e716bffef33f5d37750a
6
+ metadata.gz: 42a531eb123eb8637d56c0c1efdd5578a179bcdda5cd70255aac9eda1da3ef6e1459ea2dd4b57ffe7c53ef62d3cc1090d8f68006f2d28eec371471d2d02cf7ba
7
+ data.tar.gz: 96079d6b3ffbe2b804bd6b850089a757e47c1952f02090ee194ebeed297a9261e22eb8e482170b1c15f4edd08ad9fbe254630ab728f45ff75ba793bc2e9472ff
data/lib/payhyper.rb CHANGED
@@ -37,11 +37,12 @@ module PayHyper
37
37
  @base_url = BASE_URLS[mode]
38
38
  end
39
39
 
40
- def self.at_door!(name, phone, email, country, amount, currency, address = nil, invoice = nil, tag = nil, stickiness_id = nil) # TODO: There is a lot of overlap with "in_store!", refactor.
40
+ def self.at_door!(name, phone, email, country, city, amount, currency, address = nil, invoice = nil, tag = nil, stickiness_id = nil) # TODO: There is a lot of overlap with "in_store!", refactor.
41
41
  raise_if_not_setup!
42
42
  # == Clean-up fields ==
43
43
  currency = currency.upcase if currency && currency.is_a?(String)
44
44
  country = country.upcase if country && country.is_a?(String)
45
+ city = city.upcase if city && city.is_a?(String)
45
46
  if phone && phone.is_a?(String)
46
47
  phone = phone.gsub(/[^0-9]/, "") # Remove non-numeric characters.
47
48
  phone = phone.gsub(/^0*/, "") # Remove leading zeros.
@@ -57,7 +58,7 @@ module PayHyper
57
58
  raise ValidationError, "Invalid email." if email.nil? || !email.match(/\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/)
58
59
  raise ValidationError, "Name is mandatory." if name.nil? || name.strip.length == 0
59
60
  # == Do the request ==
60
- make_call("/v1/at-door", { :name => name, :phone => phone, :email => email, :country => country, :amount => amount, :currency => currency, :address => address, :invoice => invoice, :tag => tag, :stickiness_id => stickiness_id })
61
+ make_call("/v1/at-door", { :name => name, :phone => phone, :email => email, :country => country, :city => city, :amount => amount, :currency => currency, :address => address, :invoice => invoice, :tag => tag, :stickiness_id => stickiness_id })
61
62
  end
62
63
 
63
64
  def self.in_store!(name, phone, email, country, amount, currency, tag = nil) # TODO: There is a lot of overlap with "at_door!", refactor.
@@ -1,3 +1,3 @@
1
1
  module PayHyper
2
- VERSION = '0.3.6'
2
+ VERSION = '0.4.0'
3
3
  end
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.6
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sinan Taifour
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  version: '0'
76
76
  requirements: []
77
77
  rubyforge_project:
78
- rubygems_version: 2.6.8
78
+ rubygems_version: 2.4.5.1
79
79
  signing_key:
80
80
  specification_version: 4
81
81
  summary: The Ruby bindings of the Hyper API