pokepay_partner_ruby_sdk 0.1.1 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +7 -7
  3. data/README.md +14 -0
  4. data/docs/index.md +1065 -96
  5. data/examples/examples.rb +178 -13
  6. data/lib/pokepay_partner_ruby_sdk.rb +57 -6
  7. data/lib/pokepay_partner_ruby_sdk/client.rb +9 -7
  8. data/lib/pokepay_partner_ruby_sdk/request/create_bill.rb +16 -0
  9. data/lib/pokepay_partner_ruby_sdk/request/create_check.rb +15 -0
  10. data/lib/pokepay_partner_ruby_sdk/request/create_customer_account.rb +15 -0
  11. data/lib/pokepay_partner_ruby_sdk/request/create_exchange_transaction.rb +18 -0
  12. data/lib/pokepay_partner_ruby_sdk/request/create_organization.rb +19 -0
  13. data/lib/pokepay_partner_ruby_sdk/request/create_payment_transaction.rb +18 -0
  14. data/lib/pokepay_partner_ruby_sdk/request/create_shop.rb +15 -0
  15. data/lib/pokepay_partner_ruby_sdk/request/create_topup_transaction.rb +17 -0
  16. data/lib/pokepay_partner_ruby_sdk/request/create_topup_transaction_with_check.rb +16 -0
  17. data/lib/pokepay_partner_ruby_sdk/request/create_transaction.rb +5 -5
  18. data/lib/pokepay_partner_ruby_sdk/request/create_transfer_transaction.rb +18 -0
  19. data/lib/pokepay_partner_ruby_sdk/request/get_account.rb +15 -0
  20. data/lib/pokepay_partner_ruby_sdk/request/get_ping.rb +15 -0
  21. data/lib/pokepay_partner_ruby_sdk/request/get_private_money_organization_summaries.rb +15 -0
  22. data/lib/pokepay_partner_ruby_sdk/request/get_transaction.rb +15 -0
  23. data/lib/pokepay_partner_ruby_sdk/request/get_user.rb +15 -0
  24. data/lib/pokepay_partner_ruby_sdk/request/list_account_balances.rb +15 -0
  25. data/lib/pokepay_partner_ruby_sdk/request/list_account_expired_balances.rb +15 -0
  26. data/lib/pokepay_partner_ruby_sdk/request/list_bills.rb +15 -0
  27. data/lib/pokepay_partner_ruby_sdk/request/list_customer_transactions.rb +15 -0
  28. data/lib/pokepay_partner_ruby_sdk/request/list_shops.rb +15 -0
  29. data/lib/pokepay_partner_ruby_sdk/request/list_transactions.rb +7 -4
  30. data/lib/pokepay_partner_ruby_sdk/request/list_transfers.rb +15 -0
  31. data/lib/pokepay_partner_ruby_sdk/request/list_user_accounts.rb +15 -0
  32. data/lib/pokepay_partner_ruby_sdk/request/refund_transaction.rb +15 -0
  33. data/lib/pokepay_partner_ruby_sdk/request/send_echo.rb +4 -1
  34. data/lib/pokepay_partner_ruby_sdk/request/update_account.rb +15 -0
  35. data/lib/pokepay_partner_ruby_sdk/request/update_bill.rb +15 -0
  36. data/lib/pokepay_partner_ruby_sdk/response/account.rb +2 -0
  37. data/lib/pokepay_partner_ruby_sdk/response/account_balance.rb +15 -0
  38. data/lib/pokepay_partner_ruby_sdk/response/account_detail.rb +24 -0
  39. data/lib/pokepay_partner_ruby_sdk/response/account_with_user.rb +21 -0
  40. data/lib/pokepay_partner_ruby_sdk/response/account_without_private_money_detail.rb +20 -0
  41. data/lib/pokepay_partner_ruby_sdk/response/admin_user_with_shops_and_private_moneys.rb +26 -0
  42. data/lib/pokepay_partner_ruby_sdk/response/bad_request.rb +11 -0
  43. data/lib/pokepay_partner_ruby_sdk/response/bill.rb +26 -0
  44. data/lib/pokepay_partner_ruby_sdk/response/check.rb +37 -0
  45. data/lib/pokepay_partner_ruby_sdk/response/echo.rb +6 -3
  46. data/lib/pokepay_partner_ruby_sdk/response/invalid_parameters.rb +15 -0
  47. data/lib/pokepay_partner_ruby_sdk/response/organization.rb +3 -0
  48. data/lib/pokepay_partner_ruby_sdk/response/organization_summary.rb +19 -0
  49. data/lib/pokepay_partner_ruby_sdk/response/paginated_account_balance.rb +16 -0
  50. data/lib/pokepay_partner_ruby_sdk/response/paginated_accounts.rb +16 -0
  51. data/lib/pokepay_partner_ruby_sdk/response/paginated_bills.rb +16 -0
  52. data/lib/pokepay_partner_ruby_sdk/response/paginated_private_money_organization_summaries.rb +16 -0
  53. data/lib/pokepay_partner_ruby_sdk/response/paginated_shops.rb +16 -0
  54. data/lib/pokepay_partner_ruby_sdk/response/paginated_transaction.rb +16 -0
  55. data/lib/pokepay_partner_ruby_sdk/response/paginated_transfers.rb +16 -0
  56. data/lib/pokepay_partner_ruby_sdk/response/pagination.rb +9 -6
  57. data/lib/pokepay_partner_ruby_sdk/response/partner_client_not_found.rb +13 -0
  58. data/lib/pokepay_partner_ruby_sdk/response/partner_decryption_failed.rb +13 -0
  59. data/lib/pokepay_partner_ruby_sdk/response/partner_request_already_done.rb +13 -0
  60. data/lib/pokepay_partner_ruby_sdk/response/partner_request_expired.rb +13 -0
  61. data/lib/pokepay_partner_ruby_sdk/response/pong.rb +11 -0
  62. data/lib/pokepay_partner_ruby_sdk/response/private_money.rb +8 -0
  63. data/lib/pokepay_partner_ruby_sdk/response/private_money_organization_summary.rb +17 -0
  64. data/lib/pokepay_partner_ruby_sdk/response/response.rb +3 -3
  65. data/lib/pokepay_partner_ruby_sdk/response/shop_with_metadata.rb +25 -0
  66. data/lib/pokepay_partner_ruby_sdk/response/transaction.rb +5 -1
  67. data/lib/pokepay_partner_ruby_sdk/response/transfer.rb +31 -0
  68. data/lib/pokepay_partner_ruby_sdk/response/user.rb +3 -0
  69. data/lib/pokepay_partner_ruby_sdk/response/user_transaction.rb +33 -0
  70. data/lib/pokepay_partner_ruby_sdk/version.rb +1 -1
  71. data/partner.yaml +2250 -0
  72. data/pokepay_partner_ruby_sdk.gemspec +4 -4
  73. metadata +64 -13
  74. data/lib/pokepay_partner_ruby_sdk/response/transactions.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b462bd0f2ea7bce3ec40b034bb138999de416b4618f956042d97cce6ab592ffa
4
- data.tar.gz: 887c9023e4346498b6ef4cef2e0cebd125d9b28e5d19fe0ff06ad7e489eb645d
3
+ metadata.gz: 9db39bf7da512ddaf415d0312da429572674806d75d1a5beca492a8e10860f4b
4
+ data.tar.gz: 843b0548ce65832615325185665fd702b52dadcc13deadb0f0a3edbd7123d6a5
5
5
  SHA512:
6
- metadata.gz: e1e978f24e716234f533e02221f9e77c6f56f892fa6be91ff998be328fcf231ba47ddad601736bd6df5c6c5a3ec28b143aeabe369dcd33601ab27eb06684c536
7
- data.tar.gz: 5a722a10444c8ac32a2ed0b61408925ffc336d1367b14c2cce51c20a5b41f9d4fbcafe2042bdd16541c3184f5d15957b7cb41b85bacf226910c11f341ab67130
6
+ metadata.gz: 174b9e30acfcd57947de69f0860fb0def5703b4a35b6d90931760bcf604799bb6c5bd2e6d43428929a53452b88eb2736ed013d0e32646254ca7547f03906ce2e
7
+ data.tar.gz: ab2167de48835f66b92a3db675e768288736ad04376a76d2415b291d2146888ad6c24296ce345436a2bfa23f24da15169b7ec94bea7513452302d96122c1d07d
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pokepay_partner_ruby_sdk (0.1.1)
4
+ pokepay_partner_ruby_sdk (0.1.7)
5
5
  inifile (~> 3.0.0)
6
- json (~> 2.1.0)
6
+ json (~> 2.3.0)
7
7
  openssl (~> 2.1.2)
8
8
 
9
9
  GEM
@@ -11,11 +11,11 @@ GEM
11
11
  specs:
12
12
  inifile (3.0.0)
13
13
  ipaddr (1.2.2)
14
- json (2.1.0)
15
- minitest (5.11.3)
14
+ json (2.3.0)
15
+ minitest (5.14.0)
16
16
  openssl (2.1.2)
17
17
  ipaddr
18
- rake (10.5.0)
18
+ rake (13.0.1)
19
19
 
20
20
  PLATFORMS
21
21
  ruby
@@ -24,7 +24,7 @@ DEPENDENCIES
24
24
  bundler (~> 2.0)
25
25
  minitest (~> 5.0)
26
26
  pokepay_partner_ruby_sdk!
27
- rake (~> 10.0)
27
+ rake (~> 13.0)
28
28
 
29
29
  BUNDLED WITH
30
- 2.0.2
30
+ 2.1.4
data/README.md CHANGED
@@ -39,6 +39,20 @@ response = c.send(Pokepay::Request::CreateTransaction.new(
39
39
 
40
40
  ## Run test
41
41
 
42
+ Add `~/.pokepay/test-config.ini`
43
+
44
+ ```
45
+ CLIENT_ID = aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
46
+ CLIENT_SECRET = bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
47
+ API_BASE_URL = https://partnerapi-dev.pokepay.jp
48
+ SSL_KEY_FILE = /path/to/key.pem
49
+ SSL_CERT_FILE = /path/to/cert.pem
50
+ [testdata]
51
+ shop_id = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
52
+ customer_id = yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
53
+ private_money_id = zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz
54
+ ```
55
+
42
56
  ```
43
57
  $ bundle exec ruby test/pokepay_partner_ruby_sdk_test.rb
44
58
  ```
@@ -1,5 +1,4 @@
1
1
  # Partner API SDK for Ruby
2
-
3
2
  ## Installation
4
3
 
5
4
  rubygemsからインストールすることができます。
@@ -18,8 +17,8 @@ require "pokepay_partner_ruby_sdk"
18
17
  基本的な使い方は次のようになります。
19
18
 
20
19
  - ライブラリをロード
21
- - 設定ファイル(後述)から Pokepay::Client オブジェクトを作る
22
- - リクエストオブジェクトを作り、Pokepay::Client オブジェクトのsendメソッドに対して渡す
20
+ - 設定ファイル(後述)から `Pokepay::Client` オブジェクトを作る
21
+ - リクエストオブジェクトを作り、`Pokepay::Client` オブジェクトの `send` メソッドに対して渡す
23
22
  - レスポンスオブジェクトを得る
24
23
 
25
24
  ```ruby
@@ -33,22 +32,22 @@ response = client.send(request)
33
32
 
34
33
  ## Settings
35
34
 
36
- 設定はINIファイルに記述し、 Pokepay::Client のコンストラクタにファイルパスを指定します。
35
+ 設定はINIファイルに記述し、`Pokepay::Client` のコンストラクタにファイルパスを指定します。
37
36
 
38
- SDKプロジェクトルートに config.ini.sample というファイルがありますのでそれを元に必要な情報を記述してください。特に以下の情報は通信の安全性のため必要な項目です。これらはパートナー契約時にお渡ししているものです。
37
+ SDKプロジェクトルートに `config.ini.sample` というファイルがありますのでそれを元に必要な情報を記述してください。特に以下の情報は通信の安全性のため必要な項目です。これらはパートナー契約時にお渡ししているものです。
39
38
 
40
- - CLIENT_ID: パートナーAPI クライアントID
41
- - CLIENT_SECRET: パートナーAPI クライアント秘密鍵
42
- - SSL_KEY_FILE: SSL秘密鍵ファイルパス
43
- - SSL_CERT_FILE: SSL証明書ファイルパス
39
+ - `CLIENT_ID`: パートナーAPI クライアントID
40
+ - `CLIENT_SECRET`: パートナーAPI クライアント秘密鍵
41
+ - `SSL_KEY_FILE`: SSL秘密鍵ファイルパス
42
+ - `SSL_CERT_FILE`: SSL証明書ファイルパス
44
43
 
45
44
  この他に接続先のサーバURL情報が必要です。
46
45
 
47
- - API_BASE_URL: パートナーAPI サーバURL
46
+ - `API_BASE_URL`: パートナーAPI サーバURL
48
47
 
49
48
  また、この設定ファイルには認証に必要な情報が含まれるため、ファイルの管理・取り扱いに十分注意してください。
50
49
 
51
- 設定ファイル記述例(config.ini.sample)
50
+ 設定ファイル記述例(`config.ini.sample`)
52
51
 
53
52
  ```
54
53
  CLIENT_ID = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
@@ -62,9 +61,10 @@ SSL_CERT_FILE = /path/to/cert.pem
62
61
 
63
62
  ### APIリクエスト
64
63
 
65
- Partner APIへの通信はリクエストオブジェクトを作り、Pokepay::Client.send メソッドに渡すことで行われます。リクエストクラスは名前空間 Pokepay::Request 以下に定義されています。
64
+ Partner APIへの通信はリクエストオブジェクトを作り、`Pokepay::Client.send` メソッドに渡すことで行われます。
65
+ リクエストクラスは名前空間 `Pokepay::Request` 以下に定義されています。
66
66
 
67
- たとえば Pokepay::Request::SendEcho 送信した内容をそのまま返す処理です。
67
+ たとえば `Pokepay::Request::SendEcho` は送信した内容をそのまま返す処理です。
68
68
 
69
69
  ```ruby
70
70
  request = Pokepay::Request::SendEcho.new('hello')
@@ -73,7 +73,8 @@ response = client.send(request)
73
73
  # => #<Pokepay::Response::Response 200 OK readbody=>
74
74
  ```
75
75
 
76
- 通信の結果として、レスポンスオブジェクトが得られます。これはステータスコードとレスポンスボディ、各レスポンスクラスのオブジェクトをインスタンス変数に持つオブジェクトです。
76
+ 通信の結果として、レスポンスオブジェクトが得られます。
77
+ これはステータスコードとレスポンスボディ、各レスポンスクラスのオブジェクトをインスタンス変数に持つオブジェクトです。
77
78
 
78
79
  ```ruby
79
80
  response.code
@@ -89,7 +90,42 @@ response.object.message
89
90
  # => "hello"
90
91
  ```
91
92
 
92
- エラーの場合は Net::HTTPBadRequest などのエラーレスポンスオブジェクトが返ります。エラーレスポンスもステータスコードとレスポンスボディを持ちます。
93
+ 利用可能なAPI操作については [API Operations](#api-operations) で紹介します。
94
+
95
+ <a name="paging"></a>
96
+ ### ページング
97
+
98
+ API操作によっては、大量のデータがある場合に備えてページング処理があります。
99
+ その処理では以下のようなプロパティを持つレスポンスオブジェクトを返します。
100
+
101
+ - rows : 列挙するレスポンスクラスのオブジェクトの配列
102
+ - count : 全体の要素数
103
+ - pagination : 以下のインスタンス変数を持つオブジェクト
104
+ - current : 現在のページ位置(1からスタート)
105
+ - per_page : 1ページ当たりの要素数
106
+ - max_page : 最後のページ番号
107
+ - has_prev : 前ページを持つかどうかの真理値
108
+ - has_next : 次ページを持つかどうかの真理値
109
+
110
+ ページングクラスは `Pokepay::Response::Pagination` で定義されています。
111
+
112
+ 以下にコード例を示します。
113
+
114
+ ```ruby
115
+ request = Pokepay::Request::ListTransactions.new({ "page" => 1, "per_page" => 50 })
116
+ response = client.send(request)
117
+
118
+ if response.object.pagination.has_next then
119
+ next_page = response.object.pagination.current + 1
120
+ request = Pokepay::Request::ListTransactions.new({ "page" => next_page, "per_page" => 50 })
121
+ response = client.send(request)
122
+ end
123
+ ```
124
+
125
+ ### エラーハンドリング
126
+
127
+ エラーの場合は `Net::HTTPBadRequest` などのエラーレスポンスオブジェクトが返ります。
128
+ エラーレスポンスもステータスコードとレスポンスボディを持ちます。
93
129
 
94
130
  ```ruby
95
131
  request = Pokepay::Request::SendEcho.new(-1)
@@ -103,111 +139,1044 @@ response.code
103
139
  response.body
104
140
  # => {"type"=>"invalid_parameters", "message"=>"Invalid parameters", "errors"=>{"invalid"=>["message"]}}
105
141
  ```
106
-
142
+ <a name="api-operations"></a>
107
143
  ## API Operations
108
144
 
109
- ### 取引一覧を取得する
145
+ ### Transaction
110
146
 
147
+ #### 取引情報を取得する
148
+ 取引を取得します。
111
149
  ```ruby
112
- response = client.send(Pokepay::Request::ListTransactions.new(
113
- {
114
- # ページング
115
- "page" => 1,
116
- "per_page" => 50,
150
+ response = $client.send(Pokepay::Request::GetTransaction.new(
151
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" // transaction_id: 取引ID
152
+ ))
153
+ ```
117
154
 
118
- # フィルタオプション (すべて任意)
119
- # 期間指定 (ISO8601形式の文字列)
120
- "from" => "2019-01-01T00:00:00+09:00",
121
- "to" => "2019-07-30T18:13:39+09:00",
122
- # 検索オプション
123
- "customer_id" => "xxxxxxxxxxxxxxxxx", # エンドユーザーID
124
- "customer_name" => "福沢", # エンドユーザー名
125
- "transaction_id" => "24bba30c......", # 取引ID
126
- "shop_id" => "456a820b......", # 店舗ID
127
- "terminal_id" => "d8023185......", # 端末ID
128
- "organization" => "pocketchange", # 組織コード
129
- "private_money" => "9ff644fc......", # マネーID
130
- "is_modified" => "true", # キャンセルされた取引のみ検索するか
131
- # 取引種別 (複数指定可)、チャージ=topup、支払い=payment
132
- "types" => ["topup", "payment"],
133
- }))
155
+ ---
156
+ `transaction_id`
157
+ 取引IDです。
158
+
159
+ フィルターとして使われ、指定した取引IDの取引を取得します。
160
+
161
+ ---
162
+ 成功したときは[Transaction](#transaction)オブジェクトを返します
163
+
164
+ #### チャージする
165
+ チャージ取引を作成します。
166
+ ```ruby
167
+ response = $client.send(Pokepay::Request::CreateTopupTransaction.new(
168
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // shop_id: 店舗ID
169
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // customer_id: エンドユーザーのID
170
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // private_money_id: マネーID
171
+ bear_point_shop_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // ポイント支払時の負担店舗ID
172
+ money_amount: 8987, // マネー額
173
+ point_amount: 750, // ポイント額
174
+ description: "初夏のチャージキャンペーン" // 取引履歴に表示する説明文
175
+ ))
134
176
  ```
135
177
 
136
- 成功したときは Pokepay::Response::Transaction を rows に含むページングオブジェクトを返します。
137
- 取引一覧のような大量のレスポンスが返るエンドポイントでは、一度に取得する量を制限するためにページングされています。
178
+ ---
179
+ `shop_id`
180
+ 店舗IDです。
138
181
 
139
- #### 取引情報
182
+ 送金元の店舗を指定します。
140
183
 
141
- 取引クラスは Pokepay::Response::Transaction で定義されています。
184
+ ---
185
+ `customer_id`
186
+ エンドユーザーIDです。
142
187
 
143
- 取引オブジェクトのプロパティは以下のようになっています。
188
+ 送金先のエンドユーザーを指定します。
144
189
 
145
- - id (String): 取引ID
146
- - type (String): 取引種別 (チャージ=topup, 支払い=payment)
147
- - is_modified (真理値): 返金された取引かどうか
148
- - sender (Response\User): 送金者情報
149
- - receiver (Response\User): 受取者情報
150
- - sender_account (Response\Account): 送金口座情報
151
- - receiver_account (Response\Account): 受取口座情報
152
- - amount (Numeric): 決済総額 (マネー額 + ポイント額)
153
- - money_amount (Numeric): 決済マネー額
154
- - point_amount (Numeric): 決済ポイント額
155
- - done_at (Time): 取引日時
156
- - description (String): 取引説明文
190
+ ---
191
+ `private_money_id`
192
+ マネーIDです。
157
193
 
158
- `sender` と `receiver` には `Pokepay::Response::User` のオブジェクトです。 以下にプロパティを示します。
194
+ マネーを指定します。
159
195
 
160
- - id (String): ユーザー (または店舗) ID
161
- - name (String): ユーザー (または店舗) 名
162
- - is_merchant (真理値): 店舗ユーザーかどうか
196
+ ---
197
+ `bear_point_shop_id`
198
+ ポイント支払時の負担店舗IDです。
163
199
 
164
- `senderAccount` と `receiverAccount` は `Pokepay::Response::Account` のオブジェクトです。以下にプロパティを示します。
200
+ ポイント支払い時に実際お金を負担する店舗を指定します。
165
201
 
166
- - id (String): 口座ID
167
- - name (String): 口座名
168
- - is_suspended (真理値): 口座が凍結されているかどうか
169
- - private_money (Response\PrivateMoney): 設定マネー情報
202
+ ---
203
+ `money_amount`
204
+ マネー額です。
170
205
 
171
- `privateMoney` は `Pokepay::Response::PrivateMoney` のオブジェクトです。以下にプロパティを示します。
206
+ 送金するマネー額を指定します。
172
207
 
173
- - id (String): マネーID
174
- - name (String): マネー名
175
- - unit (String): マネー単位 (例: 円)
176
- - is_exclusive (真理値): 会員制のマネーかどうか
177
- - description (String): マネー説明文
178
- - max_balance (Numeric): 口座の上限金額
179
- - transfer_limit (Numeric): マネーの取引上限額
180
- - type (String): マネー種別 (自家型=own, 第三者型=third-party)
181
- - expiration_type (String): 有効期限種別 (チャージ日時起算=static, 最終利用日時起算=last-update)
208
+ ---
209
+ `point_amount`
210
+ ポイント額です。
182
211
 
183
- #### ページング
212
+ 送金するポイント額を指定します。
184
213
 
185
- ページングクラスは Pokepay::Response::Pagination で定義されています。
214
+ ---
215
+ `description`
216
+ 取引説明文です。
186
217
 
187
- ページングオブジェクトのプロパティは以下のようになっています。
218
+ 任意入力で、取引履歴に表示される説明文です。
188
219
 
189
- - rows : 列挙するレスポンスクラスのオブジェクトの配列
190
- - count : 全体の要素数
191
- - pagination : 以下のインスタンス変数を持つオブジェクト
192
- - current : 現在のページ位置(1からスタート)
193
- - per_page : 1ページ当たりの要素数
194
- - max_page : 最後のページ番号
195
- - has_prev : 前ページを持つかどうかの真理値
196
- - has_next : 次ページを持つかどうかの真理値
220
+ ---
221
+ 成功したときは[Transaction](#transaction)オブジェクトを返します
222
+
223
+ #### 支払いする
224
+ 支払取引を作成します。
225
+ 支払い時には、エンドユーザーの残高のうち、ポイント残高から優先的に消費されます。
226
+
227
+ ```ruby
228
+ response = $client.send(Pokepay::Request::CreatePaymentTransaction.new(
229
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // shop_id: 店舗ID
230
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // customer_id: エンドユーザーID
231
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // private_money_id: マネーID
232
+ 8123, // amount: 支払い額
233
+ description: "たい焼き(小倉)" // 取引履歴に表示する説明文
234
+ ))
235
+ ```
236
+
237
+ ---
238
+ `shop_id`
239
+ 店舗IDです。
240
+
241
+ 送金先の店舗を指定します。
242
+
243
+ ---
244
+ `customer_id`
245
+ エンドユーザーIDです。
246
+
247
+ 送金元のエンドユーザーを指定します。
248
+
249
+ ---
250
+ `private_money_id`
251
+ マネーIDです。
252
+
253
+ マネーを指定します。
254
+
255
+ ---
256
+ `amount`
257
+ マネー額です。
258
+
259
+ 送金するマネー額を指定します。
260
+
261
+ ---
262
+ `description`
263
+ 取引説明文です。
264
+
265
+ 任意入力で、取引履歴に表示される説明文です。
266
+
267
+ ---
268
+ 成功したときは[Transaction](#transaction)オブジェクトを返します
269
+
270
+ #### 個人間送金
271
+ エンドユーザー間での送金取引(個人間送金)を作成します。
272
+ 個人間送金で送れるのはマネーのみで、ポイントを送ることはできません。送金元のマネー残高のうち、有効期限が最も遠いものから順に送金されます。
273
+
274
+ ```ruby
275
+ response = $client.send(Pokepay::Request::CreateTransferTransaction.new(
276
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // sender_id: 送金元ユーザーID
277
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // receiver_id: 受取ユーザーID
278
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // private_money_id: マネーID
279
+ 7070, // amount: 送金額
280
+ description: "たい焼き(小倉)" // 取引履歴に表示する説明文
281
+ ))
282
+ ```
283
+
284
+ ---
285
+ `sender_id`
286
+ エンドユーザーIDです。
287
+
288
+ 送金元のエンドユーザー(送り主)を指定します。
289
+
290
+ ---
291
+ `receiver_id`
292
+ エンドユーザーIDです。
293
+
294
+ 送金先のエンドユーザー(受け取り人)を指定します。
295
+
296
+ ---
297
+ `private_money_id`
298
+ マネーIDです。
299
+
300
+ マネーを指定します。
301
+
302
+ ---
303
+ `amount`
304
+ マネー額です。
305
+
306
+ 送金するマネー額を指定します。
307
+
308
+ ---
309
+ `description`
310
+ 取引説明文です。
311
+
312
+ 任意入力で、取引履歴に表示される説明文です。
313
+
314
+ ---
315
+ 成功したときは[Transaction](#transaction)オブジェクトを返します
316
+
317
+ #### 取引履歴を取得する
318
+ 取引一覧を返します。
319
+ ```ruby
320
+ response = $client.send(Pokepay::Request::ListTransactions.new(
321
+ from: "2016-11-19T02:36:58.000000+09:00", // 開始日時
322
+ to: "2021-03-05T00:00:07.000000+09:00", // 終了日時
323
+ page: 1, // ページ番号
324
+ per_page: 50, // 1ページ分の取引数
325
+ shop_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // 店舗ID
326
+ customer_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // エンドユーザーID
327
+ customer_name: "太郎", // エンドユーザー名
328
+ terminal_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // 端末ID
329
+ transaction_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // 取引ID
330
+ organization_code: "pocketchange", // 組織コード
331
+ private_money_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // マネーID
332
+ is_modified: true, // キャンセルフラグ
333
+ types: ["topup", "payment"] // 取引種別 (複数指定可)、チャージ=topup、支払い=payment
334
+ ))
335
+ ```
336
+
337
+ ---
338
+ `from`
339
+ 抽出期間の開始日時です。
340
+
341
+ フィルターとして使われ、開始日時以降に発生した取引のみ一覧に表示されます。
342
+
343
+ ---
344
+ `to`
345
+ 抽出期間の終了日時です。
346
+
347
+ フィルターとして使われ、終了日時以前に発生した取引のみ一覧に表示されます。
348
+
349
+ ---
350
+ `page`
351
+ 取得したいページ番号です。
352
+
353
+ ---
354
+ `per_page`
355
+ 1ページ分の取引数です。
356
+
357
+ ---
358
+ `shop_id`
359
+ 店舗IDです。
360
+
361
+ フィルターとして使われ、指定された店舗での取引のみ一覧に表示されます。
362
+
363
+ ---
364
+ `customer_id`
365
+ エンドユーザーIDです。
366
+
367
+ フィルターとして使われ、指定されたエンドユーザーでの取引のみ一覧に表示されます。
368
+
369
+ ---
370
+ `customer_name`
371
+ エンドユーザー名です。
372
+
373
+ フィルターとして使われ、入力された名前に部分一致するエンドユーザーでの取引のみ一覧に表示されます。
374
+
375
+ ---
376
+ `terminal_id`
377
+ 端末IDです。
378
+
379
+ フィルターとして使われ、指定された端末での取引のみ一覧に表示されます。
380
+
381
+ ---
382
+ `transaction_id`
383
+ 取引IDです。
384
+
385
+ フィルターとして使われ、指定された取引のみ一覧に表示されます。
386
+
387
+ ---
388
+ `organization_code`
389
+ 組織コードです。
390
+
391
+ フィルターとして使われ、指定された組織での取引のみ一覧に表示されます。
392
+
393
+ ---
394
+ `private_money_id`
395
+ マネーIDです。
396
+
397
+ フィルターとして使われ、指定したマネーでの取引のみ一覧に表示されます。
398
+
399
+ ---
400
+ `is_modified`
401
+ キャンセルフラグです。
402
+
403
+ これにtrueを指定するとキャンセルされた取引のみ一覧に表示されます。
404
+ デフォルト値はfalseで、キャンセルの有無にかかわらず一覧に表示されます。
405
+
406
+ ---
407
+ `types`
408
+ 取引の種類でフィルターします。
409
+
410
+ 以下の種類を指定できます。
411
+
412
+ 1. topup
413
+ 店舗からエンドユーザーへの送金取引(チャージ)
414
+
415
+ 2. payment
416
+ エンドユーザーから店舗への送金取引(支払い)
417
+
418
+ 3. exchange-outflow
419
+   他マネーへの流出
420
+
421
+ 4. exchange-inflow
422
+ 他マネーからの流入
423
+
424
+ ---
425
+ 成功したときは[PaginatedTransaction](#paginated-transaction)オブジェクトを返します
426
+
427
+ #### 返金する
428
+ ```ruby
429
+ response = $client.send(Pokepay::Request::RefundTransaction.new(
430
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // transaction_id: 取引ID
431
+ description: "返品対応のため" // 取引履歴に表示する返金事由
432
+ ))
433
+ ```
434
+ 成功したときは[Transfer](#transfer)オブジェクトを返します
435
+
436
+ ### チャージQRコード
437
+
438
+ 店舗ユーザが発行し、エンドユーザがポケペイアプリから読み取ることでチャージ取引が発生するQRコードです。
439
+
440
+ チャージQRコードを解析すると次のようなURLになります(URLは環境によって異なります)。
441
+
442
+ `https://www-sandbox.pokepay.jp/checks/xxxxxxxx-xxxx-xxxxxxxxx-xxxxxxxxxxxx`
443
+
444
+ QRコードを読み取る方法以外にも、このURLリンクを直接スマートフォン(iOS/Android)上で開くことによりアプリが起動して取引が行われます。(注意: 上記URLはsandbox環境であるため、アプリもsandbox環境のものである必要があります) 上記URL中の `xxxxxxxx-xxxx-xxxxxxxxx-xxxxxxxxxxxx` の部分がチャージQRコードのIDです。
445
+
446
+ #### チャージQRコードの発行
447
+ ```ruby
448
+ response = $client.send(Pokepay::Request::CreateCheck.new(
449
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // account_id: 送金元の店舗アカウントID
450
+ money_amount: 8455, // 付与マネー額
451
+ point_amount: 6119, // 付与ポイント額
452
+ description: "test check", // 説明文(アプリ上で取引の説明文として表示される)
453
+ is_onetime: true, // ワンタイムかどうか。真の場合1度読み込まれた時点でそのチャージQRは失効する(デフォルト値は真)
454
+ usage_limit: 4746, // ワンタイムでない場合、複数ユーザから読み取られ得る。その場合の最大読み取り回数
455
+ expires_at: "2018-04-09T08:22:29.000000+09:00", // チャージQR自体の失効日時
456
+ point_expires_at: "2016-10-24T09:19:20.000000+09:00", // チャージQRによって付与されるポイントの失効日時
457
+ point_expires_in_days: 60, // チャージQRによって付与されるポイントの有効期限(相対指定、単位は日)
458
+ bear_point_account: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" // ポイント額を負担する店舗アカウントのID
459
+ ))
460
+ ```
461
+ `money_amount`と`point_amount`の少なくとも一方は指定する必要があります。
462
+
463
+
464
+ ---
465
+ `is_onetime`
466
+ チャージQRコードが一度の読み取りで失効するときに`true`にします。デフォルト値は`true`です。
467
+ `false`の場合、そのチャージQRコードは1ユーザについては1回きりですが、複数ユーザによって読み取り可能なQRコードになります。
468
+
469
+
470
+ ---
471
+ `usage_limit`
472
+ 複数ユーザによって読み取り可能なチャージQRコードの読み取り回数に制限をつけるために指定します。
473
+ 省略すると無制限に読み取り可能なチャージQRコードになります。
474
+ チャージQRコードは管理画面からいつでも無効化(有効化)することができます。
475
+
476
+
477
+ ---
478
+ 成功したときは[Check](#check)オブジェクトを返します
479
+
480
+ #### チャージQRコードを読み取ることでチャージする
481
+ 通常チャージQRコードはエンドユーザのアプリによって読み取られ、アプリとポケペイサーバとの直接通信によって取引が作られます。 もしエンドユーザとの通信をパートナーのサーバのみに限定したい場合、パートナーのサーバがチャージQRの情報をエンドユーザから代理受けして、サーバ間連携APIによって実際のチャージ取引をリクエストすることになります。
482
+
483
+ エンドユーザから受け取ったチャージ用QRコードのIDをエンドユーザIDと共に渡すことでチャージ取引が作られます。
484
+
485
+ ```ruby
486
+ response = $client.send(Pokepay::Request::CreateTopupTransactionWithCheck.new(
487
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // check_id: チャージ用QRコードのID
488
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" // customer_id: エンドユーザーのID
489
+ ))
490
+ ```
491
+
492
+ ---
493
+ `check_id`
494
+ チャージ用QRコードのIDです。
495
+
496
+ QRコード生成時に送金元店舗のウォレット情報や、送金額などが登録されています。
497
+
498
+ ---
499
+ `customer_id`
500
+ エンドユーザーIDです。
501
+
502
+ 送金先のエンドユーザーを指定します。
503
+
504
+ ---
505
+ 成功したときは[Transaction](#transaction)オブジェクトを返します
506
+
507
+ ### 支払いQRコード
508
+
509
+ #### 支払いQRコード一覧を表示する
510
+ 支払いQRコード一覧を表示します。
511
+ ```ruby
512
+ response = $client.send(Pokepay::Request::ListBills.new(
513
+ page: 9486, // ページ番号
514
+ per_page: 5839, // 1ページの表示数
515
+ bill_id: "1Ez", // 支払いQRコードのID
516
+ private_money_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // マネーID
517
+ organization_code: "1rDRdnXy6PY122A---0nzUq-g", // 組織コード
518
+ description: "test bill", // 取引説明文
519
+ created_from: "2017-11-03T07:17:36.000000+09:00", // 作成日時(起点)
520
+ created_to: "2016-02-19T04:37:01.000000+09:00", // 作成日時(終点)
521
+ shop_name: "bill test shop1", // 店舗名
522
+ shop_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // 店舗ID
523
+ lower_limit_amount: 8463, // 金額の範囲によるフィルタ(下限)
524
+ upper_limit_amount: 3110, // 金額の範囲によるフィルタ(上限)
525
+ is_disabled: true // 支払いQRコードが無効化されているかどうか
526
+ ))
527
+ ```
528
+
529
+ ---
530
+ `page`
531
+ 取得したいページ番号です。
532
+
533
+ ---
534
+ `per_page`
535
+ 1ページに表示する支払いQRコードの数です。
536
+
537
+ ---
538
+ `bill_id`
539
+ 支払いQRコードのIDを指定して検索します。IDは部分一致で検索できます。
540
+
541
+ ---
542
+ `private_money_id`
543
+ 支払いQRコードの送金元ウォレットのマネーIDでフィルターします。
544
+
545
+ ---
546
+ `organization_code`
547
+ 支払いQRコードの送金元店舗が所属する組織の組織コードでフィルターします。
548
+
549
+ ---
550
+ `description`
551
+ 支払いQRコードを読み取ることで作られた取引の説明文としてアプリなどに表示されます。
552
+
553
+ ---
554
+ `created_from`
555
+ 支払いQRコードの作成日時でフィルターします。
556
+
557
+ これ以降に作成された支払いQRコードのみ一覧に表示されます。
558
+
559
+ ---
560
+ `created_to`
561
+ 支払いQRコードの作成日時でフィルターします。
562
+
563
+ これ以前に作成された支払いQRコードのみ一覧に表示されます。
564
+
565
+ ---
566
+ `shop_name`
567
+ 支払いQRコードを作成した店舗名でフィルターします。
568
+
569
+ ---
570
+ `shop_id`
571
+ 支払いQRコードを作成した店舗IDでフィルターします。
572
+
573
+ ---
574
+ `lower_limit_amount`
575
+ 支払いQRコードの金額の下限を指定してフィルターします。
576
+
577
+ ---
578
+ `upper_limit_amount`
579
+ 支払いQRコードの金額の上限を指定してフィルターします。
580
+
581
+ ---
582
+ `is_disabled`
583
+ 支払いQRコードが無効化されているかどうかを表します。デフォルト値は偽(有効)です。
197
584
 
198
- ### チャージする
585
+ ---
586
+ 成功したときは[PaginatedBills](#paginated-bills)オブジェクトを返します
199
587
 
588
+ #### 支払いQRコードの発行
589
+ 支払いQRコードの内容を更新します。支払い先の店舗ユーザーは指定したマネーのウォレットを持っている必要があります。
200
590
  ```ruby
201
- shop_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # 店舗ID
202
- customer_id = "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" # エンドユーザーのID
203
- private_money_id = "zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz" # 送るマネーのID
204
- money_amount = 1000 # チャージマネー額
205
- point_amount = 0 # チャージするポイント額
206
- description = "初夏のチャージキャンペーン" # 取引履歴に表示する説明文
591
+ response = $client.send(Pokepay::Request::CreateBill.new(
592
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // private_money_id: 支払いマネーのマネーID
593
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // shop_id: 支払い先(受け取り人)の店舗ID
594
+ amount: 9236, // 支払い額
595
+ description: "test bill" // 説明文(アプリ上で取引の説明文として表示される)
596
+ ))
597
+ ```
598
+
599
+ ---
600
+ `amount`
601
+ 支払いQRコードを支払い額を指定します。省略するかnullを渡すと任意金額の支払いQRコードとなり、エンドユーザーがアプリで読み取った際に金額を入力します。
602
+
603
+ ---
604
+ 成功したときは[Bill](#bill)オブジェクトを返します
605
+
606
+ #### 支払いQRコードの更新
607
+ 支払いQRコードの内容を更新します。パラメータは全て省略可能で、指定したもののみ更新されます。
608
+ ```ruby
609
+ response = $client.send(Pokepay::Request::UpdateBill.new(
610
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // bill_id: 支払いQRコードのID
611
+ amount: 1515, // 支払い額
612
+ description: "test bill", // 説明文
613
+ is_disabled: true // 無効化されているかどうか
614
+ ))
615
+ ```
616
+
617
+ ---
618
+ `bill_id`
619
+ 更新対象の支払いQRコードのIDです。
620
+
621
+ ---
622
+ `amount`
623
+ 支払いQRコードを支払い額を指定します。nullを渡すと任意金額の支払いQRコードとなり、エンドユーザーがアプリで読み取った際に金額を入力します。
624
+
625
+ ---
626
+ `description`
627
+ 支払いQRコードの詳細説明文です。アプリ上で取引の説明文として表示されます。
628
+
629
+ ---
630
+ `is_disabled`
631
+ 支払いQRコードが無効化されているかどうかを指定します。真にすると無効化され、偽にすると有効化します。
632
+
633
+ ---
634
+ 成功したときは[Bill](#bill)オブジェクトを返します
635
+
636
+ ### Customer
637
+
638
+ #### 新規エンドユーザーウォレットを追加する
639
+ 指定したマネーのウォレットを作成し、同時にそのウォレットを保有するユーザも作成します。
640
+ ```ruby
641
+ response = $client.send(Pokepay::Request::CreateCustomerAccount.new(
642
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // private_money_id: マネーID
643
+ user_name: "ポケペイ太郎", // ユーザー名
644
+ account_name: "ポケペイ太郎のアカウント" // アカウント名
645
+ ))
646
+ ```
647
+
648
+ ---
649
+ `private_money_id`
650
+ マネーIDです。
651
+
652
+ これによって作成するウォレットのマネーを指定します。
653
+
654
+ ---
655
+ `user_name`
656
+ ウォレットと共に作成するユーザ名です。省略した場合は空文字となります。
657
+
658
+ ---
659
+ `account_name`
660
+ 作成するウォレット名です。省略した場合は空文字となります。
661
+
662
+ ---
663
+ 成功したときは[AccountWithUser](#account-with-user)オブジェクトを返します
664
+
665
+ #### ウォレット情報を表示する
666
+ ウォレットを取得します。
667
+ ```ruby
668
+ response = $client.send(Pokepay::Request::GetAccount.new(
669
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" // account_id: ウォレットID
670
+ ))
671
+ ```
672
+
673
+ ---
674
+ `account_id`
675
+ ウォレットIDです。
676
+
677
+ フィルターとして使われ、指定したウォレットIDのウォレットを取得します。
678
+
679
+ ---
680
+ 成功したときは[AccountDetail](#account-detail)オブジェクトを返します
681
+
682
+ #### エンドユーザーの残高内訳を表示する
683
+ エンドユーザーのウォレット毎の残高を有効期限別のリストとして取得します。
684
+ ```ruby
685
+ response = $client.send(Pokepay::Request::ListAccountBalances.new(
686
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // account_id: ウォレットID
687
+ page: 2589, // ページ番号
688
+ per_page: 6451, // 1ページ分の取引数
689
+ expires_at_from: "2024-03-14T23:56:23.000000+09:00", // 有効期限の期間によるフィルター(開始時点)
690
+ expires_at_to: "2019-10-04T17:19:48.000000+09:00", // 有効期限の期間によるフィルター(終了時点)
691
+ direction: "asc" // 有効期限によるソート順序
692
+ ))
693
+ ```
694
+
695
+ ---
696
+ `account_id`
697
+ ウォレットIDです。
698
+
699
+ フィルターとして使われ、指定したウォレットIDのウォレット残高を取得します。
700
+
701
+ ---
702
+ `page`
703
+ 取得したいページ番号です。デフォルト値は1です。
704
+
705
+ ---
706
+ `per_page`
707
+ 1ページ分のウォレット残高数です。デフォルト値は30です。
708
+
709
+ ---
710
+ `expires_at_from`
711
+ 有効期限の期間によるフィルターの開始時点のタイムスタンプです。デフォルトでは未指定です。
712
+
713
+ ---
714
+ `expires_at_to`
715
+ 有効期限の期間によるフィルターの終了時点のタイムスタンプです。デフォルトでは未指定です。
716
+
717
+ ---
718
+ `direction`
719
+ 有効期限によるソートの順序を指定します。デフォルト値はasc (昇順)です。
207
720
 
208
- response = $client.send(Pokepay::Request::CreateTransaction.new(
209
- shop_id, customer_id, private_money_id,
210
- money_amount, point_amount, description))
721
+ ---
722
+ 成功したときは[PaginatedAccountBalance](#paginated-account-balance)オブジェクトを返します
723
+
724
+ #### エンドユーザーの失効済みの残高内訳を表示する
725
+ エンドユーザーのウォレット毎の失効済みの残高を有効期限別のリストとして取得します。
726
+ ```ruby
727
+ response = $client.send(Pokepay::Request::ListAccountExpiredBalances.new(
728
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // account_id: ウォレットID
729
+ page: 6958, // ページ番号
730
+ per_page: 2994, // 1ページ分の取引数
731
+ expires_at_from: "2016-02-15T00:43:30.000000+09:00", // 有効期限の期間によるフィルター(開始時点)
732
+ expires_at_to: "2016-06-15T15:33:00.000000+09:00", // 有効期限の期間によるフィルター(終了時点)
733
+ direction: "asc" // 有効期限によるソート順序
734
+ ))
735
+ ```
736
+
737
+ ---
738
+ `account_id`
739
+ ウォレットIDです。
740
+
741
+ フィルターとして使われ、指定したウォレットIDのウォレット残高を取得します。
742
+
743
+ ---
744
+ `page`
745
+ 取得したいページ番号です。デフォルト値は1です。
746
+
747
+ ---
748
+ `per_page`
749
+ 1ページ分のウォレット残高数です。デフォルト値は30です。
750
+
751
+ ---
752
+ `expires_at_from`
753
+ 有効期限の期間によるフィルターの開始時点のタイムスタンプです。デフォルトでは未指定です。
754
+
755
+ ---
756
+ `expires_at_to`
757
+ 有効期限の期間によるフィルターの終了時点のタイムスタンプです。デフォルトでは未指定です。
758
+
759
+ ---
760
+ `direction`
761
+ 有効期限によるソートの順序を指定します。デフォルト値はdesc (降順)です。
762
+
763
+ ---
764
+ 成功したときは[PaginatedAccountBalance](#paginated-account-balance)オブジェクトを返します
765
+
766
+ #### 取引履歴を取得する
767
+ 取引一覧を返します。
768
+ ```ruby
769
+ response = $client.send(Pokepay::Request::ListCustomerTransactions.new(
770
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // private_money_id: マネーID
771
+ sender_customer_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // 送金エンドユーザーID
772
+ receiver_customer_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // 受取エンドユーザーID
773
+ type: "FjJy7", // 取引種別、チャージ=topup、支払い=payment、個人間送金=transfer
774
+ is_modified: true, // キャンセル済みかどうか
775
+ from: "2019-01-09T15:47:03.000000+09:00", // 開始日時
776
+ to: "2025-02-14T22:55:32.000000+09:00", // 終了日時
777
+ page: 1, // ページ番号
778
+ per_page: 50 // 1ページ分の取引数
779
+ ))
780
+ ```
781
+
782
+ ---
783
+ `private_money_id`
784
+ マネーIDです。
785
+ フィルターとして使われ、指定したマネーでの取引のみ一覧に表示されます。
786
+
787
+ ---
788
+ `sender_customer_id`
789
+ 送金ユーザーIDです。
790
+
791
+ フィルターとして使われ、指定された送金ユーザーでの取引のみ一覧に表示されます。
792
+
793
+ ---
794
+ `receiver_customer_id`
795
+ 受取ユーザーIDです。
796
+
797
+ フィルターとして使われ、指定された受取ユーザーでの取引のみ一覧に表示されます。
798
+
799
+ ---
800
+ `type`
801
+ 取引の種類でフィルターします。
802
+
803
+ 以下の種類を指定できます。
804
+
805
+ 1. topup
806
+ 店舗からエンドユーザーへの送金取引(チャージ)
807
+ 2. payment
808
+ エンドユーザーから店舗への送金取引(支払い)
809
+ 3. exchange
810
+ 他マネーへの流出(outflow)/他マネーからの流入(inflow)
811
+ 4. transfer
812
+ 個人間送金
813
+
814
+ ---
815
+ `is_modified`
816
+ キャンセル済みかどうかを判定するフラグです。
817
+
818
+ これにtrueを指定するとキャンセルされた取引のみ一覧に表示されます。
819
+ falseを指定するとキャンセルされていない取引のみ一覧に表示されます
820
+ 何も指定しなければキャンセルの有無にかかわらず一覧に表示されます。
821
+
822
+ ---
823
+ `from`
824
+ 抽出期間の開始日時です。
825
+
826
+ フィルターとして使われ、開始日時以降に発生した取引のみ一覧に表示されます。
827
+
828
+ ---
829
+ `to`
830
+ 抽出期間の終了日時です。
831
+
832
+ フィルターとして使われ、終了日時以前に発生した取引のみ一覧に表示されます。
833
+
834
+ ---
835
+ `page`
836
+ 取得したいページ番号です。
837
+
838
+ ---
839
+ `per_page`
840
+ 1ページ分の取引数です。
841
+
842
+ ---
843
+ 成功したときは[PaginatedTransaction](#paginated-transaction)オブジェクトを返します
844
+
845
+ ### Organization
846
+
847
+ #### 新規加盟店組織を追加する
848
+ ```ruby
849
+ response = $client.send(Pokepay::Request::CreateOrganization.new(
850
+ "ox_supermarket", // code: 新規組織コード
851
+ "oxスーパー", // name: 新規組織名
852
+ ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], // private_money_ids: 加盟店組織で有効にするマネーIDの配列
853
+ "Kkoz4u4vqN@tkYj.com", // issuer_admin_user_email: 発行体担当者メールアドレス
854
+ "PXUyJ1V0r5@CHRN.com", // member_admin_user_email: 新規組織担当者メールアドレス
855
+ bank_name: "XYZ銀行", // 銀行名
856
+ bank_code: "99X", // 銀行金融機関コード
857
+ bank_branch_name: "ABC支店", // 銀行支店名
858
+ bank_branch_code: "99X", // 銀行支店コード
859
+ bank_account_type: "saving", // 銀行口座種別 (普通=saving, 当座=current, その他=other)
860
+ bank_account: 9999999, // 銀行口座番号
861
+ bank_account_holder_name: "フクザワユキチ", // 口座名義人名
862
+ contact_name: "佐藤清" // 担当者名
863
+ ))
211
864
  ```
865
+ 成功したときは[Organization](#organization)オブジェクトを返します
866
+
867
+ ### Shop
868
+
869
+ #### 新規店舗を追加する
870
+ ```ruby
871
+ response = $client.send(Pokepay::Request::CreateShop.new(
872
+ "oxスーパー三田店", // shop_name: 店舗名
873
+ shop_postal_code: "422-5364", // 店舗の郵便番号
874
+ shop_address: "東京都港区芝...", // 店舗の住所
875
+ shop_tel: "083-33-947", // 店舗の電話番号
876
+ shop_email: "pSCBGnb27K@I1Ko.com", // 店舗のメールアドレス
877
+ shop_external_id: "9Ro9P2UOPHKc", // 店舗の外部ID
878
+ organization_code: "ox-supermarket" // 組織コード
879
+ ))
880
+ ```
881
+ 成功したときは[User](#user)オブジェクトを返します
882
+
883
+ #### 店舗一覧を取得する
884
+ ```ruby
885
+ response = $client.send(Pokepay::Request::ListShops.new(
886
+ organization_code: "pocketchange", // 組織コード
887
+ private_money_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // マネーID
888
+ page: 1, // ページ番号
889
+ per_page: 50 // 1ページ分の取引数
890
+ ))
891
+ ```
892
+
893
+ ---
894
+ `organization_code`
895
+ このパラメータを渡すとその組織の店舗のみが返され、省略すると加盟店も含む店舗が返されます。
896
+
897
+
898
+ ---
899
+ `private_money_id`
900
+ このパラメータを渡すとそのマネーのウォレットを持つ店舗のみが返されます。
901
+
902
+
903
+ ---
904
+ `page`
905
+ 取得したいページ番号です。
906
+
907
+ ---
908
+ `per_page`
909
+ 1ページ分の取引数です。
910
+
911
+ ---
912
+ 成功したときは[PaginatedShops](#paginated-shops)オブジェクトを返します
913
+
914
+ ### Account
915
+
916
+ #### エンドユーザー、店舗ユーザーのウォレット一覧を表示する
917
+ ユーザーIDを指定してそのユーザーのウォレット一覧を取得します。
918
+ ```ruby
919
+ response = $client.send(Pokepay::Request::ListUserAccounts.new(
920
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" // user_id: ユーザーID
921
+ ))
922
+ ```
923
+
924
+ ---
925
+ `user_id`
926
+ ユーザーIDです。
927
+
928
+ 指定したユーザーIDのウォレット一覧を取得します。パートナーキーと紐づく組織が発行しているマネーのウォレットのみが表示されます。
929
+
930
+ ---
931
+ 成功したときは[PaginatedAccounts](#paginated-accounts)オブジェクトを返します
932
+
933
+ ### Private Money
934
+
935
+ #### 決済加盟店の取引サマリを取得する
936
+ ```ruby
937
+ response = $client.send(Pokepay::Request::GetPrivateMoneyOrganizationSummaries.new(
938
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // private_money_id: マネーID
939
+ from: "2020-03-02T19:54:29.000000+09:00", // 開始日時(toと同時に指定する必要有)
940
+ to: "2024-10-09T07:46:14.000000+09:00", // 終了日時(fromと同時に指定する必要有)
941
+ page: 1, // ページ番号
942
+ per_page: 50 // 1ページ分の取引数
943
+ ))
944
+ ```
945
+ `from`と`to`は同時に指定する必要があります。
946
+
947
+ 成功したときは[PaginatedPrivateMoneyOrganizationSummaries](#paginated-private-money-organization-summaries)オブジェクトを返します
948
+
949
+ ## Responses
950
+
951
+
952
+ <a name="account-with-user"></a>
953
+ ## AccountWithUser
954
+ * `id (string)`:
955
+ * `name (string)`:
956
+ * `is_suspended (boolean)`:
957
+ * `private_money (PrivateMoney)`:
958
+ * `user (User)`:
959
+
960
+ `private_money`は [PrivateMoney](#private-money) オブジェクトを返します。
961
+
962
+ `user`は [User](#user) オブジェクトを返します。
963
+
964
+ <a name="account-detail"></a>
965
+ ## AccountDetail
966
+ * `id (string)`:
967
+ * `name (string)`:
968
+ * `is_suspended (boolean)`:
969
+ * `balance (double)`:
970
+ * `money_balance (double)`:
971
+ * `point_balance (double)`:
972
+ * `private_money (PrivateMoney)`:
973
+
974
+ `private_money`は [PrivateMoney](#private-money) オブジェクトを返します。
975
+
976
+ <a name="bill"></a>
977
+ ## Bill
978
+ * `id (string)`: 支払いQRコードのID
979
+ * `amount (double)`: 支払い額
980
+ * `max_amount (double)`: 支払い額を範囲指定した場合の上限
981
+ * `min_amount (double)`: 支払い額を範囲指定した場合の下限
982
+ * `description (string)`: 支払いQRコードの説明文(アプリ上で取引の説明文として表示される)
983
+ * `account (AccountWithUser)`: 支払いQRコード発行ウォレット
984
+ * `is_disabled (boolean)`: 無効化されているかどうか
985
+ * `token (string)`:
986
+
987
+ `account`は [AccountWithUser](#account-with-user) オブジェクトを返します。
988
+
989
+ <a name="check"></a>
990
+ ## Check
991
+ * `id (string)`: チャージQRコードのID
992
+ * `amount (double)`: チャージマネー額 (deprecated)
993
+ * `money_amount (double)`: チャージマネー額
994
+ * `point_amount (double)`: チャージポイント額
995
+ * `description (string)`: チャージQRコードの説明文(アプリ上で取引の説明文として表示される)
996
+ * `user (User)`: 送金元ユーザ情報
997
+ * `is_onetime (boolean)`: 使用回数が一回限りかどうか
998
+ * `is_disabled (boolean)`: 無効化されているかどうか
999
+ * `expires_at (string)`: チャージQRコード自体の失効日時
1000
+ * `private_money (PrivateMoney)`: 対象マネー情報
1001
+ * `usage_limit (integer)`: 一回限りでない場合の最大読み取り回数
1002
+ * `usage_count (double)`: 一回限りでない場合の現在までに読み取られた回数
1003
+ * `token (string)`: チャージQRコードを解析したときに出てくるURL
1004
+
1005
+ `user`は [User](#user) オブジェクトを返します。
1006
+
1007
+ `private_money`は [PrivateMoney](#private-money) オブジェクトを返します。
1008
+
1009
+ <a name="user"></a>
1010
+ ## User
1011
+ * `id (string)`: ユーザー (または店舗) ID
1012
+ * `name (string)`: ユーザー (または店舗) 名
1013
+ * `is_merchant (boolean)`: 店舗ユーザーかどうか
1014
+
1015
+ <a name="organization"></a>
1016
+ ## Organization
1017
+ * `code (string)`: 組織コード
1018
+ * `name (string)`: 組織名
1019
+
1020
+ <a name="transaction"></a>
1021
+ ## Transaction
1022
+ * `id (string)`: 取引ID
1023
+ * `type (string)`: 取引種別 (チャージ=topup, 支払い=payment)
1024
+ * `is_modified (boolean)`: 返金された取引かどうか
1025
+ * `sender (User)`: 送金者情報
1026
+ * `sender_account (Account)`: 送金ウォレット情報
1027
+ * `receiver (User)`: 受取者情報
1028
+ * `receiver_account (Account)`: 受取ウォレット情報
1029
+ * `amount (double)`: 決済総額 (マネー額 + ポイント額)
1030
+ * `money_amount (double)`: 決済マネー額
1031
+ * `point_amount (double)`: 決済ポイント額
1032
+ * `done_at (string)`: 取引日時
1033
+ * `description (string)`: 取引説明文
1034
+
1035
+ `receiver`と`sender`は [User](#user) オブジェクトを返します。
1036
+
1037
+ `receiver_account`と`sender_account`は [Account](#account) オブジェクトを返します。
1038
+
1039
+ <a name="transfer"></a>
1040
+ ## Transfer
1041
+ * `id (string)`:
1042
+ * `sender_account (AccountWithoutPrivateMoneyDetail)`:
1043
+ * `receiver_account (AccountWithoutPrivateMoneyDetail)`:
1044
+ * `amount (double)`:
1045
+ * `money_amount (double)`:
1046
+ * `point_amount (double)`:
1047
+ * `done_at (string)`:
1048
+ * `type (string)`:
1049
+ * `description (string)`:
1050
+ * `transaction_id (string)`:
1051
+
1052
+ `receiver_account`と`sender_account`は [AccountWithoutPrivateMoneyDetail](#account-without-private-money-detail) オブジェクトを返します。
1053
+
1054
+ <a name="paginated-private-money-organization-summaries"></a>
1055
+ ## PaginatedPrivateMoneyOrganizationSummaries
1056
+ * `rows (array of PrivateMoneyOrganizationSummaries)`:
1057
+ * `count (integer)`:
1058
+ * `pagination (Pagination)`:
1059
+
1060
+ `rows`は [PrivateMoneyOrganizationSummary](#private-money-organization-summary) オブジェクトの配列を返します。
1061
+
1062
+ `pagination`は [Pagination](#pagination) オブジェクトを返します。
1063
+
1064
+ <a name="paginated-transaction"></a>
1065
+ ## PaginatedTransaction
1066
+ * `rows (array of Transactions)`:
1067
+ * `count (integer)`:
1068
+ * `pagination (Pagination)`:
1069
+
1070
+ `rows`は [Transaction](#transaction) オブジェクトの配列を返します。
1071
+
1072
+ `pagination`は [Pagination](#pagination) オブジェクトを返します。
1073
+
1074
+ <a name="paginated-accounts"></a>
1075
+ ## PaginatedAccounts
1076
+ * `rows (array of Accounts)`:
1077
+ * `count (integer)`:
1078
+ * `pagination (Pagination)`:
1079
+
1080
+ `rows`は [Account](#account) オブジェクトの配列を返します。
1081
+
1082
+ `pagination`は [Pagination](#pagination) オブジェクトを返します。
1083
+
1084
+ <a name="paginated-account-balance"></a>
1085
+ ## PaginatedAccountBalance
1086
+ * `rows (array of AccountBalances)`:
1087
+ * `count (integer)`:
1088
+ * `pagination (Pagination)`:
1089
+
1090
+ `rows`は [AccountBalance](#account-balance) オブジェクトの配列を返します。
1091
+
1092
+ `pagination`は [Pagination](#pagination) オブジェクトを返します。
1093
+
1094
+ <a name="paginated-shops"></a>
1095
+ ## PaginatedShops
1096
+ * `rows (array of ShopWithMetadatas)`:
1097
+ * `count (integer)`:
1098
+ * `pagination (Pagination)`:
1099
+
1100
+ `rows`は [ShopWithMetadata](#shop-with-metadata) オブジェクトの配列を返します。
1101
+
1102
+ `pagination`は [Pagination](#pagination) オブジェクトを返します。
1103
+
1104
+ <a name="paginated-bills"></a>
1105
+ ## PaginatedBills
1106
+ * `rows (array of Bills)`:
1107
+ * `count (integer)`:
1108
+ * `pagination (Pagination)`:
1109
+
1110
+ `rows`は [Bill](#bill) オブジェクトの配列を返します。
1111
+
1112
+ `pagination`は [Pagination](#pagination) オブジェクトを返します。
1113
+
1114
+ <a name="private-money"></a>
1115
+ ## PrivateMoney
1116
+ * `id (string)`: マネーID
1117
+ * `name (string)`: マネー名
1118
+ * `unit (string)`: マネー単位 (例: 円)
1119
+ * `is_exclusive (boolean)`: 会員制のマネーかどうか
1120
+ * `description (string)`: マネー説明文
1121
+ * `oneline_message (string)`: マネーの要約
1122
+ * `organization (Organization)`: マネーを発行した組織
1123
+ * `max_balance (double)`: ウォレットの上限金額
1124
+ * `transfer_limit (double)`: マネーの取引上限額
1125
+ * `type (string)`: マネー種別 (自家型=own, 第三者型=third-party)
1126
+ * `expiration_type (string)`: 有効期限種別 (チャージ日起算=static, 最終利用日起算=last-update, 最終チャージ日起算=last-topup-update)
1127
+ * `enable_topup_by_member (boolean)`: 加盟店によるチャージが有効かどうか
1128
+ * `account_image (string)`: マネーの画像URL
1129
+
1130
+ `organization`は [Organization](#organization) オブジェクトを返します。
1131
+
1132
+ <a name="account"></a>
1133
+ ## Account
1134
+ * `id (string)`: ウォレットID
1135
+ * `name (string)`: ウォレット名
1136
+ * `is_suspended (boolean)`: ウォレットが凍結されているかどうか
1137
+ * `private_money (PrivateMoney)`: 設定マネー情報
1138
+
1139
+ `private_money`は [PrivateMoney](#private-money) オブジェクトを返します。
1140
+
1141
+ <a name="account-without-private-money-detail"></a>
1142
+ ## AccountWithoutPrivateMoneyDetail
1143
+ * `id (string)`:
1144
+ * `name (string)`:
1145
+ * `is_suspended (boolean)`:
1146
+ * `private_money_id (string)`:
1147
+ * `user (User)`:
1148
+
1149
+ `user`は [User](#user) オブジェクトを返します。
1150
+
1151
+ <a name="private-money-organization-summary"></a>
1152
+ ## PrivateMoneyOrganizationSummary
1153
+ * `organization_code (string)`:
1154
+ * `topup (OrganizationSummary)`:
1155
+ * `payment (OrganizationSummary)`:
1156
+
1157
+ `payment`と`topup`は [OrganizationSummary](#organization-summary) オブジェクトを返します。
1158
+
1159
+ <a name="pagination"></a>
1160
+ ## Pagination
1161
+ * `current (integer)`:
1162
+ * `per_page (integer)`:
1163
+ * `max_page (integer)`:
1164
+ * `has_prev (boolean)`:
1165
+ * `has_next (boolean)`:
1166
+
1167
+ <a name="account-balance"></a>
1168
+ ## AccountBalance
1169
+ * `expires_at (string)`:
1170
+ * `money_amount (double)`:
1171
+ * `point_amount (double)`:
212
1172
 
213
- 成功したときは Pokepay::Response::Transaction を持つレスポンスオブジェクトを返します。
1173
+ <a name="shop-with-metadata"></a>
1174
+ ## ShopWithMetadata
1175
+ * `id (string)`: 店舗ID
1176
+ * `name (string)`: 店舗名
1177
+ * `organization_code (string)`: 組織コード
1178
+ * `postal_code (string)`: 店舗の郵便番号
1179
+ * `address (string)`: 店舗の住所
1180
+ * `tel (string)`: 店舗の電話番号
1181
+ * `email (string)`: 店舗のメールアドレス
1182
+ * `external_id (string)`: 店舗の外部ID