payhyper 0.4.1 → 0.4.6

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: e1ac55a84709d172ef973b489f55b3177003bd96
4
- data.tar.gz: 93f9fd2ba44ade6de09c8a4ae523f978260129d5
3
+ metadata.gz: aada0d54d9876d60aef30729eb1f363164d511ed
4
+ data.tar.gz: ffdeca74a07d40f5b3a00e944e779a351cc718ed
5
5
  SHA512:
6
- metadata.gz: 4eb4f20157023d55319add05ae5ce0f5e38142f54a556899a57c30cb1a471094914d6062bace4f406d6d1c6c5a6a95d2d8d6cf3ca528040d98833fb20417d3b0
7
- data.tar.gz: 2b1e0f0d66831d9d6411b1b3da04b92a690c4f9d2a0ed8a474555db1541c3b9872a4821f74ff5a39f5c804f910f293b89198c39b699581ee08735a8bf47f954c
6
+ metadata.gz: 9e8ba5dd1d185202991a5bf98926ffe7dc6e4e64cb4a542e9373949f32ca45e9c410a6551cc6392b33bbe23b9e2ec171b4509b2ea0ed2f672a10c5e03c022190
7
+ data.tar.gz: a5d4e8a1512decaab64cbb18232dbad90622353d193e788b06b03d34f8cd04e35844bfcbfdec1f8296b26935f8a395d6d5edc0e6e2ec8104f2d0ba9f9a2ceee0
data/lib/payhyper.rb CHANGED
@@ -22,10 +22,11 @@ module PayHyper
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,7 +38,7 @@ module PayHyper
37
38
  @base_url = BASE_URLS[mode]
38
39
  end
39
40
 
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
+ 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)
@@ -58,7 +59,7 @@ module PayHyper
58
59
  raise ValidationError, "Invalid email." if email.nil? || !email.match(/\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/)
59
60
  raise ValidationError, "Name is mandatory." if name.nil? || name.strip.length == 0
60
61
  # == Do the request ==
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 })
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 })
62
63
  end
63
64
 
64
65
  def self.in_store!(name, phone, email, country, amount, currency, tag = nil) # TODO: There is a lot of overlap with "at_door!", refactor.
@@ -128,7 +129,7 @@ module PayHyper
128
129
  uri = URI.parse(@base_url + endpoint)
129
130
  content_type = "application/json; charset=utf-8"
130
131
  signature = Security.sign(@access_key_secret, ["POST", uri.port == uri.default_port ? uri.host : "#{uri.host}:#{uri.port}", uri.request_uri, content_type, body.encode("UTF-8")].join("\n")) # Would be great if this could read directly from the request's headers.
131
- res = RestClient.post(@base_url + endpoint, body, :content_type => content_type, :authorization => "Hyper #{@access_key_id}:#{signature}")
132
+ res = RestClient.post(@base_url + endpoint, body, :content_type => content_type, :authorization => "Hyper #{@access_key_id}:#{signature}", ssl_ciphers: RestClient::Request::DefaultCiphers)
132
133
  failure = false
133
134
  rescue RestClient::Exception => e # HTTP status codes not in 200-207, 301-303 and 307 result in a RestClient::Exception.
134
135
  if e.http_code && e.http_code.to_i == 422 && e.http_body
@@ -1,3 +1,3 @@
1
1
  module PayHyper
2
- VERSION = '0.4.1'
2
+ VERSION = '0.4.6'
3
3
  end
data/payhyper.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.files = `git ls-files`.split("\n")
17
17
  s.require_paths = ['lib']
18
18
 
19
- s.add_dependency('rest-client', '~> 1.4')
19
+ s.add_dependency('rest-client', '~> 2.1.0')
20
20
  s.add_dependency('multi_json', '>= 1.0.4', '< 2')
21
21
 
22
22
  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.4.1
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sinan Taifour
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.4'
19
+ version: 2.1.0
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
- version: '1.4'
26
+ version: 2.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: multi_json
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -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.4.5.1
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