pokepay_partner_ruby_sdk 0.1.15 → 0.1.15.1

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
  SHA256:
3
- metadata.gz: e6cacb8fdcd152d15247add9b684aa42aa2000fc82d0f9d885bb93d30c8405f9
4
- data.tar.gz: 39e29d2468e16480aaef93c1c3e81945d1af5afd1891a4b9d155d13a698a797a
3
+ metadata.gz: faed3d5fea3e95e4593e617fcac553c4a2562e9110ee14a5dc3209ec12b02f78
4
+ data.tar.gz: 68ad70dc763a253d51a153e11cea8c1a5f88b4a1328e2582941022fd5bfdf73b
5
5
  SHA512:
6
- metadata.gz: 883f971621a2cdb750bd9047f7f46c119c83b324709e7517aec880c8fcdd7d4804221e0a064382dccae924d0e0919170b13d7e05c87a2a9d5dd174b700c36b95
7
- data.tar.gz: 6d2fed68f0d9d39b94ea37b02469c53e41ce0097a790c3191aee93f013b5b61bea3d67977979f632d52af45035f86220c6254ab9c7e3beb76a7f8f26ba288ac5
6
+ metadata.gz: 96dc299dea8f3db2f0cd7ab4607335eaeee7cc83f378ce70bf41515b61d95e63bcd53a869920ddeeed8c127ab5f6daef445e8d0d4a4f4bb922ec4fc631b112ce
7
+ data.tar.gz: 67954f60e9cde1e54b63899575ae2dd2829acba462467af2acaf2783bd0b280b087aa1de3b202a2fc30e097e32fd4a5f6ded108fe499ba94229c8ef9ddb933ae
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pokepay_partner_ruby_sdk (0.1.15)
4
+ pokepay_partner_ruby_sdk (0.1.15.1)
5
5
  inifile (~> 3.0.0)
6
6
  json (~> 2.3.0)
7
7
  openssl (~> 2.1.2)
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(path_to_inifile)
16
- path = File.expand_path(path_to_inifile)
17
- if File.exist?(path)
18
- ini = IniFile.load(path)
19
- else
20
- raise "init file does not exist."
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
@@ -1,3 +1,3 @@
1
1
  module Pokepay
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.15.1"
3
3
  end
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-05 00:00:00.000000000 Z
11
+ date: 2021-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler