pokepay_partner_ruby_sdk 0.1.15 → 0.1.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/docs/index.md +14 -0
- data/lib/pokepay_partner_ruby_sdk/client.rb +24 -13
- data/lib/pokepay_partner_ruby_sdk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faed3d5fea3e95e4593e617fcac553c4a2562e9110ee14a5dc3209ec12b02f78
|
4
|
+
data.tar.gz: 68ad70dc763a253d51a153e11cea8c1a5f88b4a1328e2582941022fd5bfdf73b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96dc299dea8f3db2f0cd7ab4607335eaeee7cc83f378ce70bf41515b61d95e63bcd53a869920ddeeed8c127ab5f6daef445e8d0d4a4f4bb922ec4fc631b112ce
|
7
|
+
data.tar.gz: 67954f60e9cde1e54b63899575ae2dd2829acba462467af2acaf2783bd0b280b087aa1de3b202a2fc30e097e32fd4a5f6ded108fe499ba94229c8ef9ddb933ae
|
data/Gemfile.lock
CHANGED
data/docs/index.md
CHANGED
@@ -57,6 +57,20 @@ SSL_KEY_FILE = /path/to/key.pem
|
|
57
57
|
SSL_CERT_FILE = /path/to/cert.pem
|
58
58
|
```
|
59
59
|
|
60
|
+
設定はハッシュで渡すこともできます。
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
client = Pokepay::Client.new(
|
64
|
+
{
|
65
|
+
client_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
|
66
|
+
client_secret: "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
|
67
|
+
api_base_url: "https://partnerapi-sandbox.pokepay.jp",
|
68
|
+
ssl_key_file: "/path/to/key.pem",
|
69
|
+
ssl_cert_file: "/path/to/cert.pem"
|
70
|
+
}
|
71
|
+
)
|
72
|
+
```
|
73
|
+
|
60
74
|
## Overview
|
61
75
|
|
62
76
|
### APIリクエスト
|
@@ -12,20 +12,31 @@ require "pokepay_partner_ruby_sdk/crypto"
|
|
12
12
|
|
13
13
|
module Pokepay
|
14
14
|
class Client
|
15
|
-
def initialize(
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
def initialize(inifile_or_hash)
|
16
|
+
case inifile_or_hash
|
17
|
+
when String then
|
18
|
+
path = File.expand_path(inifile_or_hash)
|
19
|
+
if File.exist?(path)
|
20
|
+
ini = IniFile.load(path)
|
21
|
+
else
|
22
|
+
raise "init file does not exist."
|
23
|
+
end
|
24
|
+
@client_id = ini['global']['CLIENT_ID']
|
25
|
+
@client_secret = ini['global']['CLIENT_SECRET']
|
26
|
+
@api_base_url = URI.parse(ini['global']['API_BASE_URL'])
|
27
|
+
@ssl_key_file = ini['global']['SSL_KEY_FILE']
|
28
|
+
@ssl_cert_file = ini['global']['SSL_CERT_FILE']
|
29
|
+
@timezone = ini['global']['TIMEZONE']
|
30
|
+
@timeout = ini['global']['TIMEOUT']
|
31
|
+
when Hash then
|
32
|
+
@client_id = inifile_or_hash[:client_id]
|
33
|
+
@client_secret = inifile_or_hash[:client_secret]
|
34
|
+
@api_base_url = URI.parse(inifile_or_hash[:api_base_url])
|
35
|
+
@ssl_key_file = inifile_or_hash[:ssl_key_file]
|
36
|
+
@ssl_cert_file = inifile_or_hash[:ssl_cert_file]
|
37
|
+
@timezone = inifile_or_hash[:timezone]
|
38
|
+
@timeout = inifile_or_hash[:timeout]
|
21
39
|
end
|
22
|
-
@client_id = ini['global']['CLIENT_ID']
|
23
|
-
@client_secret = ini['global']['CLIENT_SECRET']
|
24
|
-
@api_base_url = URI.parse(ini['global']['API_BASE_URL'])
|
25
|
-
@ssl_key_file = ini['global']['SSL_KEY_FILE']
|
26
|
-
@ssl_cert_file = ini['global']['SSL_CERT_FILE']
|
27
|
-
@timezone = ini['global']['TIMEZONE']
|
28
|
-
@timeout = ini['global']['TIMEOUT']
|
29
40
|
@http = Net::HTTP.new(@api_base_url.host, @api_base_url.port)
|
30
41
|
if @api_base_url.scheme == 'https'
|
31
42
|
@http.use_ssl = true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pokepay_partner_ruby_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.15
|
4
|
+
version: 0.1.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pocket Change, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|