megam_api 1.10.4 → 1.10.5

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: 1223c995d5012dfe83805b8b7583f93de7947d78
4
- data.tar.gz: f7680d52d7afcad51f6928002c939fdc8364b1d8
3
+ metadata.gz: a3d55230e517621050788df93dd6c02254ac6ad4
4
+ data.tar.gz: e7d7d0825b2ab4916aa21ddfc030d3301deb5edc
5
5
  SHA512:
6
- metadata.gz: '009a358770e7a7f47b6beb6c6a3c9c3844f94c566ee75716de90c2fbd6c14152797ebe31883723bbf985ae327207d181b298297fcac6b253cf9befbab0e4e14c'
7
- data.tar.gz: 1b45037ae5e5576a6354218482446995a8e5e9dc9c5cc460ee12d1d80f39f53617d38e888f8a31f29046c7c00401a89325b1401c3bf05a6d38d81d167aae52bc
6
+ metadata.gz: 21bf32e7a86fa5b6d793aa39942285a2ac56fb1b36e84ac9ee9718ef51a689450befab05579f57cef119b6d6b78dbb5e43ae52c25783df64a2f474f2f36c8c2a
7
+ data.tar.gz: 624cc0ece9488b61ced9cbf94109fd52a2e296133cbced0dfd075f8939a7f392ae2d456b70f4d24c0f3f3af9273f2f52e445a5b3c0872f88d7b3c0902c31597a
data/lib/megam/api.rb CHANGED
@@ -215,6 +215,7 @@ module Megam
215
215
  end
216
216
 
217
217
  def ensure_host_is_flattened
218
+
218
219
  uri = URI(@options.delete(:host)) if @options.has_key?(:host)
219
220
 
220
221
  scheme = (uri && uri.scheme) ? uri.scheme : 'http'
@@ -282,7 +283,6 @@ module Megam
282
283
 
283
284
  def encode_header
284
285
  body_base64 = Base64.urlsafe_encode64(OpenSSL::Digest::MD5.digest(@options[:body]))
285
-
286
286
  current_date = Time.now.strftime('%Y-%m-%d %H:%M')
287
287
 
288
288
  movingFactor = "#{current_date}" + "\n" + "#{@options[:path]}" + "\n" + "#{body_base64}"
@@ -295,8 +295,9 @@ module Megam
295
295
  hash = OpenSSL::HMAC.hexdigest(digest, @api_key, movingFactor)
296
296
  elsif masterkey_combo_missing?
297
297
  hash = OpenSSL::HMAC.hexdigest(digest, @master_key, movingFactor)
298
+ else
299
+ hash = ""
298
300
  end
299
-
300
301
  { hmac: (@email + ':' + hash), date: current_date }
301
302
  end
302
303
 
@@ -1,5 +1,5 @@
1
1
  module Megam
2
2
  class API
3
- VERSION = "1.10.4"
3
+ VERSION = "1.10.5"
4
4
  end
5
5
  end
data/test/test_addons.rb CHANGED
@@ -3,20 +3,24 @@ require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
3
3
  class TestApps < MiniTest::Unit::TestCase
4
4
  #=begin
5
5
  def test_post_addons
6
- tmp_hash = { :provider_id => "2334",
7
- :account_id => "",
8
- :provider_name => "whmcs",
9
- :options => [],
6
+ tmp_hash = {
7
+ :json_claz => "Megam::Addons",
8
+ :id => "48",
9
+ :provider_id => "48",
10
+ :account_id => "raj@world.com",
11
+ :provider_name => "WHMCS",
12
+ :options => [],
13
+ :created_at => "2017-01-07 11:20:16 +0530"
10
14
  }
11
15
 
12
16
  response = megams.post_addons(tmp_hash)
13
17
  assert_equal(201, response.status)
14
18
  end
15
19
  #=end
16
- #=begin
20
+ =begin
17
21
  def test_get_addon
18
22
  response = megams.get_addon("whmcs")
19
23
  assert_equal(200, response.status)
20
24
  end
21
- #=end
25
+ =end
22
26
  end
data/test/test_helper.rb CHANGED
@@ -7,8 +7,7 @@ require 'time'
7
7
 
8
8
  SANDBOX_HOST_OPTIONS = {
9
9
  :scheme => 'http',
10
- #:host => 'localhost',
11
- #:host => 'cloud.det.io',
10
+ :host => 'http://localhost:9000/v2',
12
11
  :nonblock => false,
13
12
  :port => 9000
14
13
  }
@@ -30,13 +29,12 @@ end
30
29
 
31
30
  def megams(options={})
32
31
  s_options = SANDBOX_HOST_OPTIONS.merge({
33
- :email => "rajeshr@virtengine.com",
34
- :api_key => "5e08ad5a1a3c89910a2e51fb522812fee4560baa",
32
+ :email => "raj@world.com",
33
+ :api_key => "b2ae2ea08c465556cb7abd5aff00470f",
35
34
  :org_id => "ORG6974933279242510669",
36
35
  #:password => "bWVnYW0="
37
36
  })
38
37
 
39
-
40
38
  Megam::Log.level(:debug)
41
39
  options = s_options.merge(options)
42
40
  mg=Megam::API.new(options)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: megam_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.4
4
+ version: 1.10.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajthilak, Kishorekumar Neelamegam, Ranjitha R, Vinodhini V, Rathish VBR, Rajesh
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-01-11 00:00:00.000000000 Z
12
+ date: 2017-01-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: excon