pokepay_partner_ruby_sdk 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/docs/index.md +548 -209
- data/lib/pokepay_partner_ruby_sdk.rb +8 -0
- data/lib/pokepay_partner_ruby_sdk/request/create_transfer_transaction.rb +18 -0
- data/lib/pokepay_partner_ruby_sdk/request/list_bills.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/list_shops.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/list_user_accounts.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/response/bill.rb +24 -0
- data/lib/pokepay_partner_ruby_sdk/response/paginated_accounts.rb +16 -0
- data/lib/pokepay_partner_ruby_sdk/response/paginated_bills.rb +16 -0
- data/lib/pokepay_partner_ruby_sdk/response/paginated_shops.rb +16 -0
- data/lib/pokepay_partner_ruby_sdk/version.rb +1 -1
- data/partner.yaml +361 -3
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5354d8343e918d7d6918a30d5616d3d3af32dfb225a63430a87b439b992bb591
|
4
|
+
data.tar.gz: 11287914f04797d6efb7f32b00b8a231063eb072c690690a354e79cc49e75750
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79786b8b53e12dd1d064e018a17d12ea973b01428520a751f4632fb0babcc40ff234799204a524b2eb41804345b6d2c3726e4cbb0272806a161c9bebd95bd1f5
|
7
|
+
data.tar.gz: 7ec5ccca95604a37fdd5cc71b40d5d9297d1deb0ef8786768ec5993edc42ce8e60b72356352374883e45e0be06b80dd9fb8c46f624b597557a20e3219151e5d7
|
data/Gemfile.lock
CHANGED
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,627 @@ 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
|
|
147
145
|
### Transaction
|
148
146
|
|
149
|
-
<a name="get-transaction"></a>
|
150
147
|
#### 取引情報を取得する
|
151
|
-
|
148
|
+
取引を取得します。
|
152
149
|
```ruby
|
153
|
-
response = client.send(Pokepay::Request::GetTransaction.new(
|
154
|
-
|
155
|
-
|
156
|
-
|
150
|
+
response = $client.send(Pokepay::Request::GetTransaction.new(
|
151
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" // transaction_id: 取引ID
|
152
|
+
))
|
157
153
|
```
|
158
154
|
|
159
|
-
|
160
|
-
|
161
|
-
|
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): 取引説明文
|
173
|
-
|
174
|
-
`sender` と `receiver` は `Pokepay::Response::User` のオブジェクトです。 以下にプロパティを示します。
|
175
|
-
|
176
|
-
- id (String): ユーザー (または店舗) ID
|
177
|
-
- name (String): ユーザー (または店舗) 名
|
178
|
-
- is_merchant (真理値): 店舗ユーザーかどうか
|
179
|
-
|
180
|
-
`senderAccount` と `receiverAccount` は `Pokepay::Response::Account` のオブジェクトです。以下にプロパティを示します。
|
181
|
-
|
182
|
-
- id (String): 口座ID
|
183
|
-
- name (String): 口座名
|
184
|
-
- is_suspended (真理値): 口座が凍結されているかどうか
|
185
|
-
- private_money (Pokepay::Response::PrivateMoney): 設定マネー情報
|
186
|
-
|
187
|
-
`privateMoney` は `Pokepay::Response::PrivateMoney` のオブジェクトです。以下にプロパティを示します。
|
188
|
-
|
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)
|
155
|
+
---
|
156
|
+
`transaction_id`
|
157
|
+
取引IDです。
|
198
158
|
|
199
|
-
|
159
|
+
フィルターとして使われ、指定した取引IDの取引を取得します。
|
160
|
+
|
161
|
+
---
|
162
|
+
成功したときは[Transaction](#transaction)オブジェクトを返します
|
200
163
|
|
164
|
+
#### チャージする
|
165
|
+
チャージ取引を作成します。
|
201
166
|
```ruby
|
202
|
-
response = client.send(Pokepay::Request::CreateTopupTransaction.new(
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
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: 8555, // マネー額
|
173
|
+
point_amount: 2302, // ポイント額
|
174
|
+
description: "初夏のチャージキャンペーン" // 取引履歴に表示する説明文
|
175
|
+
))
|
211
176
|
```
|
212
177
|
|
213
|
-
|
214
|
-
|
178
|
+
---
|
179
|
+
`shop_id`
|
180
|
+
店舗IDです。
|
181
|
+
|
182
|
+
送金元の店舗を指定します。
|
183
|
+
|
184
|
+
---
|
185
|
+
`customer_id`
|
186
|
+
エンドユーザーIDです。
|
187
|
+
|
188
|
+
送金先のエンドユーザーを指定します。
|
189
|
+
|
190
|
+
---
|
191
|
+
`private_money_id`
|
192
|
+
マネーIDです。
|
193
|
+
|
194
|
+
マネーを指定します。
|
195
|
+
|
196
|
+
---
|
197
|
+
`bear_point_shop_id`
|
198
|
+
ポイント支払時の負担店舗IDです。
|
199
|
+
|
200
|
+
ポイント支払い時に実際お金を負担する店舗を指定します。
|
201
|
+
|
202
|
+
---
|
203
|
+
`money_amount`
|
204
|
+
マネー額です。
|
205
|
+
|
206
|
+
送金するマネー額を指定します。
|
207
|
+
|
208
|
+
---
|
209
|
+
`point_amount`
|
210
|
+
ポイント額です。
|
211
|
+
|
212
|
+
送金するポイント額を指定します。
|
213
|
+
|
214
|
+
---
|
215
|
+
`description`
|
216
|
+
取引説明文です。
|
217
|
+
|
218
|
+
任意入力で、取引履歴に表示される説明文です。
|
219
|
+
|
220
|
+
---
|
221
|
+
成功したときは[Transaction](#transaction)オブジェクトを返します
|
215
222
|
|
216
223
|
#### 支払いする
|
224
|
+
支払取引を作成します。
|
225
|
+
支払い時には、エンドユーザーの残高のうち、ポイント残高から優先的に消費されます。
|
217
226
|
|
218
227
|
```ruby
|
219
|
-
response = client.send(Pokepay::Request::CreatePaymentTransaction.new(
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
}))
|
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
|
+
6077, // amount: 支払い額
|
233
|
+
description: "たい焼き(小倉)" // 取引履歴に表示する説明文
|
234
|
+
))
|
227
235
|
```
|
228
236
|
|
229
|
-
|
230
|
-
|
237
|
+
---
|
238
|
+
`shop_id`
|
239
|
+
店舗IDです。
|
231
240
|
|
232
|
-
|
241
|
+
送金先の店舗を指定します。
|
233
242
|
|
234
|
-
|
243
|
+
---
|
244
|
+
`customer_id`
|
245
|
+
エンドユーザーIDです。
|
235
246
|
|
236
|
-
|
247
|
+
送金元のエンドユーザーを指定します。
|
248
|
+
|
249
|
+
---
|
250
|
+
`private_money_id`
|
251
|
+
マネーIDです。
|
252
|
+
|
253
|
+
マネーを指定します。
|
237
254
|
|
238
|
-
|
239
|
-
|
255
|
+
---
|
256
|
+
`amount`
|
257
|
+
マネー額です。
|
240
258
|
|
259
|
+
送金するマネー額を指定します。
|
260
|
+
|
261
|
+
---
|
262
|
+
`description`
|
263
|
+
取引説明文です。
|
264
|
+
|
265
|
+
任意入力で、取引履歴に表示される説明文です。
|
266
|
+
|
267
|
+
---
|
268
|
+
成功したときは[Transaction](#transaction)オブジェクトを返します
|
269
|
+
|
270
|
+
#### 取引履歴を取得する
|
271
|
+
取引一覧を返します。
|
241
272
|
```ruby
|
242
|
-
response = client.send(Pokepay::Request::
|
243
|
-
|
244
|
-
|
245
|
-
|
273
|
+
response = $client.send(Pokepay::Request::ListTransactions.new(
|
274
|
+
from: "2021-04-20T20:55:06.000000+09:00", // 開始日時
|
275
|
+
to: "2021-12-08T08:10:34.000000+09:00", // 終了日時
|
276
|
+
page: 1, // ページ番号
|
277
|
+
per_page: 50, // 1ページ分の取引数
|
278
|
+
shop_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // 店舗ID
|
279
|
+
customer_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // エンドユーザーID
|
280
|
+
customer_name: "太郎", // エンドユーザー名
|
281
|
+
terminal_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // 端末ID
|
282
|
+
transaction_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // 取引ID
|
283
|
+
organization_code: "pocketchange", // 組織コード
|
284
|
+
private_money_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // マネーID
|
285
|
+
is_modified: true, // キャンセルフラグ
|
286
|
+
types: ["topup", "payment"] // 取引種別 (複数指定可)、チャージ=topup、支払い=payment
|
287
|
+
))
|
246
288
|
```
|
247
289
|
|
248
|
-
|
249
|
-
|
290
|
+
---
|
291
|
+
`from`
|
292
|
+
抽出期間の開始日時です。
|
250
293
|
|
251
|
-
|
294
|
+
フィルターとして使われ、開始日時以降に発生した取引のみ一覧に表示されます。
|
295
|
+
|
296
|
+
---
|
297
|
+
`to`
|
298
|
+
抽出期間の終了日時です。
|
299
|
+
|
300
|
+
フィルターとして使われ、終了日時以前に発生した取引のみ一覧に表示されます。
|
301
|
+
|
302
|
+
---
|
303
|
+
`page`
|
304
|
+
取得したいページ番号です。
|
305
|
+
|
306
|
+
---
|
307
|
+
`per_page`
|
308
|
+
1ページ分の取引数です。
|
309
|
+
|
310
|
+
---
|
311
|
+
`shop_id`
|
312
|
+
店舗IDです。
|
313
|
+
|
314
|
+
フィルターとして使われ、指定された店舗での取引のみ一覧に表示されます。
|
315
|
+
|
316
|
+
---
|
317
|
+
`customer_id`
|
318
|
+
エンドユーザーIDです。
|
319
|
+
|
320
|
+
フィルターとして使われ、指定されたエンドユーザーでの取引のみ一覧に表示されます。
|
321
|
+
|
322
|
+
---
|
323
|
+
`customer_name`
|
324
|
+
エンドユーザー名です。
|
325
|
+
|
326
|
+
フィルターとして使われ、入力された名前に部分一致するエンドユーザーでの取引のみ一覧に表示されます。
|
327
|
+
|
328
|
+
---
|
329
|
+
`terminal_id`
|
330
|
+
端末IDです。
|
331
|
+
|
332
|
+
フィルターとして使われ、指定された端末での取引のみ一覧に表示されます。
|
333
|
+
|
334
|
+
---
|
335
|
+
`transaction_id`
|
336
|
+
取引IDです。
|
337
|
+
|
338
|
+
フィルターとして使われ、指定された取引のみ一覧に表示されます。
|
339
|
+
|
340
|
+
---
|
341
|
+
`organization_code`
|
342
|
+
組織コードです。
|
343
|
+
|
344
|
+
フィルターとして使われ、指定された組織での取引のみ一覧に表示されます。
|
345
|
+
|
346
|
+
---
|
347
|
+
`private_money_id`
|
348
|
+
マネーIDです。
|
252
349
|
|
350
|
+
フィルターとして使われ、指定したマネーでの取引のみ一覧に表示されます。
|
351
|
+
|
352
|
+
---
|
353
|
+
`is_modified`
|
354
|
+
キャンセルフラグです。
|
355
|
+
|
356
|
+
これにtrueを指定するとキャンセルされた取引のみ一覧に表示されます。
|
357
|
+
デフォルト値はfalseで、キャンセルの有無にかかわらず一覧に表示されます。
|
358
|
+
|
359
|
+
---
|
360
|
+
`types`
|
361
|
+
取引の種類でフィルターします。
|
362
|
+
|
363
|
+
以下の種類を指定できます。
|
364
|
+
|
365
|
+
1. topup
|
366
|
+
店舗からエンドユーザーへの送金取引(チャージ)
|
367
|
+
|
368
|
+
2. payment
|
369
|
+
エンドユーザーから店舗への送金取引(支払い)
|
370
|
+
|
371
|
+
3. exchange-outflow
|
372
|
+
他マネーへの流出
|
373
|
+
|
374
|
+
4. exchange-inflow
|
375
|
+
他マネーからの流入
|
376
|
+
|
377
|
+
---
|
378
|
+
成功したときは[PaginatedTransaction](#paginated-transaction)オブジェクトを返します
|
379
|
+
|
380
|
+
#### 返金する
|
253
381
|
```ruby
|
254
|
-
response = client.send(Pokepay::Request::
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
"per_page" => 50,
|
259
|
-
|
260
|
-
# フィルタオプション (すべて任意)
|
261
|
-
# 期間指定 (ISO8601形式の文字列)
|
262
|
-
"from" => "2019-01-01T00:00:00+09:00",
|
263
|
-
"to" => "2019-07-30T18:13:39+09:00",
|
264
|
-
|
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
|
-
}))
|
382
|
+
response = $client.send(Pokepay::Request::RefundTransaction.new(
|
383
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // transaction_id: 取引ID
|
384
|
+
description: "返品対応のため" // 取引履歴に表示する返金事由
|
385
|
+
))
|
277
386
|
```
|
387
|
+
成功したときは[Transfer](#transfer)オブジェクトを返します
|
278
388
|
|
279
|
-
|
280
|
-
詳細は [ページング](#paging) を参照してください。
|
389
|
+
### チャージQRコード
|
281
390
|
|
282
|
-
|
391
|
+
店舗ユーザが発行し、エンドユーザがポケペイアプリから読み取ることでチャージ取引が発生するQRコードです。
|
283
392
|
|
284
|
-
|
393
|
+
チャージQRコードを解析すると次のようなURLになります(URLは環境によって異なります)。
|
285
394
|
|
395
|
+
`https://www-sandbox.pokepay.jp/checks/xxxxxxxx-xxxx-xxxxxxxxx-xxxxxxxxxxxx`
|
396
|
+
|
397
|
+
QRコードを読み取る方法以外にも、このURLリンクを直接スマートフォン(iOS/Android)上で開くことによりアプリが起動して取引が行われます。(注意: 上記URLはsandbox環境であるため、アプリもsandbox環境のものである必要があります) 上記URL中の `xxxxxxxx-xxxx-xxxxxxxxx-xxxxxxxxxxxx` の部分がチャージQRコードのIDです。
|
398
|
+
|
399
|
+
#### チャージQRコードの発行
|
286
400
|
```ruby
|
287
|
-
response = client.send(Pokepay::Request::
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
401
|
+
response = $client.send(Pokepay::Request::CreateCheck.new(
|
402
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // account_id: 送金元の店舗アカウントID
|
403
|
+
money_amount: 5032, // 付与マネー額
|
404
|
+
point_amount: 1995, // 付与ポイント額
|
405
|
+
description: "test check", // 説明文(アプリ上で取引の説明文として表示される)
|
406
|
+
is_onetime: false, // ワンタイムかどうか。真の場合1度読み込まれた時点でそのチャージQRは失効する(デフォルト値は真)
|
407
|
+
usage_limit: 219, // ワンタイムでない場合、複数ユーザから読み取られ得る。その場合の最大読み取り回数
|
408
|
+
expires_at: "2024-10-18T00:20:49.000000+09:00", // チャージQR自体の失効日時
|
409
|
+
point_expires_at: "2019-07-04T01:50:46.000000+09:00", // チャージQRによって付与されるポイントの失効日時
|
410
|
+
point_expires_in_days: 60, // チャージQRによって付与されるポイントの有効期限(相対指定、単位は日)
|
411
|
+
bear_point_account: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" // ポイント額を負担する店舗アカウントのID
|
412
|
+
))
|
293
413
|
```
|
414
|
+
`money_amount`と`point_amount`の少なくとも一方は指定する必要があります。
|
415
|
+
|
416
|
+
|
417
|
+
---
|
418
|
+
`is_onetime`
|
419
|
+
チャージQRコードが一度の読み取りで失効するときに`true`にします。デフォルト値は`true`です。
|
420
|
+
`false`の場合、そのチャージQRコードは1ユーザについては1回きりですが、複数ユーザによって読み取り可能なQRコードになります。
|
421
|
+
|
422
|
+
|
423
|
+
---
|
424
|
+
`usage_limit`
|
425
|
+
複数ユーザによって読み取り可能なチャージQRコードの読み取り回数に制限をつけるために指定します。
|
426
|
+
省略すると無制限に読み取り可能なチャージQRコードになります。
|
427
|
+
チャージQRコードは管理画面からいつでも無効化(有効化)することができます。
|
294
428
|
|
295
|
-
成功したときは以下のプロパティを持つ `Pokepay::Response::AccountWithUser` のオブジェクトをレスポンスとして返します。
|
296
429
|
|
297
|
-
|
298
|
-
|
299
|
-
- isSuspended (bool): 口座が凍結されているかどうか
|
300
|
-
- privateMoney (Response\PrivateMoney): 設定マネー情報
|
301
|
-
- user (Response\User): ユーザーIDなどを含むユーザー情報
|
430
|
+
---
|
431
|
+
成功したときは[Check](#check)オブジェクトを返します
|
302
432
|
|
303
|
-
####
|
433
|
+
#### チャージQRコードを読み取ることでチャージする
|
434
|
+
通常チャージQRコードはエンドユーザのアプリによって読み取られ、アプリとポケペイサーバとの直接通信によって取引が作られます。 もしエンドユーザとの通信をパートナーのサーバのみに限定したい場合、パートナーのサーバがチャージQRの情報をエンドユーザから代理受けして、サーバ間連携APIによって実際のチャージ取引をリクエストすることになります。
|
435
|
+
|
436
|
+
エンドユーザから受け取ったチャージ用QRコードのIDをエンドユーザIDと共に渡すことでチャージ取引が作られます。
|
304
437
|
|
305
438
|
```ruby
|
306
|
-
response = client.send(Pokepay::Request::
|
307
|
-
|
308
|
-
|
439
|
+
response = $client.send(Pokepay::Request::CreateTopupTransactionWithCheck.new(
|
440
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // check_id: チャージ用QRコードのID
|
441
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" // customer_id: エンドユーザーのID
|
442
|
+
))
|
309
443
|
```
|
310
444
|
|
311
|
-
|
445
|
+
---
|
446
|
+
`check_id`
|
447
|
+
チャージ用QRコードのIDです。
|
312
448
|
|
313
|
-
|
314
|
-
- name (string): 口座名
|
315
|
-
- isSuspended (bool): 口座が凍結されているかどうか
|
316
|
-
- balance (double): 総残高
|
317
|
-
- moneyBalance (double): 総マネー残高
|
318
|
-
- pointBalance (double): 総ポイント残高
|
319
|
-
- privateMoney (Response\PrivateMoney): 設定マネー情報
|
449
|
+
QRコード生成時に送金元店舗のウォレット情報や、送金額などが登録されています。
|
320
450
|
|
321
|
-
|
451
|
+
---
|
452
|
+
`customer_id`
|
453
|
+
エンドユーザーIDです。
|
322
454
|
|
323
|
-
|
455
|
+
送金先のエンドユーザーを指定します。
|
456
|
+
|
457
|
+
---
|
458
|
+
成功したときは[Transaction](#transaction)オブジェクトを返します
|
459
|
+
|
460
|
+
### Customer
|
324
461
|
|
462
|
+
#### 新規エンドユーザーウォレットを追加する
|
463
|
+
指定したマネーのウォレットを作成し、同時にそのウォレットを保有するユーザも作成します。
|
325
464
|
```ruby
|
326
|
-
response = client.send(Pokepay::Request::
|
327
|
-
|
328
|
-
|
465
|
+
response = $client.send(Pokepay::Request::CreateCustomerAccount.new(
|
466
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // private_money_id: マネーID
|
467
|
+
user_name: "ポケペイ太郎", // ユーザー名
|
468
|
+
account_name: "ポケペイ太郎のアカウント" // アカウント名
|
469
|
+
))
|
329
470
|
```
|
330
471
|
|
331
|
-
|
332
|
-
|
472
|
+
---
|
473
|
+
`private_money_id`
|
474
|
+
マネーIDです。
|
333
475
|
|
334
|
-
|
476
|
+
これによって作成するウォレットのマネーを指定します。
|
335
477
|
|
336
|
-
|
337
|
-
|
338
|
-
|
478
|
+
---
|
479
|
+
`user_name`
|
480
|
+
ウォレットと共に作成するユーザ名です。省略した場合は空文字となります。
|
339
481
|
|
340
|
-
|
482
|
+
---
|
483
|
+
`account_name`
|
484
|
+
作成するウォレット名です。省略した場合は空文字となります。
|
341
485
|
|
342
|
-
|
486
|
+
---
|
487
|
+
成功したときは[AccountWithUser](#account-with-user)オブジェクトを返します
|
343
488
|
|
489
|
+
#### エンドユーザーのウォレット情報を表示する
|
490
|
+
ウォレットを取得します。
|
344
491
|
```ruby
|
345
|
-
response = client.send(Pokepay::Request::
|
346
|
-
|
347
|
-
|
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
|
-
}))
|
492
|
+
response = $client.send(Pokepay::Request::GetAccount.new(
|
493
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" // account_id: ウォレットID
|
494
|
+
))
|
360
495
|
```
|
361
496
|
|
362
|
-
|
497
|
+
---
|
498
|
+
`account_id`
|
499
|
+
ウォレットIDです。
|
363
500
|
|
364
|
-
|
365
|
-
- name (string): 組織名
|
501
|
+
フィルターとして使われ、指定したウォレットIDのウォレットを取得します。
|
366
502
|
|
367
|
-
|
368
|
-
|
369
|
-
#### 新規店舗を追加する
|
503
|
+
---
|
504
|
+
成功したときは[AccountDetail](#account-detail)オブジェクトを返します
|
370
505
|
|
506
|
+
#### エンドユーザーの残高内訳を表示する
|
507
|
+
エンドユーザーの残高は有効期限別のリストとして取得できます。
|
371
508
|
```ruby
|
372
|
-
response = client.send(Pokepay::Request::
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
"shop_address" => "東京都港区芝...", # 店舗の住所
|
378
|
-
"shop_tel" => "03-xxxx...", # 店舗の電話番号
|
379
|
-
"shop_email" => "mita@ox-supermarket.com", # 店舗のメールアドレス
|
380
|
-
"shop_external_id" => "mita0309", # 店舗の外部ID
|
381
|
-
}))
|
509
|
+
response = $client.send(Pokepay::Request::ListAccountBalances.new(
|
510
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // account_id: ウォレットID
|
511
|
+
page: 8855, // ページ番号
|
512
|
+
per_page: 14 // 1ページ分の取引数
|
513
|
+
))
|
382
514
|
```
|
383
515
|
|
384
|
-
|
516
|
+
---
|
517
|
+
`account_id`
|
518
|
+
ウォレットIDです。
|
385
519
|
|
386
|
-
|
387
|
-
- name (string): 店舗名
|
388
|
-
- isMerchant (bool): 店舗かどうかのフラグ (この場合は常に真)
|
520
|
+
フィルターとして使われ、指定したウォレットIDのウォレット残高を取得します。
|
389
521
|
|
390
|
-
|
522
|
+
---
|
523
|
+
`page`
|
524
|
+
取得したいページ番号です。
|
391
525
|
|
392
|
-
|
526
|
+
---
|
527
|
+
`per_page`
|
528
|
+
1ページ分のウォレット残高数です。
|
529
|
+
|
530
|
+
---
|
531
|
+
成功したときは[PaginatedAccountBalance](#paginated-account-balance)オブジェクトを返します
|
393
532
|
|
533
|
+
### Organization
|
534
|
+
|
535
|
+
#### 新規加盟店組織を追加する
|
394
536
|
```ruby
|
395
|
-
response = client.send(Pokepay::Request::
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
"
|
408
|
-
|
537
|
+
response = $client.send(Pokepay::Request::CreateOrganization.new(
|
538
|
+
"ox_supermarket", // code: 新規組織コード
|
539
|
+
"oxスーパー", // name: 新規組織名
|
540
|
+
["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], // private_money_ids: 加盟店組織で有効にするマネーIDの配列
|
541
|
+
"Rrnkhmqvwf@VE2D.com", // issuer_admin_user_email: 発行体担当者メールアドレス
|
542
|
+
"1nKhvBTC3o@f9gR.com", // member_admin_user_email: 新規組織担当者メールアドレス
|
543
|
+
bank_name: "XYZ銀行", // 銀行名
|
544
|
+
bank_code: "99X", // 銀行金融機関コード
|
545
|
+
bank_branch_name: "ABC支店", // 銀行支店名
|
546
|
+
bank_branch_code: "99X", // 銀行支店コード
|
547
|
+
bank_account_type: "saving", // 銀行口座種別 (普通=saving, 当座=current, その他=other)
|
548
|
+
bank_account: 9999999, // 銀行口座番号
|
549
|
+
bank_account_holder_name: "フクザワユキチ", // 口座名義人名
|
550
|
+
contact_name: "佐藤清" // 担当者名
|
551
|
+
))
|
409
552
|
```
|
553
|
+
成功したときは[Organization](#organization)オブジェクトを返します
|
410
554
|
|
411
|
-
|
412
|
-
以下にプロパティを示します。
|
413
|
-
|
414
|
-
- organizationCode (string): 組織コード
|
415
|
-
- topup (Response::OrganizationSummary): チャージのサマリ情報
|
416
|
-
- payment (Response::OrganizationSummary): 支払いのサマリ情報
|
555
|
+
### Shop
|
417
556
|
|
418
|
-
|
557
|
+
#### 新規店舗を追加する
|
558
|
+
```ruby
|
559
|
+
response = $client.send(Pokepay::Request::CreateShop.new(
|
560
|
+
"oxスーパー三田店", // shop_name: 店舗名
|
561
|
+
shop_postal_code: "7374764", // 店舗の郵便番号
|
562
|
+
shop_address: "東京都港区芝...", // 店舗の住所
|
563
|
+
shop_tel: "0550-6127", // 店舗の電話番号
|
564
|
+
shop_email: "nrkqiF5U2g@QPDC.com", // 店舗のメールアドレス
|
565
|
+
shop_external_id: "3BmwEo", // 店舗の外部ID
|
566
|
+
organization_code: "ox-supermarket" // 組織コード
|
567
|
+
))
|
568
|
+
```
|
569
|
+
成功したときは[User](#user)オブジェクトを返します
|
419
570
|
|
420
|
-
|
421
|
-
- moneyAmount (double): 取引マネー総額
|
422
|
-
- moneyCount (integer): マネー取引数
|
423
|
-
- pointAmount (double): 取引ポイント総額
|
424
|
-
- pointCount (integer): ポイント取引数
|
571
|
+
### Private Money
|
425
572
|
|
426
|
-
|
573
|
+
#### 決済加盟店の取引サマリを取得する
|
574
|
+
```ruby
|
575
|
+
response = $client.send(Pokepay::Request::GetPrivateMoneyOrganizationSummaries.new(
|
576
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // private_money_id: マネーID
|
577
|
+
from: "2024-08-10T12:22:25.000000+09:00", // 開始日時(toと同時に指定する必要有)
|
578
|
+
to: "2024-07-28T01:26:08.000000+09:00", // 終了日時(fromと同時に指定する必要有)
|
579
|
+
page: 1, // ページ番号
|
580
|
+
per_page: 50 // 1ページ分の取引数
|
581
|
+
))
|
582
|
+
```
|
583
|
+
`from`と`to`は同時に指定する必要があります。
|
584
|
+
|
585
|
+
成功したときは[PaginatedPrivateMoneyOrganizationSummaries](#paginated-private-money-organization-summaries)オブジェクトを返します
|
586
|
+
|
587
|
+
## Responses
|
588
|
+
|
589
|
+
<a name="account-with-user"></a>
|
590
|
+
## AccountWithUser
|
591
|
+
* `id (string)`:
|
592
|
+
* `name (string)`:
|
593
|
+
* `is_suspended (boolean)`:
|
594
|
+
* `private_money (PrivateMoney)`:
|
595
|
+
* `user (User)`:
|
596
|
+
|
597
|
+
`private_money`は [PrivateMoney](#private-money) オブジェクトを返します。
|
598
|
+
|
599
|
+
`user`は [User](#user) オブジェクトを返します。
|
600
|
+
|
601
|
+
<a name="account-detail"></a>
|
602
|
+
## AccountDetail
|
603
|
+
* `id (string)`:
|
604
|
+
* `name (string)`:
|
605
|
+
* `is_suspended (boolean)`:
|
606
|
+
* `balance (double)`:
|
607
|
+
* `money_balance (double)`:
|
608
|
+
* `point_balance (double)`:
|
609
|
+
* `private_money (PrivateMoney)`:
|
610
|
+
|
611
|
+
`private_money`は [PrivateMoney](#private-money) オブジェクトを返します。
|
612
|
+
|
613
|
+
<a name="check"></a>
|
614
|
+
## Check
|
615
|
+
* `id (string)`: チャージQRコードのID
|
616
|
+
* `amount (double)`: チャージマネー額 (deprecated)
|
617
|
+
* `money_amount (double)`: チャージマネー額
|
618
|
+
* `point_amount (double)`: チャージポイント額
|
619
|
+
* `description (string)`: チャージQRコードの説明文(アプリ上で取引の説明文として表示される)
|
620
|
+
* `user (User)`: 送金元ユーザ情報
|
621
|
+
* `is_onetime (boolean)`: 使用回数が一回限りかどうか
|
622
|
+
* `is_disabled (boolean)`: 無効化されているかどうか
|
623
|
+
* `expires_at (string)`: チャージQRコード自体の失効日時
|
624
|
+
* `private_money (PrivateMoney)`: 対象マネー情報
|
625
|
+
* `usage_limit (integer)`: 一回限りでない場合の最大読み取り回数
|
626
|
+
* `usage_count (double)`: 一回限りでない場合の現在までに読み取られた回数
|
627
|
+
* `token (string)`: チャージQRコードを解析したときに出てくるURL
|
628
|
+
|
629
|
+
`user`は [User](#user) オブジェクトを返します。
|
630
|
+
|
631
|
+
`private_money`は [PrivateMoney](#private-money) オブジェクトを返します。
|
632
|
+
|
633
|
+
<a name="user"></a>
|
634
|
+
## User
|
635
|
+
* `id (string)`: ユーザー (または店舗) ID
|
636
|
+
* `name (string)`: ユーザー (または店舗) 名
|
637
|
+
* `is_merchant (boolean)`: 店舗ユーザーかどうか
|
638
|
+
|
639
|
+
<a name="organization"></a>
|
640
|
+
## Organization
|
641
|
+
* `code (string)`: 組織コード
|
642
|
+
* `name (string)`: 組織名
|
643
|
+
|
644
|
+
<a name="transaction"></a>
|
645
|
+
## Transaction
|
646
|
+
* `id (string)`: 取引ID
|
647
|
+
* `type (string)`: 取引種別 (チャージ=topup, 支払い=payment)
|
648
|
+
* `is_modified (boolean)`: 返金された取引かどうか
|
649
|
+
* `sender (User)`: 送金者情報
|
650
|
+
* `sender_account (Account)`: 送金ウォレット情報
|
651
|
+
* `receiver (User)`: 受取者情報
|
652
|
+
* `receiver_account (Account)`: 受取ウォレット情報
|
653
|
+
* `amount (double)`: 決済総額 (マネー額 + ポイント額)
|
654
|
+
* `money_amount (double)`: 決済マネー額
|
655
|
+
* `point_amount (double)`: 決済ポイント額
|
656
|
+
* `done_at (string)`: 取引日時
|
657
|
+
* `description (string)`: 取引説明文
|
658
|
+
|
659
|
+
`receiver`と`sender`は [User](#user) オブジェクトを返します。
|
660
|
+
|
661
|
+
`receiver_account`と`sender_account`は [Account](#account) オブジェクトを返します。
|
662
|
+
|
663
|
+
<a name="transfer"></a>
|
664
|
+
## Transfer
|
665
|
+
* `id (string)`:
|
666
|
+
* `sender_account (AccountWithoutPrivateMoneyDetail)`:
|
667
|
+
* `receiver_account (AccountWithoutPrivateMoneyDetail)`:
|
668
|
+
* `amount (double)`:
|
669
|
+
* `money_amount (double)`:
|
670
|
+
* `point_amount (double)`:
|
671
|
+
* `done_at (string)`:
|
672
|
+
* `type (string)`:
|
673
|
+
* `description (string)`:
|
674
|
+
* `transaction_id (string)`:
|
675
|
+
|
676
|
+
`receiver_account`と`sender_account`は [AccountWithoutPrivateMoneyDetail](#account-without-private-money-detail) オブジェクトを返します。
|
677
|
+
|
678
|
+
<a name="paginated-private-money-organization-summaries"></a>
|
679
|
+
## PaginatedPrivateMoneyOrganizationSummaries
|
680
|
+
* `rows (array of PrivateMoneyOrganizationSummaries)`:
|
681
|
+
* `count (integer)`:
|
682
|
+
* `pagination (Pagination)`:
|
683
|
+
|
684
|
+
`rows`は [PrivateMoneyOrganizationSummary](#private-money-organization-summary) オブジェクトの配列を返します。
|
685
|
+
|
686
|
+
`pagination`は [Pagination](#pagination) オブジェクトを返します。
|
687
|
+
|
688
|
+
<a name="paginated-transaction"></a>
|
689
|
+
## PaginatedTransaction
|
690
|
+
* `rows (array of Transactions)`:
|
691
|
+
* `count (integer)`:
|
692
|
+
* `pagination (Pagination)`:
|
693
|
+
|
694
|
+
`rows`は [Transaction](#transaction) オブジェクトの配列を返します。
|
695
|
+
|
696
|
+
`pagination`は [Pagination](#pagination) オブジェクトを返します。
|
697
|
+
|
698
|
+
<a name="paginated-account-balance"></a>
|
699
|
+
## PaginatedAccountBalance
|
700
|
+
* `rows (array of AccountBalances)`:
|
701
|
+
* `count (integer)`:
|
702
|
+
* `pagination (Pagination)`:
|
703
|
+
|
704
|
+
`rows`は [AccountBalance](#account-balance) オブジェクトの配列を返します。
|
705
|
+
|
706
|
+
`pagination`は [Pagination](#pagination) オブジェクトを返します。
|
707
|
+
|
708
|
+
<a name="private-money"></a>
|
709
|
+
## PrivateMoney
|
710
|
+
* `id (string)`: マネーID
|
711
|
+
* `name (string)`: マネー名
|
712
|
+
* `unit (string)`: マネー単位 (例: 円)
|
713
|
+
* `is_exclusive (boolean)`: 会員制のマネーかどうか
|
714
|
+
* `description (string)`: マネー説明文
|
715
|
+
* `oneline_message (string)`: マネーの要約
|
716
|
+
* `organization (Organization)`: マネーを発行した組織
|
717
|
+
* `max_balance (double)`: ウォレットの上限金額
|
718
|
+
* `transfer_limit (double)`: マネーの取引上限額
|
719
|
+
* `type (string)`: マネー種別 (自家型=own, 第三者型=third-party)
|
720
|
+
* `expiration_type (string)`: 有効期限種別 (チャージ日起算=static, 最終利用日起算=last-update, 最終チャージ日起算=last-topup-update)
|
721
|
+
* `enable_topup_by_member (boolean)`: 加盟店によるチャージが有効かどうか
|
722
|
+
* `account_image (string)`: マネーの画像URL
|
723
|
+
|
724
|
+
`organization`は [Organization](#organization) オブジェクトを返します。
|
725
|
+
|
726
|
+
<a name="account"></a>
|
727
|
+
## Account
|
728
|
+
* `id (string)`: ウォレットID
|
729
|
+
* `name (string)`: ウォレット名
|
730
|
+
* `is_suspended (boolean)`: ウォレットが凍結されているかどうか
|
731
|
+
* `private_money (PrivateMoney)`: 設定マネー情報
|
732
|
+
|
733
|
+
`private_money`は [PrivateMoney](#private-money) オブジェクトを返します。
|
734
|
+
|
735
|
+
<a name="account-without-private-money-detail"></a>
|
736
|
+
## AccountWithoutPrivateMoneyDetail
|
737
|
+
* `id (string)`:
|
738
|
+
* `name (string)`:
|
739
|
+
* `is_suspended (boolean)`:
|
740
|
+
* `private_money_id (string)`:
|
741
|
+
* `user (User)`:
|
742
|
+
|
743
|
+
`user`は [User](#user) オブジェクトを返します。
|
744
|
+
|
745
|
+
<a name="private-money-organization-summary"></a>
|
746
|
+
## PrivateMoneyOrganizationSummary
|
747
|
+
* `organization_code (string)`:
|
748
|
+
* `topup (OrganizationSummary)`:
|
749
|
+
* `payment (OrganizationSummary)`:
|
750
|
+
|
751
|
+
`payment`と`topup`は [OrganizationSummary](#organization-summary) オブジェクトを返します。
|
752
|
+
|
753
|
+
<a name="pagination"></a>
|
754
|
+
## Pagination
|
755
|
+
* `current (integer)`:
|
756
|
+
* `per_page (integer)`:
|
757
|
+
* `max_page (integer)`:
|
758
|
+
* `has_prev (boolean)`:
|
759
|
+
* `has_next (boolean)`:
|
760
|
+
|
761
|
+
<a name="account-balance"></a>
|
762
|
+
## AccountBalance
|
763
|
+
* `expires_at (string)`:
|
764
|
+
* `money_amount (double)`:
|
765
|
+
* `point_amount (double)`:
|