pokepay_partner_ruby_sdk 0.3.2 → 0.3.6

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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release-pr.yml +18 -0
  3. data/Gemfile.lock +1 -1
  4. data/docs/README.md +269 -0
  5. data/docs/account.md +159 -0
  6. data/docs/bank_pay.md +235 -0
  7. data/docs/bill.md +365 -0
  8. data/docs/bulk.md +121 -0
  9. data/docs/campaign.md +1749 -0
  10. data/docs/cashtray.md +318 -0
  11. data/docs/check.md +883 -0
  12. data/docs/coupon.md +724 -0
  13. data/docs/customer.md +1042 -0
  14. data/docs/error-response.csv +839 -0
  15. data/docs/event.md +308 -0
  16. data/docs/index.md +1279 -305
  17. data/docs/organization.md +292 -0
  18. data/docs/private_money.md +213 -0
  19. data/docs/responses.md +711 -0
  20. data/docs/shop.md +678 -0
  21. data/docs/transaction.md +2021 -0
  22. data/docs/transfer.md +686 -0
  23. data/docs/user.md +3 -0
  24. data/docs/user_device.md +134 -0
  25. data/docs/webhook.md +231 -0
  26. data/lib/pokepay_partner_ruby_sdk/request/activate_user_device.rb +15 -0
  27. data/lib/pokepay_partner_ruby_sdk/request/create_bank.rb +17 -0
  28. data/lib/pokepay_partner_ruby_sdk/request/create_bank_topup_transaction.rb +18 -0
  29. data/lib/pokepay_partner_ruby_sdk/request/create_coupon.rb +19 -0
  30. data/lib/pokepay_partner_ruby_sdk/request/create_external_transaction.rb +2 -2
  31. data/lib/pokepay_partner_ruby_sdk/request/create_transaction_with_cashtray.rb +16 -0
  32. data/lib/pokepay_partner_ruby_sdk/request/create_user_device.rb +15 -0
  33. data/lib/pokepay_partner_ruby_sdk/request/delete_webhook.rb +15 -0
  34. data/lib/pokepay_partner_ruby_sdk/request/get_check.rb +15 -0
  35. data/lib/pokepay_partner_ruby_sdk/request/get_coupon.rb +1 -1
  36. data/lib/pokepay_partner_ruby_sdk/request/get_external_transaction_by_request_id.rb +15 -0
  37. data/lib/pokepay_partner_ruby_sdk/request/get_user_device.rb +15 -0
  38. data/lib/pokepay_partner_ruby_sdk/request/list_banks.rb +15 -0
  39. data/lib/pokepay_partner_ruby_sdk/request/list_checks.rb +15 -0
  40. data/lib/pokepay_partner_ruby_sdk/request/list_organizations.rb +15 -0
  41. data/lib/pokepay_partner_ruby_sdk/request/refund_external_transaction.rb +2 -2
  42. data/lib/pokepay_partner_ruby_sdk/request/update_check.rb +15 -0
  43. data/lib/pokepay_partner_ruby_sdk/request/update_coupon.rb +15 -0
  44. data/lib/pokepay_partner_ruby_sdk/response/bank.rb +28 -0
  45. data/lib/pokepay_partner_ruby_sdk/response/bank_registering_info.rb +13 -0
  46. data/lib/pokepay_partner_ruby_sdk/response/banks.rb +13 -0
  47. data/lib/pokepay_partner_ruby_sdk/response/campaign.rb +6 -0
  48. data/lib/pokepay_partner_ruby_sdk/response/check.rb +2 -0
  49. data/lib/pokepay_partner_ruby_sdk/response/external_transaction_detail.rb +34 -0
  50. data/lib/pokepay_partner_ruby_sdk/response/organization_summary.rb +4 -0
  51. data/lib/pokepay_partner_ruby_sdk/response/paginated_checks.rb +16 -0
  52. data/lib/pokepay_partner_ruby_sdk/response/paginated_organizations.rb +16 -0
  53. data/lib/pokepay_partner_ruby_sdk/response/private_money_summary.rb +4 -0
  54. data/lib/pokepay_partner_ruby_sdk/response/product.rb +2 -0
  55. data/lib/pokepay_partner_ruby_sdk/response/user_device.rb +18 -0
  56. data/lib/pokepay_partner_ruby_sdk/version.rb +1 -1
  57. data/lib/pokepay_partner_ruby_sdk.rb +26 -4
  58. data/partner.yaml +1578 -216
  59. metadata +46 -2
data/docs/cashtray.md ADDED
@@ -0,0 +1,318 @@
1
+ # Cashtray
2
+ Cashtrayは支払いとチャージ両方に使えるQRコードで、店舗ユーザとエンドユーザーの間の主に店頭などでの取引のために用いられます。
3
+ Cashtrayによる取引では、エンドユーザーがQRコードを読み取った時点で即時取引が作られ、ユーザに対して受け取り確認画面は表示されません。
4
+ Cashtrayはワンタイムで、一度読み取りに成功するか、取引エラーになると失効します。
5
+ また、Cashtrayには有効期限があり、デフォルトでは30分で失効します。
6
+
7
+
8
+ <a name="create-cashtray"></a>
9
+ ## CreateCashtray: Cashtrayを作る
10
+ Cashtrayを作成します。
11
+
12
+ エンドユーザーに対して支払いまたはチャージを行う店舗の情報(店舗ユーザーIDとマネーID)と、取引金額が必須項目です。
13
+ 店舗ユーザーIDとマネーIDから店舗ウォレットを特定します。
14
+
15
+ その他に、Cashtrayから作られる取引に対する説明文や失効時間を指定できます。
16
+
17
+
18
+ ```RUBY
19
+ response = $client.send(Pokepay::Request::CreateCashtray.new(
20
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
21
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # shop_id: 店舗ユーザーID
22
+ 7977.0, # amount: 金額
23
+ description: "たい焼き(小倉)", # 取引履歴に表示する説明文
24
+ expires_in: 9574 # 失効時間(秒)
25
+ ))
26
+ ```
27
+
28
+
29
+
30
+ ### Parameters
31
+ **`private_money_id`**
32
+
33
+
34
+ 取引対象のマネーのIDです(必須項目)。
35
+
36
+ ```json
37
+ {
38
+ "type": "string",
39
+ "format": "uuid"
40
+ }
41
+ ```
42
+
43
+ **`shop_id`**
44
+
45
+
46
+ 店舗のユーザーIDです(必須項目)。
47
+
48
+ ```json
49
+ {
50
+ "type": "string",
51
+ "format": "uuid"
52
+ }
53
+ ```
54
+
55
+ **`amount`**
56
+
57
+
58
+ マネー額です(必須項目)。
59
+ 正の値を与えるとチャージになり、負の値を与えると支払いとなります。
60
+
61
+ ```json
62
+ {
63
+ "type": "number"
64
+ }
65
+ ```
66
+
67
+ **`description`**
68
+
69
+
70
+ Cashtrayを読み取ったときに作られる取引の説明文です(最大200文字、任意項目)。
71
+ アプリや管理画面などの取引履歴に表示されます。デフォルトでは空文字になります。
72
+
73
+ ```json
74
+ {
75
+ "type": "string",
76
+ "maxLength": 200
77
+ }
78
+ ```
79
+
80
+ **`expires_in`**
81
+
82
+
83
+ Cashtrayが失効するまでの時間を秒単位で指定します(任意項目、デフォルト値は1800秒(30分))。
84
+
85
+ ```json
86
+ {
87
+ "type": "integer",
88
+ "minimum": 1
89
+ }
90
+ ```
91
+
92
+
93
+
94
+ 成功したときは
95
+ [Cashtray](./responses.md#cashtray)
96
+ を返します
97
+
98
+ ### Error Responses
99
+ |status|type|ja|en|
100
+ |---|---|---|---|
101
+ |403|unpermitted_admin_user|この管理ユーザには権限がありません|Admin does not have permission|
102
+ |422|account_not_found|アカウントが見つかりません|The account is not found|
103
+ |422|shop_user_not_found|店舗が見つかりません|The shop user is not found|
104
+
105
+
106
+
107
+ ---
108
+
109
+
110
+ <a name="cancel-cashtray"></a>
111
+ ## CancelCashtray: Cashtrayを無効化する
112
+ Cashtrayを無効化します。
113
+
114
+ これにより、 `GetCashtray` のレスポンス中の `canceled_at` に無効化時点での現在時刻が入るようになります。
115
+ エンドユーザーが無効化されたQRコードを読み取ると `cashtray_already_canceled` エラーとなり、取引は失敗します。
116
+
117
+ ```RUBY
118
+ response = $client.send(Pokepay::Request::CancelCashtray.new(
119
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # cashtray_id: CashtrayのID
120
+ ))
121
+ ```
122
+
123
+
124
+
125
+ ### Parameters
126
+ **`cashtray_id`**
127
+
128
+
129
+ 無効化するCashtrayのIDです。
130
+
131
+ ```json
132
+ {
133
+ "type": "string",
134
+ "format": "uuid"
135
+ }
136
+ ```
137
+
138
+
139
+
140
+ 成功したときは
141
+ [Cashtray](./responses.md#cashtray)
142
+ を返します
143
+
144
+
145
+
146
+ ---
147
+
148
+
149
+ <a name="get-cashtray"></a>
150
+ ## GetCashtray: Cashtrayの情報を取得する
151
+ Cashtrayの情報を取得します。
152
+
153
+ Cashtrayの現在の状態に加え、エンドユーザーのCashtray読み取りの試行結果、Cashtray読み取りによって作られた取引情報が取得できます。
154
+
155
+ レスポンス中の `attempt` には、このCashtrayをエンドユーザーが読み取った試行結果が入ります。
156
+ `account` はエンドユーザーのウォレット情報です。
157
+ 成功時には `attempt` 内の `status_code` に200が入ります。
158
+
159
+ まだCashtrayが読み取られていない場合は `attempt` の内容は `NULL` になります。
160
+ エンドユーザーのCashtray読み取りの際には、様々なエラーが起き得ます。
161
+ エラーの詳細は `attempt` 中の `error_type` と `error_message` にあります。主なエラー型と対応するステータスコードを以下に列挙します。
162
+
163
+ - `cashtray_already_proceed (422)`
164
+ - 既に処理済みのCashtrayをエンドユーザーが再び読み取ったときに返されます
165
+ - `cashtray_expired (422)`
166
+ - 読み取り時点でCashtray自体の有効期限が切れているときに返されます。Cashtrayが失効する時刻はレスポンス中の `expires_at` にあります
167
+ - `cashtray_already_canceled (422)`
168
+ - 読み取り時点でCashtrayが無効化されているときに返されます
169
+ - `account_balance_not_enough (422)`
170
+ - 支払い時に、エンドユーザーの残高が不足していて取引が完了できなかったときに返されます
171
+ - `account_balance_exceeded`
172
+ - チャージ時に、エンドユーザーのウォレット上限を超えて取引が完了できなかったときに返されます
173
+ - `account_transfer_limit_exceeded (422)`
174
+ - マネーに設定されている一度の取引金額の上限を超えたため、取引が完了できなかったときに返されます
175
+ - `account_money_topup_transfer_limit_exceeded (422)`
176
+ - マネーに設定されている一度のマネーチャージ金額の上限を超えたため、取引が完了できなかったときに返されます
177
+ - `account_not_found (422)`
178
+ - Cashtrayに設定されたマネーのウォレットをエンドユーザーが持っていなかったときに返されます
179
+
180
+
181
+ レスポンス中の `transaction` には、このCashtrayをエンドユーザーが読み取ることによって作られる取引データが入ります。まだCashtrayが読み取られていない場合は `NULL` になります。
182
+
183
+ 以上をまとめると、Cashtrayの状態は以下のようになります。
184
+
185
+ - エンドユーザーのCashtray読み取りによって取引が成功した場合
186
+ - レスポンス中の `attempt` と `transaction` にそれぞれ値が入ります
187
+ - 何らかの理由で取引が失敗した場合
188
+ - レスポンス中の `attempt` にエラー内容が入り、 `transaction` には `NULL` が入ります
189
+ - まだCashtrayが読み取られていない場合
190
+ - レスポンス中の `attempt` と `transaction` にそれぞれ `NULL` が入ります。Cashtrayの `expires_at` が現在時刻より前の場合は有効期限切れ状態です。
191
+
192
+ Cashtrayの取り得る全ての状態を擬似コードで記述すると以下のようになります。
193
+ ```
194
+ if (attempt == null) {
195
+ // 状態は未確定
196
+ if (canceled_at != null) {
197
+ // 無効化済み
198
+ } else if (expires_at < now) {
199
+ // 失効済み
200
+ } else {
201
+ // まだ有効で読み取られていない
202
+ }
203
+ } else if (transaction != null) {
204
+ // 取引成功確定。attempt で読み取ったユーザなどが分かる
205
+ } else {
206
+ // 取引失敗確定。attempt で失敗理由などが分かる
207
+ }
208
+ ```
209
+
210
+ ```RUBY
211
+ response = $client.send(Pokepay::Request::GetCashtray.new(
212
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # cashtray_id: CashtrayのID
213
+ ))
214
+ ```
215
+
216
+
217
+
218
+ ### Parameters
219
+ **`cashtray_id`**
220
+
221
+
222
+ 情報を取得するCashtrayのIDです。
223
+
224
+ ```json
225
+ {
226
+ "type": "string",
227
+ "format": "uuid"
228
+ }
229
+ ```
230
+
231
+
232
+
233
+ 成功したときは
234
+ [CashtrayWithResult](./responses.md#cashtray-with-result)
235
+ を返します
236
+
237
+
238
+
239
+ ---
240
+
241
+
242
+ <a name="update-cashtray"></a>
243
+ ## UpdateCashtray: Cashtrayの情報を更新する
244
+ Cashtrayの内容を更新します。bodyパラメーターは全て省略可能で、指定したもののみ更新されます。
245
+
246
+ ```RUBY
247
+ response = $client.send(Pokepay::Request::UpdateCashtray.new(
248
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # cashtray_id: CashtrayのID
249
+ amount: 4481.0, # 金額
250
+ description: "たい焼き(小倉)", # 取引履歴に表示する説明文
251
+ expires_in: 1626 # 失効時間(秒)
252
+ ))
253
+ ```
254
+
255
+
256
+
257
+ ### Parameters
258
+ **`cashtray_id`**
259
+
260
+
261
+ 更新対象のCashtrayのIDです。
262
+
263
+ ```json
264
+ {
265
+ "type": "string",
266
+ "format": "uuid"
267
+ }
268
+ ```
269
+
270
+ **`amount`**
271
+
272
+
273
+ マネー額です(任意項目)。
274
+ 正の値を与えるとチャージになり、負の値を与えると支払いとなります。
275
+
276
+ ```json
277
+ {
278
+ "type": "number"
279
+ }
280
+ ```
281
+
282
+ **`description`**
283
+
284
+
285
+ Cashtrayを読み取ったときに作られる取引の説明文です(最大200文字、任意項目)。
286
+ アプリや管理画面などの取引履歴に表示されます。
287
+
288
+ ```json
289
+ {
290
+ "type": "string",
291
+ "maxLength": 200
292
+ }
293
+ ```
294
+
295
+ **`expires_in`**
296
+
297
+
298
+ Cashtrayが失効するまでの時間を秒で指定します(任意項目、デフォルト値は1800秒(30分))。
299
+
300
+ ```json
301
+ {
302
+ "type": "integer",
303
+ "minimum": 1
304
+ }
305
+ ```
306
+
307
+
308
+
309
+ 成功したときは
310
+ [Cashtray](./responses.md#cashtray)
311
+ を返します
312
+
313
+
314
+
315
+ ---
316
+
317
+
318
+