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 +4 -4
- data/.travis.yml +0 -1
- data/README.rdoc +2 -8
- data/VERSION +1 -1
- data/lib/payjp.rb +18 -5
- data/lib/payjp/version.rb +1 -1
- data/test/test_helper.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73a26dcd390d3d68c2fba6c82f17ca3dee4c629d
|
4
|
+
data.tar.gz: 1c5731750ab0c3aeb61db20af7dbdb78206d95fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4906c39eb253dc0b2361c8752354c91c5c6e52c734f7a54bebbc188c7d3042901bd68e1abec0f0cce44280c374e4143f8023b0b7b8c2271a65950b549efbb6d9
|
7
|
+
data.tar.gz: c2455852728ca0bfadd8fcf3328788f3fbf5f90148660ac9427d528f56801bc51808b90fb04e92bc60ff68128570c997634fc69cd79f49c76d091499bee3b73c
|
data/.travis.yml
CHANGED
data/README.rdoc
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
== Documentation
|
4
4
|
|
5
|
-
{PAY.JP API 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.
|
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.
|
1
|
+
0.0.4
|
data/lib/payjp.rb
CHANGED
@@ -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, :
|
95
|
-
:
|
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.
|
190
|
+
:authorization => "Basic #{Base64.strict_encode64("#{api_key}:")}",
|
178
191
|
:content_type => 'application/x-www-form-urlencoded'
|
179
192
|
}
|
180
193
|
|
data/lib/payjp/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
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.
|
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-
|
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.
|
181
|
+
rubygems_version: 2.4.8
|
182
182
|
signing_key:
|
183
183
|
specification_version: 4
|
184
184
|
summary: Ruby bindings for the Payjp API
|