paymium_api 0.0.5 → 0.0.7

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: cd2cf816dc21ba6384b3896f012afd21b44d5172
4
- data.tar.gz: 1027f7c902ab4d9e297fe6f642d037e978bfc454
3
+ metadata.gz: 6b78c5fe1953052f5fe4b0290c3c57b3990e8b35
4
+ data.tar.gz: 1e1c05f394921a36d20724ef9f7a2160997e8ed9
5
5
  SHA512:
6
- metadata.gz: 362f5d7c0e8564292d75a6639620ca126733709f1244bfe80805bff98b3c5e0fb422ea901abcada0c8edb672719282658a29c4e125e56af8130aac771f20876c
7
- data.tar.gz: 4f172ef1639dfc76b048da0fdf8e16aaed4a6176b75f3f2dbe8859488582d2576e09c3b8d0ed95558cc3e1ba6ca85f06f224573d652e12447793ccb96a1a4c25
6
+ metadata.gz: 82feb72be7c2c9f7d14fb48194a10c26ca6aca7b3013f9e3874582a79f1fe7916746fccd8c98980fda28e2a1a792ddd8c2527d1e76731bed5a75493488e61690
7
+ data.tar.gz: 37220d07bc555166ae906f79ef0a099f56699cb1919ccd8a05eb7091f01b6955b41307445793610b5bb53f3daff9e61319e01aaacc7e795015429a5c85611236
data/.gitignore CHANGED
@@ -1,5 +1,6 @@
1
1
  *.gem
2
2
  *.rbc
3
+ *.swp
3
4
  .bundle
4
5
  .config
5
6
  .yardoc
@@ -16,4 +17,4 @@ test/tmp
16
17
  test/version_tmp
17
18
  tmp
18
19
  config.yaml
19
- .idea
20
+ .idea
@@ -1,11 +1,9 @@
1
- require "active_support/hash_with_indifferent_access"
2
- require "active_support/core_ext/object/blank"
3
- require "net/http"
4
- require 'JSON'
1
+ require 'active_support/hash_with_indifferent_access'
2
+ require 'active_support/core_ext/object/blank'
3
+ require 'net/http'
5
4
 
6
5
  require 'openssl'
7
- require 'Base64'
8
-
6
+ require 'base64'
9
7
 
10
8
  module Paymium
11
9
  module Api
@@ -24,7 +22,7 @@ module Paymium
24
22
 
25
23
  def post path, params = {}, &block
26
24
  req = Net::HTTP::Post.new(uri_from_path(path))
27
- req.body = params.to_json
25
+ req.body = Oj.dump(params)
28
26
  request req, &block
29
27
  end
30
28
 
@@ -60,7 +58,7 @@ module Paymium
60
58
  #todo use Oj to parse response to handle big decimal
61
59
  def handle_response resp, &block
62
60
  if resp.class < Net::HTTPSuccess
63
- resp = JSON.parse(resp.body)
61
+ resp = Oj.load(resp.body)
64
62
  block.nil? ? resp : block.call(resp)
65
63
  else
66
64
  raise Error, resp.message
@@ -1,5 +1,5 @@
1
1
  module Paymium
2
2
  module Api
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
data/lib/paymium_api.rb CHANGED
@@ -1,3 +1,11 @@
1
+ require 'oj'
2
+
3
+ Oj.default_options = {
4
+ bigdecimal_load: true,
5
+ bigdecimal_as_decimal: true,
6
+ mode: :compat
7
+ }
8
+
1
9
  require 'paymium/api/client'
2
10
  require 'paymium/api/version'
3
11
 
data/paymium_api.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.required_ruby_version = '~> 2.0'
21
21
 
22
22
  spec.add_dependency 'activesupport'
23
- spec.add_dependency 'json'
23
+ spec.add_dependency 'oj'
24
24
  spec.add_development_dependency "bundler", "~> 1.5"
25
25
  spec.add_development_dependency "rake"
26
26
  spec.add_development_dependency "pry"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paymium_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - itkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-10 00:00:00.000000000 Z
11
+ date: 2015-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: json
28
+ name: oj
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '>='
@@ -122,3 +122,4 @@ signing_key:
122
122
  specification_version: 4
123
123
  summary: Paymium API client
124
124
  test_files: []
125
+ has_rdoc: