pokepay_partner_ruby_sdk 0.1.4 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/docs/index.md +1434 -194
  4. data/lib/pokepay_partner_ruby_sdk.rb +30 -0
  5. data/lib/pokepay_partner_ruby_sdk/request/bulk_create_transaction.rb +17 -0
  6. data/lib/pokepay_partner_ruby_sdk/request/cancel_cashtray.rb +15 -0
  7. data/lib/pokepay_partner_ruby_sdk/request/create_bill.rb +16 -0
  8. data/lib/pokepay_partner_ruby_sdk/request/create_cashtray.rb +17 -0
  9. data/lib/pokepay_partner_ruby_sdk/request/create_shop_v.rb +15 -0
  10. data/lib/pokepay_partner_ruby_sdk/request/create_transfer_transaction.rb +18 -0
  11. data/lib/pokepay_partner_ruby_sdk/request/get_bulk_transaction.rb +15 -0
  12. data/lib/pokepay_partner_ruby_sdk/request/get_cashtray.rb +15 -0
  13. data/lib/pokepay_partner_ruby_sdk/request/get_private_moneys.rb +15 -0
  14. data/lib/pokepay_partner_ruby_sdk/request/get_shop.rb +15 -0
  15. data/lib/pokepay_partner_ruby_sdk/request/list_account_expired_balances.rb +15 -0
  16. data/lib/pokepay_partner_ruby_sdk/request/list_bills.rb +15 -0
  17. data/lib/pokepay_partner_ruby_sdk/request/list_customer_transactions.rb +15 -0
  18. data/lib/pokepay_partner_ruby_sdk/request/list_shops.rb +15 -0
  19. data/lib/pokepay_partner_ruby_sdk/request/list_user_accounts.rb +15 -0
  20. data/lib/pokepay_partner_ruby_sdk/request/update_bill.rb +15 -0
  21. data/lib/pokepay_partner_ruby_sdk/request/update_cashtray.rb +15 -0
  22. data/lib/pokepay_partner_ruby_sdk/request/update_shop.rb +15 -0
  23. data/lib/pokepay_partner_ruby_sdk/response/bill.rb +26 -0
  24. data/lib/pokepay_partner_ruby_sdk/response/bulk_transaction.rb +27 -0
  25. data/lib/pokepay_partner_ruby_sdk/response/cashtray.rb +24 -0
  26. data/lib/pokepay_partner_ruby_sdk/response/cashtray_attempt.rb +20 -0
  27. data/lib/pokepay_partner_ruby_sdk/response/cashtray_with_result.rb +30 -0
  28. data/lib/pokepay_partner_ruby_sdk/response/paginated_accounts.rb +16 -0
  29. data/lib/pokepay_partner_ruby_sdk/response/paginated_bills.rb +16 -0
  30. data/lib/pokepay_partner_ruby_sdk/response/paginated_private_moneys.rb +16 -0
  31. data/lib/pokepay_partner_ruby_sdk/response/paginated_shops.rb +16 -0
  32. data/lib/pokepay_partner_ruby_sdk/response/private_money.rb +0 -2
  33. data/lib/pokepay_partner_ruby_sdk/response/shop_account.rb +20 -0
  34. data/lib/pokepay_partner_ruby_sdk/response/shop_with_accounts.rb +27 -0
  35. data/lib/pokepay_partner_ruby_sdk/response/shop_with_metadata.rb +25 -0
  36. data/lib/pokepay_partner_ruby_sdk/version.rb +1 -1
  37. data/partner.yaml +1694 -75
  38. metadata +35 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef55822676f9f2e427fd76e1434e510c90491a72d57ce38d0be9c6f9f271936b
4
- data.tar.gz: a48fb9effd3ae012dc51d9efc19021088d8d01e6c3eab08745beb5b6e6fbef6d
3
+ metadata.gz: b31b44c25482290e71f6ddb114c700f2502dd19bae3a6f4c7a0dbf125f034af7
4
+ data.tar.gz: d37c5c6a38ef8e22ff542ef38402924ef1614c8231ff4b1b5410a55e727a600e
5
5
  SHA512:
6
- metadata.gz: dce0a61b071729c5b85af8035d7e1cc767d5eb99b55da16a0126c344aba7b8fee5a17a70994d8284bc3fe02910cceda320ff646dcba3aea2230c908a57906cdb
7
- data.tar.gz: 2f4f017ff5a6fa72c2dcce10155ec211f9db9f4ca00f8f8f28914502fb85a4721564c014c27efee938889aeeffc3de999e6e4f4bf0bd6e72cd854a05f7c07919
6
+ metadata.gz: 135694919952fad3d174fd466f20350d8411c615b691368b30e01820bc25be8054597f247ba12b5fa08a6c6a003102e75ba03fb95c06b6843ec88e8465701be8
7
+ data.tar.gz: a4492393069d894ac2a35d9a77056376c401db1dc206e29bff3322b04b0706d0e5912b1864514b1247b89ede94c543a4cd32dcce600170ccee7a17437f0ea077
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pokepay_partner_ruby_sdk (0.1.4)
4
+ pokepay_partner_ruby_sdk (0.1.9)
5
5
  inifile (~> 3.0.0)
6
6
  json (~> 2.3.0)
7
7
  openssl (~> 2.1.2)
@@ -11,7 +11,7 @@ GEM
11
11
  specs:
12
12
  inifile (3.0.0)
13
13
  ipaddr (1.2.2)
14
- json (2.3.0)
14
+ json (2.3.1)
15
15
  minitest (5.14.0)
16
16
  openssl (2.1.2)
17
17
  ipaddr
data/docs/index.md CHANGED
@@ -1,5 +1,4 @@
1
1
  # Partner API SDK for Ruby
2
-
3
2
  ## Installation
4
3
 
5
4
  rubygemsからインストールすることができます。
@@ -140,287 +139,1528 @@ response.code
140
139
  response.body
141
140
  # => {"type"=>"invalid_parameters", "message"=>"Invalid parameters", "errors"=>{"invalid"=>["message"]}}
142
141
  ```
143
-
144
142
  <a name="api-operations"></a>
145
143
  ## API Operations
146
144
 
145
+ - [ListTransactions](#list-transactions): 取引履歴を取得する
146
+ - [CreateTransaction](#create-transaction): チャージする(廃止予定)
147
+ - [CreateTopupTransaction](#create-topup-transaction): チャージする
148
+ - [CreatePaymentTransaction](#create-payment-transaction): 支払いする
149
+ - [CreateTransferTransaction](#create-transfer-transaction): 個人間送金
150
+ - [CreateExchangeTransaction](#create-exchange-transaction):
151
+ - [GetTransaction](#get-transaction): 取引情報を取得する
152
+ - [ListTransfers](#list-transfers):
153
+ - [CreateTopupTransactionWithCheck](#create-topup-transaction-with-check): チャージQRコードを読み取ることでチャージする
154
+ - [ListBills](#list-bills): 支払いQRコード一覧を表示する
155
+ - [CreateBill](#create-bill): 支払いQRコードの発行
156
+ - [UpdateBill](#update-bill): 支払いQRコードの更新
157
+ - [CreateCashtray](#create-cashtray): Cashtrayを作る
158
+ - [GetCashtray](#get-cashtray): Cashtrayの情報を取得する
159
+ - [CancelCashtray](#cancel-cashtray): Cashtrayを無効化する
160
+ - [UpdateCashtray](#update-cashtray): Cashtrayの情報を更新する
161
+ - [GetAccount](#get-account): ウォレット情報を表示する
162
+ - [UpdateAccount](#update-account): ウォレット情報を更新する
163
+ - [ListAccountBalances](#list-account-balances): エンドユーザーの残高内訳を表示する
164
+ - [ListAccountExpiredBalances](#list-account-expired-balances): エンドユーザーの失効済みの残高内訳を表示する
165
+ - [CreateCustomerAccount](#create-customer-account): 新規エンドユーザーウォレットを追加する
166
+ - [ListCustomerTransactions](#list-customer-transactions): 取引履歴を取得する
167
+ - [ListShops](#list-shops): 店舗一覧を取得する
168
+ - [CreateShop](#create-shop): 新規店舗を追加する(廃止予定)
169
+ - [CreateShopV2](#create-shop-v): 新規店舗を追加する
170
+ - [GetShop](#get-shop): 店舗情報を表示する
171
+ - [UpdateShop](#update-shop): 店舗情報を更新する
172
+ - [ListUserAccounts](#list-user-accounts): エンドユーザー、店舗ユーザーのウォレット一覧を表示する
173
+ - [GetPrivateMoneys](#get-private-moneys): マネー一覧を取得する
174
+ - [GetPrivateMoneyOrganizationSummaries](#get-private-money-organization-summaries): 決済加盟店の取引サマリを取得する
175
+ - [BulkCreateTransaction](#bulk-create-transaction): CSVファイル一括取引
147
176
  ### Transaction
177
+ <a name="list-transactions"></a>
178
+ #### 取引履歴を取得する
179
+ 取引一覧を返します。
180
+ ```ruby
181
+ response = $client.send(Pokepay::Request::ListTransactions.new(
182
+ from: "2018-02-24T20:24:55.000000+09:00", # 開始日時
183
+ to: "2020-10-22T04:47:28.000000+09:00", # 終了日時
184
+ page: 1, # ページ番号
185
+ per_page: 50, # 1ページ分の取引数
186
+ shop_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # 店舗ID
187
+ customer_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # エンドユーザーID
188
+ customer_name: "太郎", # エンドユーザー名
189
+ terminal_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # 端末ID
190
+ transaction_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # 取引ID
191
+ organization_code: "pocketchange", # 組織コード
192
+ private_money_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # マネーID
193
+ is_modified: true, # キャンセルフラグ
194
+ types: ["topup", "payment"] # 取引種別 (複数指定可)、チャージ=topup、支払い=payment
195
+ ))
196
+ ```
148
197
 
149
- <a name="get-transaction"></a>
150
- #### 取引情報を取得する
198
+ ---
199
+ `from`
200
+ 抽出期間の開始日時です。
201
+
202
+ フィルターとして使われ、開始日時以降に発生した取引のみ一覧に表示されます。
203
+
204
+ ---
205
+ `to`
206
+ 抽出期間の終了日時です。
207
+
208
+ フィルターとして使われ、終了日時以前に発生した取引のみ一覧に表示されます。
209
+
210
+ ---
211
+ `page`
212
+ 取得したいページ番号です。
213
+
214
+ ---
215
+ `per_page`
216
+ 1ページ分の取引数です。
217
+
218
+ ---
219
+ `shop_id`
220
+ 店舗IDです。
221
+
222
+ フィルターとして使われ、指定された店舗での取引のみ一覧に表示されます。
223
+
224
+ ---
225
+ `customer_id`
226
+ エンドユーザーIDです。
227
+
228
+ フィルターとして使われ、指定されたエンドユーザーでの取引のみ一覧に表示されます。
229
+
230
+ ---
231
+ `customer_name`
232
+ エンドユーザー名です。
233
+
234
+ フィルターとして使われ、入力された名前に部分一致するエンドユーザーでの取引のみ一覧に表示されます。
235
+
236
+ ---
237
+ `terminal_id`
238
+ 端末IDです。
239
+
240
+ フィルターとして使われ、指定された端末での取引のみ一覧に表示されます。
241
+
242
+ ---
243
+ `transaction_id`
244
+ 取引IDです。
245
+
246
+ フィルターとして使われ、指定された取引のみ一覧に表示されます。
247
+
248
+ ---
249
+ `organization_code`
250
+ 組織コードです。
251
+
252
+ フィルターとして使われ、指定された組織での取引のみ一覧に表示されます。
253
+
254
+ ---
255
+ `private_money_id`
256
+ マネーIDです。
257
+
258
+ フィルターとして使われ、指定したマネーでの取引のみ一覧に表示されます。
259
+
260
+ ---
261
+ `is_modified`
262
+ キャンセルフラグです。
151
263
 
264
+ これにtrueを指定するとキャンセルされた取引のみ一覧に表示されます。
265
+ デフォルト値はfalseで、キャンセルの有無にかかわらず一覧に表示されます。
266
+
267
+ ---
268
+ `types`
269
+ 取引の種類でフィルターします。
270
+
271
+ 以下の種類を指定できます。
272
+
273
+ 1. topup
274
+ 店舗からエンドユーザーへの送金取引(チャージ)
275
+
276
+ 2. payment
277
+ エンドユーザーから店舗への送金取引(支払い)
278
+
279
+ 3. exchange-outflow
280
+   他マネーへの流出
281
+
282
+ 4. exchange-inflow
283
+ 他マネーからの流入
284
+
285
+ ---
286
+ 成功したときは[PaginatedTransaction](#paginated-transaction)オブジェクトを返します
287
+ <a name="create-transaction"></a>
288
+ #### チャージする(廃止予定)
289
+ チャージ取引を作成します。このAPIは廃止予定です。以降は `CreateTopupTransaction` を使用してください。
152
290
  ```ruby
