mxit_api 0.2.0.pre → 0.2.1.pre

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ class MxitApi
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- PATCH = 0
5
+ PATCH = 1
6
6
  BUILD = 'pre'
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
@@ -17,9 +17,11 @@ class MxitMoneyApi
17
17
  url = URI.parse('https://m2api.fireid.com/paymentsplatform/rest/v3/push/')
18
18
  req = Net::HTTP::Get.new(url.path, 'Accept'=>'application/json')
19
19
  req.basic_auth(api_key,"mxit_money_api")
20
- http = Net::HTTP.new(url.host, url.port)
21
- http.use_ssl = true
22
- response = http.request(req)
20
+ response = Net::HTTP.start(url.host, url.port,
21
+ :use_ssl => url.scheme == 'https',
22
+ :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |https|
23
+ https.request(req)
24
+ end
23
25
  if response.code == '200'
24
26
  data = ActiveSupport::JSON.decode(response.body)
25
27
  @balance = data['balance']
@@ -7,9 +7,11 @@ class MxitMoneyApi
7
7
  'Accept'=>'application/json',
8
8
  'Content-Type' =>'application/json')
9
9
  req.basic_auth(api_key,"mxit_money_api".to_s)
10
- http = Net::HTTP.new(url.host, url.port)
11
- http.use_ssl = true
12
- response = http.request(req)
10
+ response = Net::HTTP.start(url.host, url.port,
11
+ :use_ssl => url.scheme == 'https',
12
+ :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |https|
13
+ https.request(req)
14
+ end
13
15
  if response.code == '200' || response.code == '401' || response.code == '500' || response.code == '400'
14
16
  @balance = nil
15
17
  data = ActiveSupport::JSON.decode(response.body)
data/mxit_api.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "mxit_api"
8
- s.version = "0.2.0.pre"
8
+ s.version = "0.2.1.pre"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Grant Speelman"]
12
- s.date = "2013-01-09"
12
+ s.date = "2013-01-18"
13
13
  s.description = "gem to use the Mxit APIs at http://dev.mxit.com/docs/ "
14
14
  s.email = "grant.speelman@unboxedconsulting.com"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mxit_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.pre
4
+ version: 0.2.1.pre
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-09 00:00:00.000000000 Z
12
+ date: 2013-01-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -231,7 +231,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
231
231
  version: '0'
232
232
  segments:
233
233
  - 0
234
- hash: 3691744955216269910
234
+ hash: -4321529454908252784
235
235
  required_rubygems_version: !ruby/object:Gem::Requirement
236
236
  none: false
237
237
  requirements: