payjp 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e14e02760f0aad2a6a5e7b0f8e23084d88a044fb
4
- data.tar.gz: 01accdf3cccabf88b3484cca056e024e3956787f
3
+ metadata.gz: 73a26dcd390d3d68c2fba6c82f17ca3dee4c629d
4
+ data.tar.gz: 1c5731750ab0c3aeb61db20af7dbdb78206d95fd
5
5
  SHA512:
6
- metadata.gz: 036359620d0da877df8d36be0d7a0a3c9d76796cd768f9928737f0e571d9d866d4050f8b829146f63904ba44fe14a7bb86c78fa25ac5374e5b38d3061b1ff94f
7
- data.tar.gz: 3db817dd60fdd2c82dbf68f7d1328f2d68e7fc7417915c5678f6dd18aa49dce7d608946b32633cd947527b906859f04565062ceea9ca48f40b2e3b49cf215608
6
+ metadata.gz: 4906c39eb253dc0b2361c8752354c91c5c6e52c734f7a54bebbc188c7d3042901bd68e1abec0f0cce44280c374e4143f8023b0b7b8c2271a65950b549efbb6d9
7
+ data.tar.gz: c2455852728ca0bfadd8fcf3328788f3fbf5f90148660ac9427d528f56801bc51808b90fb04e92bc60ff68128570c997634fc69cd79f49c76d091499bee3b73c
@@ -1,7 +1,6 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 1.8.7
5
4
  - 1.9.2
6
5
  - 1.9.3
7
6
  - 2.0.0
@@ -2,7 +2,7 @@
2
2
 
3
3
  == Documentation
4
4
 
5
- {PAY.JP API Docs}[http://pay.readme.io/v1.0/docs]
5
+ {PAY.JP API Docs}[https://pay.jp/docs/api/]
6
6
 
7
7
  == Installation
8
8
 
@@ -17,13 +17,7 @@ If you want to build the gem from source:
17
17
 
18
18
  == Requirements
19
19
 
20
- * Ruby 1.8.7 or above. (Ruby 1.8.6 may work if you load
21
- ActiveSupport.) For Ruby versions before 1.9.2, you'll need to add this to your Gemfile:
22
-
23
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('1.9.2')
24
- gem 'rest-client', '~> 1.6.8'
25
- end
26
-
20
+ * Ruby 1.9.3 or above.
27
21
 
28
22
  * rest-client, json
29
23
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -45,17 +45,28 @@ require 'payjp/errors/authentication_error'
45
45
 
46
46
  module Payjp
47
47
  @api_base = 'https://api.pay.jp'
48
+ @open_timeout = 30
49
+ @read_timeout = 80
50
+ @ssl_ca_file = nil
51
+ @ssl_ca_path = nil
52
+ @ssl_cert_store = nil
48
53
 
49
54
  class << self
50
- attr_accessor :api_key, :api_base, :api_version, :connect_base, :uploads_base
55
+ attr_accessor :api_key, :api_base, :api_version, :connect_base, :uploads_base,
56
+ :open_timeout, :read_timeout, :ssl_ca_file, :ssl_ca_path, :ssl_cert_store
51
57
  end
52
58
 
53
59
  def self.api_url(url = '', api_base_url = nil)
54
60
  (api_base_url || @api_base) + url
55
61
  end
56
62
 
57
- def self.request(method, url, api_key, params = {}, headers = {}, api_base_url = nil)
63
+ def self.request(method, url, api_key, params = {}, headers = {}, api_base_url = nil, open_timeout = nil, read_timeout = nil, ssl_ca_file = nil, ssl_ca_path = nil, ssl_cert_store = nil)
58
64
  api_base_url ||= @api_base
65
+ open_timeout ||= @open_timeout
66
+ read_timeout ||= @read_timeout
67
+ ssl_ca_file ||= @ssl_ca_file
68
+ ssl_ca_path ||= @ssl_ca_path
69
+ ssl_cert_store ||= @ssl_cert_store
59
70
 
60
71
  unless api_key ||= @api_key
61
72
  raise AuthenticationError.new('No API key provided. ' \
@@ -91,8 +102,10 @@ module Payjp
91
102
  end
92
103
 
93
104
  request_opts.update(:headers => request_headers(api_key).update(headers),
94
- :method => method, :open_timeout => 30,
95
- :payload => payload, :url => url, :timeout => 80)
105
+ :method => method, :payload => payload, :url => url,
106
+ :open_timeout => open_timeout, :read_timeout => read_timeout,
107
+ :ssl_ca_file => ssl_ca_file, :ssl_ca_path => ssl_ca_path,
108
+ :ssl_cert_store => ssl_cert_store)
96
109
 
97
110
  begin
98
111
  # $stderr.puts request_opts
@@ -174,7 +187,7 @@ module Payjp
174
187
  def self.request_headers(api_key)
175
188
  headers = {
176
189
  :user_agent => "Payjp/v1 RubyBindings/#{Payjp::VERSION}",
177
- :authorization => "Basic #{Base64.encode64("#{api_key}:")}",
190
+ :authorization => "Basic #{Base64.strict_encode64("#{api_key}:")}",
178
191
  :content_type => 'application/x-www-form-urlencoded'
179
192
  }
180
193
 
@@ -1,3 +1,3 @@
1
1
  module Payjp
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -29,7 +29,7 @@ class Test::Unit::TestCase
29
29
  include Mocha
30
30
 
31
31
  def encode_credentials(user_name)
32
- "Basic #{Base64.encode64("#{user_name}:")}"
32
+ "Basic #{Base64.strict_encode64("#{user_name}:")}"
33
33
  end
34
34
 
35
35
  setup do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payjp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - PAY.JP
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-08 00:00:00.000000000 Z
11
+ date: 2015-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  version: '0'
179
179
  requirements: []
180
180
  rubyforge_project:
181
- rubygems_version: 2.4.5
181
+ rubygems_version: 2.4.8
182
182
  signing_key:
183
183
  specification_version: 4
184
184
  summary: Ruby bindings for the Payjp API