153
- response = client.send(Pokepay::Request::GetTransaction.new(
154
- "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # 取引ID
155
- ))
291
+ response = $client.send(Pokepay::Request::CreateTransaction.new(
292
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
293
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
294
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
295
+ money_amount: 313,
296
+ point_amount: 3912,
297
+ point_expires_at: "2023-04-30T21:00:37.000000+09:00", # ポイント有効期限
298
+ description: "S"
299
+ ))
300
+ ```
301
+
302
+ ---
303
+ `point_expires_at`
304
+ ポイントをチャージした場合の、付与されるポイントの有効期限です。
305
+ 省略した場合はマネーに設定された有効期限と同じものがポイントの有効期限となります。
156
306
 
307
+ ---
308
+ 成功したときは[Transaction](#transaction)オブジェクトを返します
309
+ <a name="create-topup-transaction"></a>
310
+ #### チャージする
311
+ チャージ取引を作成します。
312
+ ```ruby
313
+ response = $client.send(Pokepay::Request::CreateTopupTransaction.new(
314
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # shop_id: 店舗ID
315
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # customer_id: エンドユーザーのID
316
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
317
+ bear_point_shop_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # ポイント支払時の負担店舗ID
318
+ money_amount: 5960, # マネー額
319
+ point_amount: 6566, # ポイント額
320
+ point_expires_at: "2020-06-09T20:49:01.000000+09:00", # ポイント有効期限
321
+ description: "初夏のチャージキャンペーン" # 取引履歴に表示する説明文
322
+ ))
157
323
  ```
158
324
 
159
- 成功したときは以下のプロパティを含む `Pokepay::Response::Transaction` オブジェクトをレスポンスとして返します。
325
+ ---
326
+ `shop_id`
327
+ 店舗IDです。
160
328
 
161
- - id (String): 取引ID
162
- - type (String): 取引種別 (チャージ=topup, 支払い=payment)
163
- - is_modified (真理値): 返金された取引かどうか
164
- - sender (Pokepay::Response::User): 送金者情報
165
- - receiver (Pokepay::Response::User): 受取者情報
166
- - sender_account (Pokepay::Response::Account): 送金口座情報
167
- - receiver_account (Pokepay::Response::Account): 受取口座情報
168
- - amount (Numeric): 決済総額 (マネー額 + ポイント額)
169
- - money_amount (Numeric): 決済マネー額
170
- - point_amount (Numeric): 決済ポイント額
171
- - done_at (Time): 取引日時
172
- - description (String): 取引説明文
329
+ 送金元の店舗を指定します。
173
330
 
174
- `sender` と `receiver` は `Pokepay::Response::User` のオブジェクトです。 以下にプロパティを示します。
331
+ ---
332
+ `customer_id`
333
+ エンドユーザーIDです。
175
334
 
176
- - id (String): ユーザー (または店舗) ID
177
- - name (String): ユーザー (または店舗) 名
178
- - is_merchant (真理値): 店舗ユーザーかどうか
335
+ 送金先のエンドユーザーを指定します。
179
336
 
180
- `senderAccount` と `receiverAccount` は `Pokepay::Response::Account` のオブジェクトです。以下にプロパティを示します。
337
+ ---
338
+ `private_money_id`
339
+ マネーIDです。
181
340
 
182
- - id (String): 口座ID
183
- - name (String): 口座名
184
- - is_suspended (真理値): 口座が凍結されているかどうか
185
- - private_money (Pokepay::Response::PrivateMoney): 設定マネー情報
341
+ マネーを指定します。
186
342
 
187
- `privateMoney` は `Pokepay::Response::PrivateMoney` のオブジェクトです。以下にプロパティを示します。
343
+ ---
344
+ `bear_point_shop_id`
345
+ ポイント支払時の負担店舗IDです。
188
346
 
189
- - id (String): マネーID
190
- - name (String): マネー名
191
- - unit (String): マネー単位 (例: 円)
192
- - is_exclusive (真理値): 会員制のマネーかどうか
193
- - description (String): マネー説明文
194
- - max_balance (Numeric): 口座の上限金額
195
- - transfer_limit (Numeric): マネーの取引上限額
196
- - type (String): マネー種別 (自家型=own, 第三者型=third-party)
197
- - expiration_type (String): 有効期限種別 (チャージ日時起算=static, 最終利用日時起算=last-update)
347
+ ポイント支払い時に実際お金を負担する店舗を指定します。
198
348
 
199
- #### チャージする
349
+ ---
350
+ `money_amount`
351
+ マネー額です。
352
+
353
+ 送金するマネー額を指定します。
354
+
355
+ ---
356
+ `point_amount`
357
+ ポイント額です。
358
+
359
+ 送金するポイント額を指定します。
360
+
361
+ ---
362
+ `point_expires_at`
363
+ ポイントをチャージした場合の、付与されるポイントの有効期限です。
364
+ 省略した場合はマネーに設定された有効期限と同じものがポイントの有効期限となります。
365
+
366
+ ---
367
+ `description`
368
+ 取引説明文です。
369
+
370
+ 任意入力で、取引履歴に表示される説明文です。
371
+
372
+ ---
373
+ 成功したときは[Transaction](#transaction)オブジェクトを返します
374
+ <a name="create-payment-transaction"></a>
375
+ #### 支払いする
376
+ 支払取引を作成します。
377
+ 支払い時には、エンドユーザーの残高のうち、ポイント残高から優先的に消費されます。
200
378
 
201
379
  ```ruby
202
- response = client.send(Pokepay::Request::CreateTopupTransaction.new(
203
- "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # 店舗ID
204
- "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy", # エンドユーザーのID
205
- "zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz", # 送るマネーのID
206
- {
207
- "money_amount" => 100, # チャージマネー額
208
- "point_amount" => 200, # チャージするポイント額 (任意)
209
- "description" => "チャージテスト" # 取引履歴に表示する説明文 (任意)
210
- }))
380
+ response = $client.send(Pokepay::Request::CreatePaymentTransaction.new(
381
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # shop_id: 店舗ID
382
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # customer_id: エンドユーザーID
383
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
384
+ 5274, # amount: 支払い額
385
+ description: "たい焼き(小倉)" # 取引履歴に表示する説明文
386
+ ))
211
387
  ```
212
388
 
213
- 成功したときは `Pokepay::Response::Transaction` を持つレスポンスオブジェクトを返します。
214
- プロパティは [取引情報を取得する](#get-transaction) を参照してください。
389
+ ---
390
+ `shop_id`
391
+ 店舗IDです。
215
392
 
216
- #### 支払いする
393
+ 送金先の店舗を指定します。
394
+
395
+ ---
396
+ `customer_id`
397
+ エンドユーザーIDです。
398
+
399
+ 送金元のエンドユーザーを指定します。
400
+
401
+ ---
402
+ `private_money_id`
403
+ マネーIDです。
404
+
405
+ マネーを指定します。
406
+
407
+ ---
408
+ `amount`
409
+ マネー額です。
410
+
411
+ 送金するマネー額を指定します。
412
+
413
+ ---
414
+ `description`
415
+ 取引説明文です。
416
+
417
+ 任意入力で、取引履歴に表示される説明文です。
418
+
419
+ ---
420
+ 成功したときは[Transaction](#transaction)オブジェクトを返します
421
+ <a name="create-transfer-transaction"></a>
422
+ #### 個人間送金
423
+ エンドユーザー間での送金取引(個人間送金)を作成します。
424
+ 個人間送金で送れるのはマネーのみで、ポイントを送ることはできません。送金元のマネー残高のうち、有効期限が最も遠いものから順に送金されます。
217
425
 
218
426
  ```ruby
