payhyper 0.3.6 → 0.4.4

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: ca9f715921c0ba19c3a9701636e92ff57ca139a2
4
+ data.tar.gz: ac5f74d09fb41db69f5bacf2b452f730121c56b8
5
5
  SHA512:
6
- metadata.gz: 55bf2aafb1c2876d44600b3570bf4b752991d81879df4fbc25f5a3a7c75594348d0179a0e7a65a5e0ab8be06fbcebb690be5b36ab6c88f26f55e2dbdf3106023
7
- data.tar.gz: 6d0366c7fc282a8561edeafe1aa3087ca5d978a447ac3cbf4686a6f2748dd5183d6048e08d2d899436af0c6df563d2cf57e1046d8a30e716bffef33f5d37750a
6
+ metadata.gz: 22741f16005c4367c598ab4f2a15df0ec818d58cb35dde05bfbcea90eda8f3be1085f763217bcd3691a2920f2c8995fb36c4245f74ef815d1b99139a01f01755
7
+ data.tar.gz: 41c4026ec76049080fa539e8773b826328a3ab4faf67b8656dea0b31ee59c7297d9dd802520340553376d51b0e279958644cf6158cdc6c5bfc6eab4c35c2b4b2
@@ -12,20 +12,21 @@ module PayHyper
12
12
 
13
13
  unless defined?(DEBUG)
14
14
  BASE_URLS = {
15
- :live => "https://api.payhyper.com",
16
- :sandbox => "https://sandbox-api.payhyper.com",
15
+ :live => "https://api.payhyper.com",
16
+ :sandbox => "https://sandbox-api.payhyper.com",
17
17
  }
18
18
  else
19
19
  BASE_URLS = {
20
- :live => "http://api.local.local:3000",
21
- :sandbox => "http://sandbox-api.local.local:3001",
20
+ :live => "http://api.local.local:3000",
21
+ :sandbox => "http://sandbox-api.local.local:3001",
22
22
  }
23
23
  end
24
24
 
25
- CURRENCIES = %w{JOD USD BHD GBP EGP KWD OMR QAR SAR TRY AED PKR}
25
+ CURRENCIES = %w{JOD USD BHD GBP EGP KWD OMR QAR SAR TRY AED PKR IQD}
26
26
  COUNTRY_CODES = {
27
27
  "JO" => "962",
28
28
  "SA" => "966",
29
+ "IQ" => "964",
29
30
  "PK" => "92",
30
31
  }
31
32
  COUNTRIES = COUNTRY_CODES.keys
@@ -37,11 +38,12 @@ module PayHyper
37
38
  @base_url = BASE_URLS[mode]
38
39
  end
39
40
 
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.
41
+ def self.at_door!(name, phone, email, country, city, amount, currency, address = nil, invoice = nil, tag = nil, stickiness_id = nil, details = nil, location = nil) # TODO: There is a lot of overlap with "in_store!", refactor.
41
42
  raise_if_not_setup!
42
43
  # == Clean-up fields ==
43
44
  currency = currency.upcase if currency && currency.is_a?(String)
44
45
  country = country.upcase if country && country.is_a?(String)
46
+ city = city.upcase if city && city.is_a?(String)
45
47
  if phone && phone.is_a?(String)
46
48
  phone = phone.gsub(/[^0-9]/, "") # Remove non-numeric characters.
47
49
  phone = phone.gsub(/^0*/, "") # Remove leading zeros.
@@ -57,7 +59,7 @@ module PayHyper
57
59
  raise ValidationError, "Invalid email." if email.nil? || !email.match(/\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/)
58
60
  raise ValidationError, "Name is mandatory." if name.nil? || name.strip.length == 0
59
61
  # == 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 })
62
+ 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, :details => details, :location => location })
61
63
  end
62
64
 
63
65
  def self.in_store!(name, phone, email, country, amount, currency, tag = nil) # TODO: There is a lot of overlap with "at_door!", refactor.
@@ -2,7 +2,7 @@ module PayHyper
2
2
  module Security
3
3
 
4
4
  def self._sign(key, data)
5
- OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), key, data)
5
+ OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha1'), key, data)
6
6
  end
7
7
 
8
8
  def self.sign(key, data)
@@ -1,3 +1,3 @@
1
1
  module PayHyper
2
- VERSION = '0.3.6'
2
+ VERSION = '0.4.4'
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.4
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.6.12
79
79
  signing_key:
80
80
  specification_version: 4
81
81
  summary: The Ruby bindings of the Hyper API