219
- response = client.send(Pokepay::Request::CreatePaymentTransaction.new(
220
- "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # 店舗ID
221
- "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy", # エンドユーザーのID
222
- "zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz", # 支払うマネーのID
223
- 100, # 支払い額
224
- {
225
- "description" => "たい焼き(小倉)" # 取引履歴に表示する説明文 (任意)
226
- }))
427
+ response = $client.send(Pokepay::Request::CreateTransferTransaction.new(
428
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # sender_id: 送金元ユーザーID
429
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # receiver_id: 受取ユーザーID
430
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
431
+ 9429, # amount: 送金額
432
+ description: "たい焼き(小倉)" # 取引履歴に表示する説明文
433
+ ))
227
434
  ```
228
435
 
229
- 成功したときは `Pokepay::Response::Transaction` オブジェクトをレスポンスとして返します。
230
- プロパティは [取引情報を取得する](#get-transaction) を参照してください。
436
+ ---
437
+ `sender_id`
438
+ エンドユーザーIDです。
439
+
440
+ 送金元のエンドユーザー(送り主)を指定します。
441
+
442
+ ---
443
+ `receiver_id`
444
+ エンドユーザーIDです。
445
+
446
+ 送金先のエンドユーザー(受け取り人)を指定します。
447
+
448
+ ---
449
+ `private_money_id`
450
+ マネーIDです。
231
451
 
232
- #### チャージ用QRコードを読み取ることでチャージする
452
+ マネーを指定します。
233
453
 
234
- チャージ用QRコードを解析すると次のようなURLになります(URLは環境によって異なります)。
454
+ ---
455
+ `amount`
456
+ マネー額です。
457
+
458
+ 送金するマネー額を指定します。
459
+
460
+ ---
461
+ `description`
462
+ 取引説明文です。
463
+
464
+ 任意入力で、取引履歴に表示される説明文です。
465
+
466
+ ---
467
+ 成功したときは[Transaction](#transaction)オブジェクトを返します
468
+ <a name="create-exchange-transaction"></a>
469
+ ####
470
+ ```ruby
471
+ response = $client.send(Pokepay::Request::CreateExchangeTransaction.new(
472
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
473
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
474
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
475
+ 3501,
476
+ description: "ruJxi1ST1WXtfeKSzrq1Zc5Ju53UYOCwl5C8rEq5yNfh8NoRe5rX0rVCmpqdlLHNNlbdnW1ooZFRDSiyltrhPzNi7jenj4X3xdXKxR7POl5XLEB6rdcoyFq3Dy2RXyPUA"
477
+ ))
478
+ ```
479
+ 成功したときは[Transaction](#transaction)オブジェクトを返します
480
+ <a name="get-transaction"></a>
481
+ #### 取引情報を取得する
482
+ 取引を取得します。
483
+ ```ruby
484
+ response = $client.send(Pokepay::Request::GetTransaction.new(
485
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # transaction_id: 取引ID
486
+ ))
487
+ ```
488
+
489
+ ---
490
+ `transaction_id`
491
+ 取引IDです。
492
+
493
+ フィルターとして使われ、指定した取引IDの取引を取得します。
494
+
495
+ ---
496
+ 成功したときは[Transaction](#transaction)オブジェクトを返します
497
+ <a name="list-transfers"></a>
498
+ ####
499
+ ```ruby
500
+ response = $client.send(Pokepay::Request::ListTransfers.new(
501
+ from: "2017-11-27T11:10:27.000000+09:00",
502
+ to: "2022-07-13T10:00:27.000000+09:00",
503
+ page: 9517,
504
+ per_page: 651,
505
+ shop_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
506
+ shop_name: "gOIxNaz33MDlMm45c417ClVPZadCz21oTLg0Zh082rSUmgTJgltXUvopMAE6nKVgCC79b4Ei190OQ71CLczodkHUHlo8UiDVjyL8K2mxNxSNDBAB21jRDnDfUt4YgIyZaTsiHOmcCShoExxXDzwmu0NmtxroKVUk7sDu4lw8ZxL5",
507
+ customer_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
508
+ customer_name: "oBCUmbexHlOYPdRDRXfcFEKebPAHiatKRmL7K8IMJIBW1vB1RC8WQ75Zq2CPEph5LyiHrKKZHYeA6KMsRSBkbfNhFwjSSUkqouGV2ULftf3KLiOm",
509
+ transaction_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
510
+ private_money_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
511
+ is_modified: true,
512
+ transaction_types: ["topup", "transfer", "exchange"],
513
+ transfer_types: ["exchange", "payment"]
514
+ ))
515
+ ```
516
+ 成功したときは[PaginatedTransfers](#paginated-transfers)オブジェクトを返します
517
+ ### Check
518
+ 店舗ユーザが発行し、エンドユーザーがポケペイアプリから読み取ることでチャージ取引が発生するQRコードです。
519
+
520
+ チャージQRコードを解析すると次のようなURLになります(URLは環境によって異なります)。
235
521
 
236
522
  `https://www-sandbox.pokepay.jp/checks/xxxxxxxx-xxxx-xxxxxxxxx-xxxxxxxxxxxx`
237
523
 
238
- この `xxxxxxxx-xxxx-xxxxxxxxx-xxxxxxxxxxxx` の部分がチャージ用QRコードのIDです。
239
- これを以下のようにエンドユーザIDと共に渡すことでチャージ取引が作られます。
524
+ QRコードを読み取る方法以外にも、このURLリンクを直接スマートフォン(iOS/Android)上で開くことによりアプリが起動して取引が行われます。(注意: 上記URLはsandbox環境であるため、アプリもsandbox環境のものである必要があります) 上記URL中の `xxxxxxxx-xxxx-xxxxxxxxx-xxxxxxxxxxxx` の部分がチャージQRコードのIDです。
525
+
526
+ <a name="create-topup-transaction-with-check"></a>
527
+ #### チャージQRコードを読み取ることでチャージする
528
+ 通常チャージQRコードはエンドユーザーのアプリによって読み取られ、アプリとポケペイサーバとの直接通信によって取引が作られます。 もしエンドユーザーとの通信をパートナーのサーバのみに限定したい場合、パートナーのサーバがチャージQRの情報をエンドユーザーから代理受けして、サーバ間連携APIによって実際のチャージ取引をリクエストすることになります。
529
+
530
+ エンドユーザーから受け取ったチャージ用QRコードのIDをエンドユーザーIDと共に渡すことでチャージ取引が作られます。
240
531
 
241
532
  ```ruby
242
- response = client.send(Pokepay::Request::CreateTopupTransactionWithCheck.new(
243
- "xxxxxxxx-xxxx-xxxxxxxxx-xxxxxxxxxxxx", # チャージ用QRコードのID
244
- "yyyyyyyy-yyyy-yyyyyyyyy-yyyyyyyyyyyy" # エンドユーザーのID
245
- ))
533
+ response = $client.send(Pokepay::Request::CreateTopupTransactionWithCheck.new(
534
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # check_id: チャージ用QRコードのID
535
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # customer_id: エンドユーザーのID
536
+ ))
246
537
  ```
247
538
 
248
- 成功したときは `Pokepay::Response::Transaction` オブジェクトをレスポンスとして返します。
249
- プロパティは [取引情報を取得する](#get-transaction) を参照してください。
539
+ ---
540
+ `check_id`
541
+ チャージ用QRコードのIDです。
250
542
 
251
- #### 取引履歴を取得する
543
+ QRコード生成時に送金元店舗のウォレット情報や、送金額などが登録されています。
544
+
545
+ ---
546
+ `customer_id`
547
+ エンドユーザーIDです。
252
548
 
549
+ 送金先のエンドユーザーを指定します。
550
+
551
+ ---
552
+ 成功したときは[Transaction](#transaction)オブジェクトを返します
553
+ ### Bill
554
+ 支払いQRコード
555
+ <a name="list-bills"></a>
556
+ #### 支払いQRコード一覧を表示する
557
+ 支払いQRコード一覧を表示します。
253
558
  ```ruby
254
- response = client.send(Pokepay::Request::ListTransactions.new(
255
- {
256
- # ページング
257
- "page" => 1,
258
- "per_page" => 50,
559
+ response = $client.send(Pokepay::Request::ListBills.new(
560
+ page: 532, # ページ番号
561
+ per_page: 218, # 1ページの表示数
562
+ bill_id: "WM", # 支払いQRコードのID
563
+ private_money_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # マネーID
564
+ organization_code: "--9", # 組織コード
565
+ description: "test bill", # 取引説明文
566
+ created_from: "2016-02-26T19:01:25.000000+09:00", # 作成日時(起点)
567
+ created_to: "2021-01-22T10:47:37.000000+09:00", # 作成日時(終点)
568
+ shop_name: "bill test shop1", # 店舗名
569
+ shop_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # 店舗ID
570
+ lower_limit_amount: 4942, # 金額の範囲によるフィルタ(下限)
571
+ upper_limit_amount: 1563, # 金額の範囲によるフィルタ(上限)
572
+ is_disabled: true # 支払いQRコードが無効化されているかどうか
573
+ ))
574
+ ```
575
+
576
+ ---
577
+ `page`
578
+ 取得したいページ番号です。
579
+
580
+ ---
581
+ `per_page`
582
+ 1ページに表示する支払いQRコードの数です。
583
+
584
+ ---
585
+ `bill_id`
586
+ 支払いQRコードのIDを指定して検索します。IDは前方一致で検索されます。
587
+
588
+ ---
589
+ `private_money_id`
590
+ 支払いQRコードの送金元ウォレットのマネーIDでフィルターします。
591
+
592
+ ---
593
+ `organization_code`
594
+ 支払いQRコードの送金元店舗が所属する組織の組織コードでフィルターします。
595
+
596
+ ---
597
+ `description`
598
+ 支払いQRコードを読み取ることで作られた取引の説明文としてアプリなどに表示されます。
599
+
600
+ ---
601
+ `created_from`
602
+ 支払いQRコードの作成日時でフィルターします。
603
+
604
+ これ以降に作成された支払いQRコードのみ一覧に表示されます。
605
+
606
+ ---
607
+ `created_to`
608
+ 支払いQRコードの作成日時でフィルターします。
609
+
610
+ これ以前に作成された支払いQRコードのみ一覧に表示されます。
611
+
612
+ ---
613
+ `shop_name`
614
+ 支払いQRコードを作成した店舗名でフィルターします。店舗名は部分一致で検索されます。
615
+
616
+ ---
617
+ `shop_id`
618
+ 支払いQRコードを作成した店舗IDでフィルターします。
259
619
 
260
- # フィルタオプション (すべて任意)
261
- # 期間指定 (ISO8601形式の文字列)
262
- "from" => "2019-01-01T00:00:00+09:00",
263
- "to" => "2019-07-30T18:13:39+09:00",
620
+ ---
621
+ `lower_limit_amount`
622
+ 支払いQRコードの金額の下限を指定してフィルターします。
264
623
 
265
- # 検索オプション
266
- "customer_id" => "xxxxxxxxxxxxxxxxx", # エンドユーザーID
267
- "customer_name" => "福沢", # エンドユーザー名
268
- "transaction_id" => "24bba30c......", # 取引ID
269
- "shop_id" => "456a820b......", # 店舗ID
270
- "terminal_id" => "d8023185......", # 端末ID
271
- "organization" => "pocketchange", # 組織コード
272
- "private_money_id" => "9ff644fc......", # マネーID
273
- "is_modified" => true, # キャンセルされた取引のみ検索するか
274
- # 取引種別 (複数指定可)、チャージ=topup、支払い=payment
275
- "types" => ["topup", "payment"],
276
- }))
624
+ ---
625
+ `upper_limit_amount`
626
+ 支払いQRコードの金額の上限を指定してフィルターします。
627
+
628
+ ---
629
+ `is_disabled`
630
+ 支払いQRコードが無効化されているかどうかを表します。デフォルト値は偽(有効)です。
631
+
632
+ ---
633
+ 成功したときは[PaginatedBills](#paginated-bills)オブジェクトを返します
634
+ <a name="create-bill"></a>
635
+ #### 支払いQRコードの発行
636
+ 支払いQRコードの内容を更新します。支払い先の店舗ユーザーは指定したマネーのウォレットを持っている必要があります。
637
+ ```ruby
638
+ response = $client.send(Pokepay::Request::CreateBill.new(
639
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: 支払いマネーのマネーID
640
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # shop_id: 支払い先(受け取り人)の店舗ID
641
+ amount: 3512, # 支払い額
642
+ description: "test bill" # 説明文(アプリ上で取引の説明文として表示される)
643
+ ))
277
644
  ```
278
645
 
279
- 成功したときは `Pokepay::Response::Transaction` を `rows` に含むページングオブジェクトを返します。
280
- 詳細は [ページング](#paging) を参照してください。
646
+ ---
647
+ `amount`
648
+ 支払いQRコードを支払い額を指定します。省略するかnullを渡すと任意金額の支払いQRコードとなり、エンドユーザーがアプリで読み取った際に金額を入力します。
281
649
 
282
- ### Customer
650
+ ---
651
+ 成功したときは[Bill](#bill)オブジェクトを返します
652
+ <a name="update-bill"></a>
653
+ #### 支払いQRコードの更新
654
+ 支払いQRコードの内容を更新します。パラメータは全て省略可能で、指定したもののみ更新されます。
655
+ ```ruby
656
+ response = $client.send(Pokepay::Request::UpdateBill.new(
657
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # bill_id: 支払いQRコードのID
658
+ amount: 2045, # 支払い額
659
+ description: "test bill", # 説明文
660
+ is_disabled: true # 無効化されているかどうか
661
+ ))
662
+ ```
663
+
664
+ ---
665
+ `bill_id`
666
+ 更新対象の支払いQRコードのIDです。
667
+
668
+ ---
669
+ `amount`
670
+ 支払いQRコードを支払い額を指定します。nullを渡すと任意金額の支払いQRコードとなり、エンドユーザーがアプリで読み取った際に金額を入力します。
671
+
672
+ ---
673
+ `description`
674
+ 支払いQRコードの詳細説明文です。アプリ上で取引の説明文として表示されます。
675
+
676
+ ---
677
+ `is_disabled`
678
+ 支払いQRコードが無効化されているかどうかを指定します。真にすると無効化され、偽にすると有効化します。
679
+
680
+ ---
681
+ 成功したときは[Bill](#bill)オブジェクトを返します
682
+ ### Cashtray
683
+ Cashtrayは支払いとチャージ両方に使えるQRコードで、店舗ユーザとエンドユーザーの間の主に店頭などでの取引のために用いられます。
684
+ Cashtrayによる取引では、エンドユーザーがQRコードを読み取った時点で即時取引が作られ、ユーザに対して受け取り確認画面は表示されません。
685
+ Cashtrayはワンタイムで、一度読み取りに成功するか、取引エラーになると失効します。
686
+ また、Cashtrayには有効期限があり、デフォルトでは30分で失効します。
687
+
688
+ <a name="create-cashtray"></a>
689
+ #### Cashtrayを作る
690
+ Cashtrayを作成します。
691
+
692
+ エンドユーザーに対して支払いまたはチャージを行う店舗の情報(店舗ユーザーIDとマネーID)と、取引金額が必須項目です。
693
+ 店舗ユーザーIDとマネーIDから店舗ウォレットを特定します。
283
694
 
284
- #### 新規エンドユーザー口座を追加する
695
+ その他に、Cashtrayから作られる取引に対する説明文や失効時間を指定できます。
285
696
 
286
697
  ```ruby
287
- response = client.send(Pokepay::Request::CreateCustomerAccount.new(
288
- "zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz", # マネーのID
289
- {
290
- "user_name" => "ポケペイ太郎", # ユーザー名 (任意)
291
- "account_name" => "ポケペイ太郎のアカウント" # アカウント名 (任意)
292
- }))
698
+ response = $client.send(Pokepay::Request::CreateCashtray.new(
699
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
700
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # shop_id: 店舗ユーザーID
701
+ 1828, # amount: 金額
702
+ description: "たい焼き(小倉)", # 取引履歴に表示する説明文
703
+ expires_in: 3161 # 失効時間(秒)
704
+ ))
293
705
  ```
294
706
 
295
- 成功したときは以下のプロパティを持つ `Pokepay::Response::AccountWithUser` のオブジェクトをレスポンスとして返します。
707
+ ---
708
+ `private_money_id`
709
+ 取引対象のマネーのIDです(必須項目)。
710
+
711
+ ---
712
+ `shop_id`
713
+ 店舗のユーザーIDです(必須項目)。
714
+
715
+ ---
716
+ `amount`
717
+ マネー額です(必須項目)。
718
+ 正の値を与えるとチャージになり、負の値を与えると支払いとなります。
719
+
720
+ ---
721
+ `description`
722
+ Cashtrayを読み取ったときに作られる取引の説明文です(最大200文字、任意項目)。
723
+ アプリや管理画面などの取引履歴に表示されます。デフォルトでは空文字になります。
724
+
725
+ ---
726
+ `expires_in`
727
+ Cashtrayが失効するまでの時間を秒単位で指定します(任意項目、デフォルト値は1800秒(30分))。
728
+
729
+ ---
730
+ 成功したときは[Cashtray](#cashtray)オブジェクトを返します
731
+ <a name="get-cashtray"></a>
732
+ #### Cashtrayの情報を取得する
733
+ Cashtrayの情報を取得します。
734
+
735
+ Cashtrayの現在の状態に加え、エンドユーザーのCashtray読み取りの試行結果、Cashtray読み取りによって作られた取引情報が取得できます。
736
+
737
+ レスポンス中の `attempt` には、このCashtrayをエンドユーザーが読み取った試行結果が入ります。
738
+ `account` はエンドユーザーのウォレット情報です。
739
+ 成功時には `attempt` 内の `status_code` に200が入ります。
740
+
741
+ まだCashtrayが読み取られていない場合は `attempt` の内容は `NULL` になります。
742
+ エンドユーザーのCashtray読み取りの際には、様々なエラーが起き得ます。
743
+ エラーの詳細は `attempt` 中の `error_type` と `error_message` にあります。主なエラー型と対応するステータスコードを以下に列挙します。
744
+
745
+ - `cashtray_already_proceed (422)`
746
+ - 既に処理済みのCashtrayをエンドユーザーが再び読み取ったときに返されます
747
+ - `cashtray_expired (422)`
748
+ - 読み取り時点でCashtray自体の有効期限が切れているときに返されます。Cashtrayが失効する時刻はレスポンス中の `expires_at` にあります
749
+ - `cashtray_already_canceled (422)`
750
+ - 読み取り時点でCashtrayが無効化されているときに返されます
751
+ - `account_balance_not_enough (422)`
752
+ - 支払い時に、エンドユーザーの残高が不足していて取引が完了できなかったときに返されます
753
+ - `account_balance_exceeded`
754
+ - チャージ時に、エンドユーザーのウォレット上限を超えて取引が完了できなかったときに返されます
755
+ - `account_transfer_limit_exceeded (422)`
756
+ - マネーに設定されている一度の取引金額の上限を超えたため、取引が完了できなかったときに返されます
757
+ - `account_not_found (422)`
758
+ - Cashtrayに設定されたマネーのウォレットをエンドユーザーが持っていなかったときに返されます
759
+
760
+
761
+ レスポンス中の `transaction` には、このCashtrayをエンドユーザーが読み取ることによって作られる取引データが入ります。まだCashtrayが読み取られていない場合は `NULL` になります。
762
+
763
+ 以上をまとめると、Cashtrayの状態は以下のようになります。
764
+
765
+ - エンドユーザーのCashtray読み取りによって取引が成功した場合
766
+ - レスポンス中の `attempt` と `transaction` にそれぞれ値が入ります
767
+ - 何らかの理由で取引が失敗した場合
768
+ - レスポンス中の `attempt` にエラー内容が入り、 `transaction` には `NULL` が入ります
769
+ - まだCashtrayが読み取られていない場合
770
+ - レスポンス中の `attempt` と `transaction` にそれぞれ `NULL` が入ります。Cashtrayの `expires_at` が現在時刻より前の場合は有効期限切れ状態です。
771
+
772
+ Cashtrayの取り得る全ての状態を擬似コードで記述すると以下のようになります。
773
+ ```
774
+ if (attempt == null) {
775
+ // 状態は未確定
776
+ if (canceled_at != null) {
777
+ // 無効化済み
778
+ } else if (expires_at < now) {
779
+ // 失効済み
780
+ } else {
781
+ // まだ有効で読み取られていない
782
+ }
783
+ } else if (transaction != null) {
784
+ // 取引成功確定。attempt で読み取ったユーザなどが分かる
785
+ } else {
786
+ // 取引失敗確定。attempt で失敗理由などが分かる
787
+ }
788
+ ```
789
+ ```ruby
790
+ response = $client.send(Pokepay::Request::GetCashtray.new(
791
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # cashtray_id: CashtrayのID
792
+ ))
793
+ ```
296
794
 
297
- - id (string): 口座ID
298
- - name (string): 口座名
299
- - isSuspended (bool): 口座が凍結されているかどうか
300
- - privateMoney (Response\PrivateMoney): 設定マネー情報
301
- - user (Response\User): ユーザーIDなどを含むユーザー情報
795
+ ---
796
+ `cashtray_id`
797
+ 情報を取得するCashtrayのIDです。
798
+
799
+ ---
800
+ 成功したときは[CashtrayWithResult](#cashtray-with-result)オブジェクトを返します
801
+ <a name="cancel-cashtray"></a>
802
+ #### Cashtrayを無効化する
803
+ Cashtrayを無効化します。
804
+
805
+ これにより、 `GetCashtray` のレスポンス中の `canceled_at` に無効化時点での現在時刻が入るようになります。
806
+ エンドユーザーが無効化されたQRコードを読み取ると `cashtray_already_canceled` エラーとなり、取引は失敗します。
807
+ ```ruby
808
+ response = $client.send(Pokepay::Request::CancelCashtray.new(
809
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # cashtray_id: CashtrayのID
810
+ ))
811
+ ```
302
812
 
303
- #### エンドユーザーの口座情報を表示する
813
+ ---
814
+ `cashtray_id`
815
+ 無効化するCashtrayのIDです。
304
816
 
817
+ ---
818
+ 成功したときは[Cashtray](#cashtray)オブジェクトを返します
819
+ <a name="update-cashtray"></a>
820
+ #### Cashtrayの情報を更新する
821
+ Cashtrayの内容を更新します。bodyパラメーターは全て省略可能で、指定したもののみ更新されます。
305
822
  ```ruby
306
- response = client.send(Pokepay::Request::GetAccount.new(
307
- "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # 口座ID
308
- ))
823
+ response = $client.send(Pokepay::Request::UpdateCashtray.new(
824
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # cashtray_id: CashtrayのID
825
+ amount: 987, # 金額
826
+ description: "たい焼き(小倉)", # 取引履歴に表示する説明文
827
+ expires_in: 5471 # 失効時間(秒)
828
+ ))
309
829
  ```
310
830
 
311
- 成功したときは以下のプロパティを持つ `Pokepay::Response::AccountDetail` のオブジェクトをレスポンスとして返します。
831
+ ---
832
+ `cashtray_id`
833
+ 更新対象のCashtrayのIDです。
834
+
835
+ ---
836
+ `amount`
837
+ マネー額です(任意項目)。
838
+ 正の値を与えるとチャージになり、負の値を与えると支払いとなります。
839
+
840
+ ---
841
+ `description`
842
+ Cashtrayを読み取ったときに作られる取引の説明文です(最大200文字、任意項目)。
843
+ アプリや管理画面などの取引履歴に表示されます。
844
+
845
+ ---
846
+ `expires_in`
847
+ Cashtrayが失効するまでの時間を秒で指定します(任意項目、デフォルト値は1800秒(30分))。
312
848
 
313
- - id (string): 口座ID
314
- - name (string): 口座名
315
- - isSuspended (bool): 口座が凍結されているかどうか
316
- - balance (double): 総残高
317
- - moneyBalance (double): 総マネー残高
318
- - pointBalance (double): 総ポイント残高
319
- - privateMoney (Response\PrivateMoney): 設定マネー情報
849
+ ---
850
+ 成功したときは[Cashtray](#cashtray)オブジェクトを返します
851
+ ### Customer
852
+ <a name="get-account"></a>
853
+ #### ウォレット情報を表示する
854
+ ウォレットを取得します。
855
+ ```ruby
856
+ response = $client.send(Pokepay::Request::GetAccount.new(
857
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # account_id: ウォレットID
858
+ ))
859
+ ```
320
860
 
861
+ ---
862
+ `account_id`
863
+ ウォレットIDです。
864
+
865
+ フィルターとして使われ、指定したウォレットIDのウォレットを取得します。
866
+
867
+ ---
868
+ 成功したときは[AccountDetail](#account-detail)オブジェクトを返します
869
+ <a name="update-account"></a>
870
+ #### ウォレット情報を更新する
871
+ ウォレットの状態を更新します。現在はウォレットの凍結/凍結解除の切り替えにのみ対応しています。
872
+ ```ruby
873
+ response = $client.send(Pokepay::Request::UpdateAccount.new(
874
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # account_id: ウォレットID
875
+ is_suspended: false # ウォレットが凍結されているかどうか
876
+ ))
877
+ ```
878
+
879
+ ---
880
+ `account_id`
881
+ ウォレットIDです。
882
+
883
+ 指定したウォレットIDのウォレットの状態を更新します。
884
+
885
+ ---
886
+ `is_suspended`
887
+ ウォレットの凍結状態です。真にするとウォレットが凍結され、そのウォレットでは新規取引ができなくなります。偽にすると凍結解除されます。
888
+
889
+ ---
890
+ 成功したときは[AccountDetail](#account-detail)オブジェクトを返します
891
+ <a name="list-account-balances"></a>
321
892
  #### エンドユーザーの残高内訳を表示する
893
+ エンドユーザーのウォレット毎の残高を有効期限別のリストとして取得します。
894
+ ```ruby
895
+ response = $client.send(Pokepay::Request::ListAccountBalances.new(
896
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # account_id: ウォレットID
897
+ page: 2948, # ページ番号
898
+ per_page: 4246, # 1ページ分の取引数
899
+ expires_at_from: "2024-04-18T03:31:49.000000+09:00", # 有効期限の期間によるフィルター(開始時点)
900
+ expires_at_to: "2019-01-11T07:51:31.000000+09:00", # 有効期限の期間によるフィルター(終了時点)
901
+ direction: "desc" # 有効期限によるソート順序
902
+ ))
903
+ ```
904
+
905
+ ---
906
+ `account_id`
907
+ ウォレットIDです。
908
+
909
+ フィルターとして使われ、指定したウォレットIDのウォレット残高を取得します。
910
+
911
+ ---
912
+ `page`
913
+ 取得したいページ番号です。デフォルト値は1です。
322
914
 
323
- エンドユーザーの残高は有効期限別のリストとして取得できます。
915
+ ---
916
+ `per_page`
917
+ 1ページ分のウォレット残高数です。デフォルト値は30です。
324
918
 
919
+ ---
920
+ `expires_at_from`
921
+ 有効期限の期間によるフィルターの開始時点のタイムスタンプです。デフォルトでは未指定です。
922
+
923
+ ---
924
+ `expires_at_to`
925
+ 有効期限の期間によるフィルターの終了時点のタイムスタンプです。デフォルトでは未指定です。
926
+
927
+ ---
928
+ `direction`
929
+ 有効期限によるソートの順序を指定します。デフォルト値はasc (昇順)です。
930
+
931
+ ---
932
+ 成功したときは[PaginatedAccountBalance](#paginated-account-balance)オブジェクトを返します
933
+ <a name="list-account-expired-balances"></a>
934
+ #### エンドユーザーの失効済みの残高内訳を表示する
935
+ エンドユーザーのウォレット毎の失効済みの残高を有効期限別のリストとして取得します。
325
936
  ```ruby
326
- response = client.send(Pokepay::Request::ListAccountBalances.new(
327
- "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # 口座ID
328
- ))
937
+ response = $client.send(Pokepay::Request::ListAccountExpiredBalances.new(
938
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # account_id: ウォレットID
939
+ page: 6863, # ページ番号
940
+ per_page: 6525, # 1ページ分の取引数
941
+ expires_at_from: "2022-09-24T18:44:02.000000+09:00", # 有効期限の期間によるフィルター(開始時点)
942
+ expires_at_to: "2017-07-29T15:03:56.000000+09:00", # 有効期限の期間によるフィルター(終了時点)
943
+ direction: "desc" # 有効期限によるソート順序
944
+ ))
329
945
  ```
330
946
 
331
- 成功したときは `Pokepay::Response::AccountBalance` を `rows` に含むページングオブジェクトを返します。
332
- 詳細は [ページング](#paging) を参照してください。
947
+ ---
948
+ `account_id`
949
+ ウォレットIDです。
333
950
 
334
- `Pokepay::Response::AccountBalance` のプロパティは以下の通りです。
951
+ フィルターとして使われ、指定したウォレットIDのウォレット残高を取得します。
335
952
 
336
- - expiresAt (DateTime): 失効日時
337
- - moneyAmount (double): マネー額
338
- - pointAmount (double): ポイント額
953
+ ---
954
+ `page`
955
+ 取得したいページ番号です。デフォルト値は1です。
339
956
 
340
- ### Organization
957
+ ---
958
+ `per_page`
959
+ 1ページ分のウォレット残高数です。デフォルト値は30です。
960
+
961
+ ---
962
+ `expires_at_from`
963
+ 有効期限の期間によるフィルターの開始時点のタイムスタンプです。デフォルトでは未指定です。
964
+
965
+ ---
966
+ `expires_at_to`
967
+ 有効期限の期間によるフィルターの終了時点のタイムスタンプです。デフォルトでは未指定です。
968
+
969
+ ---
970
+ `direction`
971
+ 有効期限によるソートの順序を指定します。デフォルト値はdesc (降順)です。
341
972
 
342
- #### 新規加盟店組織を追加する
973
+ ---
974
+ 成功したときは[PaginatedAccountBalance](#paginated-account-balance)オブジェクトを返します
975
+ <a name="create-customer-account"></a>
976
+ #### 新規エンドユーザーウォレットを追加する
977
+ 指定したマネーのウォレットを作成し、同時にそのウォレットを保有するユーザも作成します。
978
+ ```ruby
979
+ response = $client.send(Pokepay::Request::CreateCustomerAccount.new(
980
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
981
+ user_name: "ポケペイ太郎", # ユーザー名
982
+ account_name: "ポケペイ太郎のアカウント" # アカウント名
983
+ ))
984
+ ```
985
+
986
+ ---
987
+ `private_money_id`
988
+ マネーIDです。
989
+
990
+ これによって作成するウォレットのマネーを指定します。
343
991
 
992
+ ---
993
+ `user_name`
994
+ ウォレットと共に作成するユーザ名です。省略した場合は空文字となります。
995
+
996
+ ---
997
+ `account_name`
998
+ 作成するウォレット名です。省略した場合は空文字となります。
999
+
1000
+ ---
1001
+ 成功したときは[AccountWithUser](#account-with-user)オブジェクトを返します
1002
+ <a name="list-customer-transactions"></a>
1003
+ #### 取引履歴を取得する
1004
+ 取引一覧を返します。
344
1005
  ```ruby
345
- response = client.send(Pokepay::Request::CreateOrganization.new(
346
- "ox_supermarket", # 新規組織コード
347
- "oxスーパー", # 新規組織名
348
- "pay@xx-issuer-company.jp", # 発行体担当者メールアドレス
349
- "admin+pokepay@ox-supermarket.com", # 新規組織担当者メールアドレス
350
- {
351
- # 追加データ (すべて任意)
352
- "bank_name" => "XYZ銀行", # 銀行名
353
- "bank_code" => "999X", # 銀行金融機関コード
354
- "bank_branch_name" => "ABC支店", # 銀行支店名
355
- "bank_banch_code" => "99X", # 銀行支店コード
356
- "bank_account_type" => "saving", # 銀行口座種別 (普通=saving, 当座=current, その他=other)
357
- "bank_account" => "9999999", # 銀行口座番号
358
- "bank_account_holder_name" => "フクザワユキチ", # 口座名義人名
359
- }))
1006
+ response = $client.send(Pokepay::Request::ListCustomerTransactions.new(
1007
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
1008
+ sender_customer_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # 送金エンドユーザーID
1009
+ receiver_customer_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # 受取エンドユーザーID
1010
+ type: "L", # 取引種別、チャージ=topup、支払い=payment、個人間送金=transfer
1011
+ is_modified: true, # キャンセル済みかどうか
1012
+ from: "2017-03-01T02:18:01.000000+09:00", # 開始日時
1013
+ to: "2021-08-14T21:55:36.000000+09:00", # 終了日時
1014
+ page: 1, # ページ番号
1015
+ per_page: 50 # 1ページ分の取引数
1016
+ ))
360
1017
  ```
361
1018
 
362
- 成功したときには以下のプロパティを持つ `Pokepay::Response::Organization` のオブジェクトをレスポンスとして返します。
1019
+ ---
1020
+ `private_money_id`
1021
+ マネーIDです。
1022
+ フィルターとして使われ、指定したマネーでの取引のみ一覧に表示されます。
1023
+
1024
+ ---
1025
+ `sender_customer_id`
1026
+ 送金ユーザーIDです。
1027
+
1028
+ フィルターとして使われ、指定された送金ユーザーでの取引のみ一覧に表示されます。
1029
+
1030
+ ---
1031
+ `receiver_customer_id`
1032
+ 受取ユーザーIDです。
1033
+
1034
+ フィルターとして使われ、指定された受取ユーザーでの取引のみ一覧に表示されます。
1035
+
1036
+ ---
1037
+ `type`
1038
+ 取引の種類でフィルターします。
1039
+
1040
+ 以下の種類を指定できます。
1041
+
1042
+ 1. topup
1043
+ 店舗からエンドユーザーへの送金取引(チャージ)
1044
+ 2. payment
1045
+ エンドユーザーから店舗への送金取引(支払い)
1046
+ 3. exchange
1047
+ 他マネーへの流出(outflow)/他マネーからの流入(inflow)
1048
+ 4. transfer
1049
+ 個人間送金
1050
+
1051
+ ---
1052
+ `is_modified`
1053
+ キャンセル済みかどうかを判定するフラグです。
1054
+
1055
+ これにtrueを指定するとキャンセルされた取引のみ一覧に表示されます。
1056
+ falseを指定するとキャンセルされていない取引のみ一覧に表示されます
1057
+ 何も指定しなければキャンセルの有無にかかわらず一覧に表示されます。
1058
+
1059
+ ---
1060
+ `from`
1061
+ 抽出期間の開始日時です。
1062
+
1063
+ フィルターとして使われ、開始日時以降に発生した取引のみ一覧に表示されます。
1064
+
1065
+ ---
1066
+ `to`
1067
+ 抽出期間の終了日時です。
1068
+
1069
+ フィルターとして使われ、終了日時以前に発生した取引のみ一覧に表示されます。
363
1070
 
364
- - code (string): 組織コード
365
- - name (string): 組織名
1071
+ ---
1072
+ `page`
1073
+ 取得したいページ番号です。
366
1074
 
1075
+ ---
1076
+ `per_page`
1077
+ 1ページ分の取引数です。
1078
+
1079
+ ---
1080
+ 成功したときは[PaginatedTransaction](#paginated-transaction)オブジェクトを返します
1081
+ ### Organization
367
1082
  ### Shop
1083
+ <a name="list-shops"></a>
1084
+ #### 店舗一覧を取得する
1085
+ ```ruby
1086
+ response = $client.send(Pokepay::Request::ListShops.new(
1087
+ organization_code: "pocketchange", # 組織コード
1088
+ private_money_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # マネーID
1089
+ name: "oxスーパー三田店", # 店舗名
1090
+ postal_code: "624-0001", # 店舗の郵便番号
1091
+ address: "東京都港区芝...", # 店舗の住所
1092
+ tel: "077-41-284", # 店舗の電話番号
1093
+ email: "fAUj6MGuDC@QRgb.com", # 店舗のメールアドレス
1094
+ external_id: "h69IfOOqdFvcvTYHWhMSc2JtDSCuxpXIBKj", # 店舗の外部ID
1095
+ page: 1, # ページ番号
1096
+ per_page: 50 # 1ページ分の取引数
1097
+ ))
1098
+ ```
1099
+
1100
+ ---
1101
+ `organization_code`
1102
+ このパラメータを渡すとその組織の店舗のみが返され、省略すると加盟店も含む店舗が返されます。
1103
+
1104
+
1105
+ ---
1106
+ `private_money_id`
1107
+ このパラメータを渡すとそのマネーのウォレットを持つ店舗のみが返されます。
1108
+
1109
+
1110
+ ---
1111
+ `name`
1112
+ このパラメータを渡すとその名前の店舗のみが返されます。
1113
+
1114
+
1115
+ ---
1116
+ `postal_code`
1117
+ このパラメータを渡すとその郵便番号が登録された店舗のみが返されます。
1118
+
1119
+
1120
+ ---
1121
+ `address`
1122
+ このパラメータを渡すとその住所が登録された店舗のみが返されます。
368
1123
 
369
- #### 新規店舗を追加する
370
1124
 
1125
+ ---
1126
+ `tel`
1127
+ このパラメータを渡すとその電話番号が登録された店舗のみが返されます。
1128
+
1129
+
1130
+ ---
1131
+ `email`
1132
+ このパラメータを渡すとそのメールアドレスが登録された店舗のみが返されます。
1133
+
1134
+
1135
+ ---
1136
+ `external_id`
1137
+ このパラメータを渡すとその外部IDが登録された店舗のみが返されます。
1138
+
1139
+
1140
+ ---
1141
+ `page`
1142
+ 取得したいページ番号です。
1143
+
1144
+ ---
1145
+ `per_page`
1146
+ 1ページ分の取引数です。
1147
+
1148
+ ---
1149
+ 成功したときは[PaginatedShops](#paginated-shops)オブジェクトを返します
1150
+ <a name="create-shop"></a>
1151
+ #### 新規店舗を追加する(廃止予定)
1152
+ 新規店舗を追加します。このAPIは廃止予定です。以降は `CreateShopV2` を使用してください。
1153
+ ```ruby
1154
+ response = $client.send(Pokepay::Request::CreateShop.new(
1155
+ "oxスーパー三田店", # shop_name: 店舗名
1156
+ shop_postal_code: "8072594", # 店舗の郵便番号
1157
+ shop_address: "東京都港区芝...", # 店舗の住所
1158
+ shop_tel: "083-7936908", # 店舗の電話番号
1159
+ shop_email: "hctiEpL1Kl@L20S.com", # 店舗のメールアドレス
1160
+ shop_external_id: "Y28CEIpXvCz2lX0WFgkUTJYHHO", # 店舗の外部ID
1161
+ organization_code: "ox-supermarket" # 組織コード
1162
+ ))
1163
+ ```
1164
+ 成功したときは[User](#user)オブジェクトを返します
1165
+ <a name="create-shop-v"></a>
1166
+ #### 新規店舗を追加する
371
1167
  ```ruby
372
- response = client.send(Pokepay::Request::CreateShop.new(
373
- "OXスーパー三田店", # 店舗名
374
- {
375
- # 追加データ (すべて任意)
376
- "shop_postal_code" => "108-0014", # 店舗の郵便番号
377
- "shop_address" => "東京都港区芝...", # 店舗の住所
378
- "shop_tel" => "03-xxxx...", # 店舗の電話番号
379
- "shop_email" => "mita@ox-supermarket.com", # 店舗のメールアドレス
380
- "shop_external_id" => "mita0309", # 店舗の外部ID
381
- }))
1168
+ response = $client.send(Pokepay::Request::CreateShopV.new(
1169
+ "oxスーパー三田店", # name: 店舗名
1170
+ postal_code: "6626381", # 店舗の郵便番号
1171
+ address: "東京都港区芝...", # 店舗の住所
1172
+ tel: "05763334042", # 店舗の電話番号
1173
+ email: "jCOwyap0ls@b8d4.com", # 店舗のメールアドレス
1174
+ external_id: "Dc5yMU1TN0yX6wxY6IPoPyEr8klnc", # 店舗の外部ID
1175
+ organization_code: "ox-supermarket", # 組織コード
1176
+ private_money_ids: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], # 店舗で有効にするマネーIDの配列
1177
+ can_topup_private_money_ids: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"] # 店舗でチャージ可能にするマネーIDの配列
1178
+ ))
382
1179
  ```
383
1180
 
384
- 成功したときは以下のプロパティを持つ `Pokepay::Response::User` のオブジェクトをレスポンスとして返します。
1181
+ ---
1182
+ `name`
1183
+ 店舗名です。
385
1184
 
386
- - id (string): 店舗ID
387
- - name (string): 店舗名
388
- - isMerchant (bool): 店舗かどうかのフラグ (この場合は常に真)
1185
+ 同一組織内に同名の店舗があった場合は`name_conflict`エラーが返ります。
389
1186
 
390
- ### Private Money
1187
+ ---
1188
+ `private_money_ids`
1189
+ 店舗で有効にするマネーIDの配列を指定します。
391
1190
 
392
- #### 決済加盟店の取引サマリを取得する
1191
+ 店舗が所属する組織が発行または加盟しているマネーのみが指定できます。利用できないマネーが指定された場合は`unavailable_private_money`エラーが返ります。
1192
+ このパラメータを省略したときは、店舗が所属する組織が発行または加盟している全てのマネーのウォレットができます。
393
1193
 
1194
+ ---
1195
+ `can_topup_private_money_ids`
1196
+ 店舗でチャージ可能にするマネーIDの配列を指定します。
1197
+
1198
+ このパラメータは発行体のみが指定でき、自身が発行しているマネーのみを指定できます。加盟店が他発行体のマネーに加盟している場合でも、そのチャージ可否を変更することはできません。
1199
+ 省略したときは対象店舗のその発行体の全てのマネーのアカウントがチャージ不可となります。
1200
+
1201
+ ---
1202
+ 成功したときは[ShopWithAccounts](#shop-with-accounts)オブジェクトを返します
1203
+ <a name="get-shop"></a>
1204
+ #### 店舗情報を表示する
1205
+ 店舗情報を表示します。
1206
+
1207
+ 権限に関わらず自組織の店舗情報は表示可能です。それに加え、発行体は自組織の発行しているマネーの加盟店組織の店舗情報を表示できます。
394
1208
  ```ruby
395
- response = client.send(Pokepay::Request::GetPrivateMoneyOrganizationSummaries.new(
396
- "zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz", # マネーのID
397
- {
398
- # フィルタオプション (すべて任意)
399
- # 期間指定 (ISO8601形式の文字列、またはDateTimeオブジェクト)
400
- # fromとtoを指定する場合は同時に指定する必要あり。
401
- # デフォルトではfromは昨日0時、toは当日0時。
402
- "from" => "2019-01-01T00:00:00+09:00",
403
- "to" => "2019-07-31T18:13:39+09:00",
1209
+ response = $client.send(Pokepay::Request::GetShop.new(
1210
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # shop_id: 店舗ユーザーID
1211
+ ))
1212
+ ```
1213
+ 成功したときは[ShopWithAccounts](#shop-with-accounts)オブジェクトを返します
1214
+ <a name="update-shop"></a>
1215
+ #### 店舗情報を更新する
1216
+ 店舗情報を更新します。bodyパラメーターは全て省略可能で、指定したもののみ更新されます。
1217
+ ```ruby
1218
+ response = $client.send(Pokepay::Request::UpdateShop.new(
1219
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # shop_id: 店舗ユーザーID
1220
+ name: "oxスーパー三田店", # 店舗名
1221
+ postal_code: "5576227", # 店舗の郵便番号
1222
+ address: "東京都港区芝...", # 店舗の住所
1223
+ tel: "0904519142", # 店舗の電話番号
1224
+ email: "uyEzfF4ihE@MnqI.com", # 店舗のメールアドレス
1225
+ external_id: "LL8T5msTmgqj81R", # 店舗の外部ID
1226
+ private_money_ids: [], # 店舗で有効にするマネーIDの配列
1227
+ can_topup_private_money_ids: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"] # 店舗でチャージ可能にするマネーIDの配列
1228
+ ))
1229
+ ```
1230
+
1231
+ ---
1232
+ `name`
1233
+ 店舗名です。
1234
+
1235
+ 同一組織内に同名の店舗があった場合は`shop_name_conflict`エラーが返ります。
1236
+
1237
+ ---
1238
+ `postal_code`
1239
+ 店舗住所の郵便番号(7桁の数字)です。ハイフンは無視されます。明示的に空の値を設定するにはNULLを指定します。
1240
+
1241
+ ---
1242
+ `tel`
1243
+ 店舗の電話番号です。ハイフンは無視されます。明示的に空の値を設定するにはNULLを指定します。
1244
+
1245
+ ---
1246
+ `email`
1247
+ 店舗の連絡先メールアドレスです。明示的に空の値を設定するにはNULLを指定します。
1248
+
1249
+ ---
1250
+ `external_id`
1251
+ 店舗の外部IDです(最大36文字)。明示的に空の値を設定するにはNULLを指定します。
1252
+
1253
+ ---
1254
+ `private_money_ids`
1255
+ 店舗で有効にするマネーIDの配列を指定します。
1256
+
1257
+ 店舗が所属する組織が発行または加盟しているマネーのみが指定できます。利用できないマネーが指定された場合は`unavailable_private_money`エラーが返ります。
1258
+ 店舗が既にウォレットを持っている場合に、ここでそのウォレットのマネーIDを指定しないで更新すると、そのマネーのウォレットは凍結(無効化)されます。
404
1259
 
405
- # ページングオプション
406
- "page" => 1,
407
- "per_page" => 50
408
- }))
1260
+ ---
1261
+ `can_topup_private_money_ids`
1262
+ 店舗でチャージ可能にするマネーIDの配列を指定します。
1263
+
1264
+ このパラメータは発行体のみが指定でき、発行しているマネーのみを指定できます。加盟店が他発行体のマネーに加盟している場合でも、そのチャージ可否を変更することはできません。
1265
+ 省略したときは対象店舗のその発行体の全てのマネーのアカウントがチャージ不可となります。
1266
+
1267
+ ---
1268
+ 成功したときは[ShopWithAccounts](#shop-with-accounts)オブジェクトを返します
1269
+ ### Account
1270
+ <a name="list-user-accounts"></a>
1271
+ #### エンドユーザー、店舗ユーザーのウォレット一覧を表示する
1272
+ ユーザーIDを指定してそのユーザーのウォレット一覧を取得します。
1273
+ ```ruby
1274
+ response = $client.send(Pokepay::Request::ListUserAccounts.new(
1275
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # user_id: ユーザーID
1276
+ ))
409
1277
  ```
410
1278
 
411
- 成功したときは `Pokepay::Response::PrivateMoneyOrganizationSummary` を `rows` に含むページングオブジェクトを返します。
412
- 以下にプロパティを示します。
1279
+ ---
1280
+ `user_id`
1281
+ ユーザーIDです。
1282
+
1283
+ 指定したユーザーIDのウォレット一覧を取得します。パートナーキーと紐づく組織が発行しているマネーのウォレットのみが表示されます。
413
1284
 
414
- - organizationCode (string): 組織コード
415
- - topup (Response::OrganizationSummary): チャージのサマリ情報
416
- - payment (Response::OrganizationSummary): 支払いのサマリ情報
1285
+ ---
1286
+ 成功したときは[PaginatedAccounts](#paginated-accounts)オブジェクトを返します
1287
+ ### Private Money
1288
+ <a name="get-private-moneys"></a>
1289
+ #### マネー一覧を取得する
1290
+ マネーの一覧を取得します。
1291
+ パートナーキーの管理者が発行体組織に属している場合、自組織が加盟または発行しているマネーの一覧を返します。また、`organization_code`として決済加盟店の組織コードを指定した場合、発行マネーのうち、その決済加盟店組織が加盟しているマネーの一覧を返します。
1292
+ パートナーキーの管理者が決済加盟店組織に属している場合は、自組織が加盟しているマネーの一覧を返します。
1293
+ ```ruby
1294
+ response = $client.send(Pokepay::Request::GetPrivateMoneys.new(
1295
+ organization_code: "ox-supermarket", # 組織コード
1296
+ page: 1, # ページ番号
1297
+ per_page: 50 # 1ページ分の取得数
1298
+ ))
1299
+ ```
417
1300
 
418
- `Pokepay::Response::OrganizationSummary` のプロパティを以下に示します。
1301
+ ---
1302
+ `organization_code`
1303
+ パートナーキーの管理者が発行体組織に属している場合、発行マネーのうち、この組織コードで指定した決済加盟店組織が加盟しているマネーの一覧を返します。決済加盟店組織の管理者は自組織以外を指定することはできません。
419
1304
 
420
- - count (integer): 取引数
421
- - moneyAmount (double): 取引マネー総額
422
- - moneyCount (integer): マネー取引数
423
- - pointAmount (double): 取引ポイント総額
424
- - pointCount (integer): ポイント取引数
1305
+ ---
1306
+ 成功したときは[PaginatedPrivateMoneys](#paginated-private-moneys)オブジェクトを返します
1307
+ <a name="get-private-money-organization-summaries"></a>
1308
+ #### 決済加盟店の取引サマリを取得する
1309
+ ```ruby
1310
+ response = $client.send(Pokepay::Request::GetPrivateMoneyOrganizationSummaries.new(
1311
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
1312
+ from: "2017-03-23T12:47:17.000000+09:00", # 開始日時(toと同時に指定する必要有)
1313
+ to: "2024-06-20T02:27:27.000000+09:00", # 終了日時(fromと同時に指定する必要有)
1314
+ page: 1, # ページ番号
1315
+ per_page: 50 # 1ページ分の取引数
1316
+ ))
1317
+ ```
1318
+ `from`と`to`は同時に指定する必要があります。
1319
+
1320
+ 成功したときは[PaginatedPrivateMoneyOrganizationSummaries](#paginated-private-money-organization-summaries)オブジェクトを返します
1321
+ ### Bulk
1322
+ <a name="bulk-create-transaction"></a>
1323
+ #### CSVファイル一括取引
1324
+ CSVファイルから一括取引をします。
1325
+ ```ruby
1326
+ response = $client.send(Pokepay::Request::BulkCreateTransaction.new(
1327
+ "GFY2SrpQfm9Le0rSPWlrPa8fbLwdjVa", # name: 一括取引タスク名
1328
+ "9Jyd", # content: 取引する情報のCSV
1329
+ "pHqXjqW7D3uCGCdE3Z7gIcLSudPl4JIrQmLF", # request_id: リクエストID
1330
+ description: "JxcGB9NLriuIsMTYyCUoOEa9YZaUNPTMagDSPeHLGCGYvgqbqCIdoPTyGfjAlvbOwBRftL3mTfJhTjDs9c8QNUGv" # 一括取引の説明
1331
+ ))
1332
+ ```
425
1333
 
426
- ページングについての詳細は [ページング](#paging) を参照してください。
1334
+ ---
1335
+ `name`
1336
+ 一括取引タスクの管理用の名前です。
1337
+
1338
+ ---
1339
+ `description`
1340
+ 一括取引タスクの管理用の説明文です。
1341
+
1342
+ ---
1343
+ `content`
1344
+ 一括取引する情報を書いたCSVの文字列です。
1345
+ 1行目はヘッダ行で、2行目以降の各行にカンマ区切りの取引データを含みます。
1346
+ カラムは以下の7つです。任意のカラムには空文字を指定します。
1347
+
1348
+ - `type`: 取引種別
1349
+ - 必須。'topup' または 'payment'
1350
+ - `sender_id`: 送金ユーザーID
1351
+ - 必須。UUID
1352
+ - `receiver_id`: 受取ユーザーID
1353
+ - 必須。UUID
1354
+ - `private_money_id`: マネーID
1355
+ - 必須。UUID
1356
+ - `money_amount`: マネー額
1357
+ - 任意。ただし `point_amount` といずれかが必須。0以上の数字
1358
+ - `point_amount`: ポイント額
1359
+ - 任意。ただし `money_amount` といずれかが必須。0以上の数字
1360
+ - `description`: 取引の説明文
1361
+ - 任意。200文字以内。取引履歴に表示される文章
1362
+ - `bear_account_id`: ポイント負担ウォレットID
1363
+ - `point_amount` があるときは必須。UUID
1364
+ - `point_expires_at`: ポイントの有効期限
1365
+ - 任意。指定がないときはマネーに設定された有効期限を適用
1366
+
1367
+ ---
1368
+ `request_id`
1369
+ 重複したリクエストを判断するためのユニークID。ランダムな36字の文字列を生成して渡してください。
1370
+
1371
+ ---
1372
+ 成功したときは[BulkTransaction](#bulk-transaction)オブジェクトを返します
1373
+ ## Responses
1374
+
1375
+
1376
+ <a name="account-with-user"></a>
1377
+ ## AccountWithUser
1378
+ * `id (string)`:
1379
+ * `name (string)`:
1380
+ * `is_suspended (boolean)`:
1381
+ * `private_money (PrivateMoney)`:
1382
+ * `user (User)`:
1383
+
1384
+ `private_money`は [PrivateMoney](#private-money) オブジェクトを返します。
1385
+
1386
+ `user`は [User](#user) オブジェクトを返します。
1387
+
1388
+ <a name="account-detail"></a>
1389
+ ## AccountDetail
1390
+ * `id (string)`:
1391
+ * `name (string)`:
1392
+ * `is_suspended (boolean)`:
1393
+ * `balance (double)`:
1394
+ * `money_balance (double)`:
1395
+ * `point_balance (double)`:
1396
+ * `private_money (PrivateMoney)`:
1397
+
1398
+ `private_money`は [PrivateMoney](#private-money) オブジェクトを返します。
1399
+
1400
+ <a name="bill"></a>
1401
+ ## Bill
1402
+ * `id (string)`: 支払いQRコードのID
1403
+ * `amount (double)`: 支払い額
1404
+ * `max_amount (double)`: 支払い額を範囲指定した場合の上限
1405
+ * `min_amount (double)`: 支払い額を範囲指定した場合の下限
1406
+ * `description (string)`: 支払いQRコードの説明文(アプリ上で取引の説明文として表示される)
1407
+ * `account (AccountWithUser)`: 支払いQRコード発行ウォレット
1408
+ * `is_disabled (boolean)`: 無効化されているかどうか
1409
+ * `token (string)`: 支払いQRコードを解析したときに出てくるURL
1410
+
1411
+ `account`は [AccountWithUser](#account-with-user) オブジェクトを返します。
1412
+
1413
+ <a name="cashtray"></a>
1414
+ ## Cashtray
1415
+ * `id (string)`: Cashtray自体のIDです。
1416
+ * `amount (double)`: 取引金額
1417
+ * `description (string)`: Cashtrayの説明文
1418
+ * `account (AccountWithUser)`: 発行店舗のウォレット
1419
+ * `expires_at (string)`: Cashtrayの失効日時
1420
+ * `canceled_at (string)`: Cashtrayの無効化日時。NULLの場合は無効化されていません
1421
+ * `token (string)`: CashtrayのQRコードを解析したときに出てくるURL
1422
+
1423
+ `account`は [AccountWithUser](#account-with-user) オブジェクトを返します。
1424
+
1425
+ <a name="cashtray-with-result"></a>
1426
+ ## CashtrayWithResult
1427
+ * `id (string)`: CashtrayのID
1428
+ * `amount (double)`: 取引金額
1429
+ * `description (string)`: Cashtrayの説明文(アプリ上で取引の説明文として表示される)
1430
+ * `account (AccountWithUser)`: 発行店舗のウォレット
1431
+ * `expires_at (string)`: Cashtrayの失効日時
1432
+ * `canceled_at (string)`: Cashtrayの無効化日時。NULLの場合は無効化されていません
1433
+ * `token (string)`: CashtrayのQRコードを解析したときに出てくるURL
1434
+ * `attempt (CashtrayAttempt)`: Cashtray読み取り結果
1435
+ * `transaction (Transaction)`: 取引結果
1436
+
1437
+ `account`は [AccountWithUser](#account-with-user) オブジェクトを返します。
1438
+
1439
+ `attempt`は [CashtrayAttempt](#cashtray-attempt) オブジェクトを返します。
1440
+
1441
+ `transaction`は [Transaction](#transaction) オブジェクトを返します。
1442
+
1443
+ <a name="user"></a>
1444
+ ## User
1445
+ * `id (string)`: ユーザー (または店舗) ID
1446
+ * `name (string)`: ユーザー (または店舗) 名
1447
+ * `is_merchant (boolean)`: 店舗ユーザーかどうか
1448
+
1449
+ <a name="transaction"></a>
1450
+ ## Transaction
1451
+ * `id (string)`: 取引ID
1452
+ * `type (string)`: 取引種別 (チャージ=topup, 支払い=payment)
1453
+ * `is_modified (boolean)`: 返金された取引かどうか
1454
+ * `sender (User)`: 送金者情報
1455
+ * `sender_account (Account)`: 送金ウォレット情報
1456
+ * `receiver (User)`: 受取者情報
1457
+ * `receiver_account (Account)`: 受取ウォレット情報
1458
+ * `amount (double)`: 決済総額 (マネー額 + ポイント額)
1459
+ * `money_amount (double)`: 決済マネー額
1460
+ * `point_amount (double)`: 決済ポイント額
1461
+ * `done_at (string)`: 取引日時
1462
+ * `description (string)`: 取引説明文
1463
+
1464
+ `receiver`と`sender`は [User](#user) オブジェクトを返します。
1465
+
1466
+ `receiver_account`と`sender_account`は [Account](#account) オブジェクトを返します。
1467
+
1468
+ <a name="shop-with-accounts"></a>
1469
+ ## ShopWithAccounts
1470
+ * `id (string)`: 店舗ID
1471
+ * `name (string)`: 店舗名
1472
+ * `organization_code (string)`: 組織コード
1473
+ * `postal_code (string)`: 店舗の郵便番号
1474
+ * `address (string)`: 店舗の住所
1475
+ * `tel (string)`: 店舗の電話番号
1476
+ * `email (string)`: 店舗のメールアドレス
1477
+ * `external_id (string)`: 店舗の外部ID
1478
+ * `accounts (array of ShopAccounts)`:
1479
+
1480
+ `accounts`は [ShopAccount](#shop-account) オブジェクトの配列を返します。
1481
+
1482
+ <a name="bulk-transaction"></a>
1483
+ ## BulkTransaction
1484
+ * `id (string)`:
1485
+ * `request_id (string)`: リクエストID
1486
+ * `name (string)`: バルク取引管理用の名前
1487
+ * `description (string)`: バルク取引管理用の説明文
1488
+ * `status (string)`: バルク取引の状態
1489
+ * `error (string)`: バルク取引のエラー種別
1490
+ * `error_lineno (integer)`: バルク取引のエラーが発生した行番号
1491
+ * `submitted_at (string)`: バルク取引が登録された日時
1492
+ * `updated_at (string)`: バルク取引が更新された日時
1493
+
1494
+ <a name="paginated-private-money-organization-summaries"></a>
1495
+ ## PaginatedPrivateMoneyOrganizationSummaries
1496
+ * `rows (array of PrivateMoneyOrganizationSummaries)`:
1497
+ * `count (integer)`:
1498
+ * `pagination (Pagination)`:
1499
+
1500
+ `rows`は [PrivateMoneyOrganizationSummary](#private-money-organization-summary) オブジェクトの配列を返します。
1501
+
1502
+ `pagination`は [Pagination](#pagination) オブジェクトを返します。
1503
+
1504
+ <a name="paginated-transaction"></a>
1505
+ ## PaginatedTransaction
1506
+ * `rows (array of Transactions)`:
1507
+ * `count (integer)`:
1508
+ * `pagination (Pagination)`:
1509
+
1510
+ `rows`は [Transaction](#transaction) オブジェクトの配列を返します。
1511
+
1512
+ `pagination`は [Pagination](#pagination) オブジェクトを返します。
1513
+
1514
+ <a name="paginated-transfers"></a>
1515
+ ## PaginatedTransfers
1516
+ * `rows (array of Transfers)`:
1517
+ * `count (integer)`:
1518
+ * `pagination (Pagination)`:
1519
+
1520
+ `rows`は [Transfer](#transfer) オブジェクトの配列を返します。
1521
+
1522
+ `pagination`は [Pagination](#pagination) オブジェクトを返します。
1523
+
1524
+ <a name="paginated-accounts"></a>
1525
+ ## PaginatedAccounts
1526
+ * `rows (array of Accounts)`:
1527
+ * `count (integer)`:
1528
+ * `pagination (Pagination)`:
1529
+
1530
+ `rows`は [Account](#account) オブジェクトの配列を返します。
1531
+
1532
+ `pagination`は [Pagination](#pagination) オブジェクトを返します。
1533
+
1534
+ <a name="paginated-account-balance"></a>
1535
+ ## PaginatedAccountBalance
1536
+ * `rows (array of AccountBalances)`:
1537
+ * `count (integer)`:
1538
+ * `pagination (Pagination)`:
1539
+
1540
+ `rows`は [AccountBalance](#account-balance) オブジェクトの配列を返します。
1541
+
1542
+ `pagination`は [Pagination](#pagination) オブジェクトを返します。
1543
+
1544
+ <a name="paginated-shops"></a>
1545
+ ## PaginatedShops
1546
+ * `rows (array of ShopWithMetadatas)`:
1547
+ * `count (integer)`:
1548
+ * `pagination (Pagination)`:
1549
+
1550
+ `rows`は [ShopWithMetadata](#shop-with-metadata) オブジェクトの配列を返します。
1551
+
1552
+ `pagination`は [Pagination](#pagination) オブジェクトを返します。
1553
+
1554
+ <a name="paginated-bills"></a>
1555
+ ## PaginatedBills
1556
+ * `rows (array of Bills)`:
1557
+ * `count (integer)`:
1558
+ * `pagination (Pagination)`:
1559
+
1560
+ `rows`は [Bill](#bill) オブジェクトの配列を返します。
1561
+
1562
+ `pagination`は [Pagination](#pagination) オブジェクトを返します。
1563
+
1564
+ <a name="paginated-private-moneys"></a>
1565
+ ## PaginatedPrivateMoneys
1566
+ * `rows (array of PrivateMoneys)`:
1567
+ * `count (integer)`:
1568
+ * `pagination (Pagination)`:
1569
+
1570
+ `rows`は [PrivateMoney](#private-money) オブジェクトの配列を返します。
1571
+
1572
+ `pagination`は [Pagination](#pagination) オブジェクトを返します。
1573
+
1574
+ <a name="private-money"></a>
1575
+ ## PrivateMoney
1576
+ * `id (string)`: マネーID
1577
+ * `name (string)`: マネー名
1578
+ * `unit (string)`: マネー単位 (例: 円)
1579
+ * `is_exclusive (boolean)`: 会員制のマネーかどうか
1580
+ * `description (string)`: マネー説明文
1581
+ * `oneline_message (string)`: マネーの要約
1582
+ * `organization (Organization)`: マネーを発行した組織
1583
+ * `max_balance (double)`: ウォレットの上限金額
1584
+ * `transfer_limit (double)`: マネーの取引上限額
1585
+ * `type (string)`: マネー種別 (自家型=own, 第三者型=third-party)
1586
+ * `expiration_type (string)`: 有効期限種別 (チャージ日起算=static, 最終利用日起算=last-update, 最終チャージ日起算=last-topup-update)
1587
+ * `enable_topup_by_member (boolean)`: 加盟店によるチャージが有効かどうか
1588
+
1589
+ `organization`は [Organization](#organization) オブジェクトを返します。
1590
+
1591
+ <a name="cashtray-attempt"></a>
1592
+ ## CashtrayAttempt
1593
+ * `account (AccountWithUser)`: エンドユーザーのウォレット
1594
+ * `status_code (double)`: ステータスコード
1595
+ * `error_type (string)`: エラー型
1596
+ * `error_message (string)`: エラーメッセージ
1597
+ * `created_at (string)`: Cashtray読み取り記録の作成日時
1598
+
1599
+ `account`は [AccountWithUser](#account-with-user) オブジェクトを返します。
1600
+
1601
+ <a name="account"></a>
1602
+ ## Account
1603
+ * `id (string)`: ウォレットID
1604
+ * `name (string)`: ウォレット名
1605
+ * `is_suspended (boolean)`: ウォレットが凍結されているかどうか
1606
+ * `private_money (PrivateMoney)`: 設定マネー情報
1607
+
1608
+ `private_money`は [PrivateMoney](#private-money) オブジェクトを返します。
1609
+
1610
+ <a name="shop-account"></a>
1611
+ ## ShopAccount
1612
+ * `id (string)`: ウォレットID
1613
+ * `name (string)`: ウォレット名
1614
+ * `is_suspended (boolean)`: ウォレットが凍結されているかどうか
1615
+ * `can_transfer_topup (boolean)`: チャージ可能かどうか
1616
+ * `private_money (PrivateMoney)`: 設定マネー情報
1617
+
1618
+ `private_money`は [PrivateMoney](#private-money) オブジェクトを返します。
1619
+
1620
+ <a name="private-money-organization-summary"></a>
1621
+ ## PrivateMoneyOrganizationSummary
1622
+ * `organization_code (string)`:
1623
+ * `topup (OrganizationSummary)`:
1624
+ * `payment (OrganizationSummary)`:
1625
+
1626
+ `payment`と`topup`は [OrganizationSummary](#organization-summary) オブジェクトを返します。
1627
+
1628
+ <a name="pagination"></a>
1629
+ ## Pagination
1630
+ * `current (integer)`:
1631
+ * `per_page (integer)`:
1632
+ * `max_page (integer)`:
1633
+ * `has_prev (boolean)`:
1634
+ * `has_next (boolean)`:
1635
+
1636
+ <a name="transfer"></a>
1637
+ ## Transfer
1638
+ * `id (string)`:
1639
+ * `sender_account (AccountWithoutPrivateMoneyDetail)`:
1640
+ * `receiver_account (AccountWithoutPrivateMoneyDetail)`:
1641
+ * `amount (double)`:
1642
+ * `money_amount (double)`:
1643
+ * `point_amount (double)`:
1644
+ * `done_at (string)`:
1645
+ * `type (string)`:
1646
+ * `description (string)`:
1647
+ * `transaction_id (string)`:
1648
+
1649
+ `receiver_account`と`sender_account`は [AccountWithoutPrivateMoneyDetail](#account-without-private-money-detail) オブジェクトを返します。
1650
+
1651
+ <a name="account-balance"></a>
1652
+ ## AccountBalance
1653
+ * `expires_at (string)`:
1654
+ * `money_amount (double)`:
1655
+ * `point_amount (double)`:
1656
+
1657
+ <a name="shop-with-metadata"></a>
1658
+ ## ShopWithMetadata
1659
+ * `id (string)`: 店舗ID
1660
+ * `name (string)`: 店舗名
1661
+ * `organization_code (string)`: 組織コード
1662
+ * `postal_code (string)`: 店舗の郵便番号
1663
+ * `address (string)`: 店舗の住所
1664
+ * `tel (string)`: 店舗の電話番号
1665
+ * `email (string)`: 店舗のメールアドレス
1666
+ * `external_id (string)`: 店舗の外部ID