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.
- checksums.yaml +4 -4
- data/.github/workflows/release-pr.yml +18 -0
- data/Gemfile.lock +1 -1
- data/docs/README.md +269 -0
- data/docs/account.md +159 -0
- data/docs/bank_pay.md +235 -0
- data/docs/bill.md +365 -0
- data/docs/bulk.md +121 -0
- data/docs/campaign.md +1749 -0
- data/docs/cashtray.md +318 -0
- data/docs/check.md +883 -0
- data/docs/coupon.md +724 -0
- data/docs/customer.md +1042 -0
- data/docs/error-response.csv +839 -0
- data/docs/event.md +308 -0
- data/docs/index.md +1279 -305
- data/docs/organization.md +292 -0
- data/docs/private_money.md +213 -0
- data/docs/responses.md +711 -0
- data/docs/shop.md +678 -0
- data/docs/transaction.md +2021 -0
- data/docs/transfer.md +686 -0
- data/docs/user.md +3 -0
- data/docs/user_device.md +134 -0
- data/docs/webhook.md +231 -0
- data/lib/pokepay_partner_ruby_sdk/request/activate_user_device.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/create_bank.rb +17 -0
- data/lib/pokepay_partner_ruby_sdk/request/create_bank_topup_transaction.rb +18 -0
- data/lib/pokepay_partner_ruby_sdk/request/create_coupon.rb +19 -0
- data/lib/pokepay_partner_ruby_sdk/request/create_external_transaction.rb +2 -2
- data/lib/pokepay_partner_ruby_sdk/request/create_transaction_with_cashtray.rb +16 -0
- data/lib/pokepay_partner_ruby_sdk/request/create_user_device.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/delete_webhook.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/get_check.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/get_coupon.rb +1 -1
- data/lib/pokepay_partner_ruby_sdk/request/get_external_transaction_by_request_id.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/get_user_device.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/list_banks.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/list_checks.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/list_organizations.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/refund_external_transaction.rb +2 -2
- data/lib/pokepay_partner_ruby_sdk/request/update_check.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/update_coupon.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/response/bank.rb +28 -0
- data/lib/pokepay_partner_ruby_sdk/response/bank_registering_info.rb +13 -0
- data/lib/pokepay_partner_ruby_sdk/response/banks.rb +13 -0
- data/lib/pokepay_partner_ruby_sdk/response/campaign.rb +6 -0
- data/lib/pokepay_partner_ruby_sdk/response/check.rb +2 -0
- data/lib/pokepay_partner_ruby_sdk/response/external_transaction_detail.rb +34 -0
- data/lib/pokepay_partner_ruby_sdk/response/organization_summary.rb +4 -0
- data/lib/pokepay_partner_ruby_sdk/response/paginated_checks.rb +16 -0
- data/lib/pokepay_partner_ruby_sdk/response/paginated_organizations.rb +16 -0
- data/lib/pokepay_partner_ruby_sdk/response/private_money_summary.rb +4 -0
- data/lib/pokepay_partner_ruby_sdk/response/product.rb +2 -0
- data/lib/pokepay_partner_ruby_sdk/response/user_device.rb +18 -0
- data/lib/pokepay_partner_ruby_sdk/version.rb +1 -1
- data/lib/pokepay_partner_ruby_sdk.rb +26 -4
- data/partner.yaml +1578 -216
- metadata +46 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c26d818f8a48583f4c99798f0acbb1d7fc680660921b423ba22f3340922c14c
|
4
|
+
data.tar.gz: cb9f3689642620870ded66eaca10fdbf952f9e0f41307542c92373b00f89ef12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0d6d8ac988718ef1e52d5c7510d10a5bc0766f1ba2499a503d8e23d15c7c3f87d5461f879c232912920a832afb11e08b4324f6fd632142084b7e539f365f749
|
7
|
+
data.tar.gz: 792addcccce3fe782d3dd23a89a42a4e8d4a1bbbfa2a5829c6cc29c10bbc510163915d4936524dade73a1945a0afc5bc6bc8b9c782dcd9f8ef248268335faaa8
|
@@ -0,0 +1,18 @@
|
|
1
|
+
name: release PR
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- release/**
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
build:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v3
|
13
|
+
|
14
|
+
- name: Run a multi-line script
|
15
|
+
env:
|
16
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
17
|
+
run: |
|
18
|
+
gh pr create -B master -t ${{ github.ref }} -b ''
|
data/Gemfile.lock
CHANGED
data/docs/README.md
ADDED
@@ -0,0 +1,269 @@
|
|
1
|
+
# Partner API SDK for Ruby
|
2
|
+
## Installation
|
3
|
+
|
4
|
+
rubygemsからインストールすることができます。
|
5
|
+
```
|
6
|
+
$ gem install pokepay_partner_ruby_sdk
|
7
|
+
```
|
8
|
+
|
9
|
+
ロードパスの通ったところにライブラリが配置されていれば、以下のようにロードできます。
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require "pokepay_partner_ruby_sdk"
|
13
|
+
```
|
14
|
+
|
15
|
+
## Getting started
|
16
|
+
|
17
|
+
基本的な使い方は次のようになります。
|
18
|
+
|
19
|
+
- ライブラリをロード
|
20
|
+
- 設定ファイル(後述)から `Pokepay::Client` オブジェクトを作る
|
21
|
+
- リクエストオブジェクトを作り、`Pokepay::Client` オブジェクトの `send` メソッドに対して渡す
|
22
|
+
- レスポンスオブジェクトを得る
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
require "pokepay_partner_ruby_sdk"
|
26
|
+
client = Pokepay::Client.new("/path/to/config.ini")
|
27
|
+
request = Pokepay::Request::SendEcho.new('hello')
|
28
|
+
response = client.send(request)
|
29
|
+
```
|
30
|
+
|
31
|
+
レスポンスオブジェクト内にステータスコード、JSONをパースしたハッシュマップ、さらにレスポンス内容のオブジェクトが含まれています。
|
32
|
+
|
33
|
+
## Settings
|
34
|
+
|
35
|
+
設定はINIファイルに記述し、`Pokepay::Client` のコンストラクタにファイルパスを指定します。
|
36
|
+
|
37
|
+
SDKプロジェクトルートに `config.ini.sample` というファイルがありますのでそれを元に必要な情報を記述してください。特に以下の情報は通信の安全性のため必要な項目です。これらはパートナー契約時にお渡ししているものです。
|
38
|
+
|
39
|
+
- `CLIENT_ID`: パートナーAPI クライアントID
|
40
|
+
- `CLIENT_SECRET`: パートナーAPI クライアント秘密鍵
|
41
|
+
- `SSL_KEY_FILE`: SSL秘密鍵ファイルパス
|
42
|
+
- `SSL_CERT_FILE`: SSL証明書ファイルパス
|
43
|
+
|
44
|
+
この他に接続先のサーバURL情報が必要です。
|
45
|
+
|
46
|
+
- `API_BASE_URL`: パートナーAPI サーバURL
|
47
|
+
|
48
|
+
また、この設定ファイルには認証に必要な情報が含まれるため、ファイルの管理・取り扱いに十分注意してください。
|
49
|
+
|
50
|
+
設定ファイル記述例(`config.ini.sample`)
|
51
|
+
|
52
|
+
```
|
53
|
+
CLIENT_ID = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
54
|
+
CLIENT_SECRET = yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
|
55
|
+
API_BASE_URL = https://partnerapi-sandbox.pokepay.jp
|
56
|
+
SSL_KEY_FILE = /path/to/key.pem
|
57
|
+
SSL_CERT_FILE = /path/to/cert.pem
|
58
|
+
```
|
59
|
+
|
60
|
+
設定はハッシュで渡すこともできます。
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
client = Pokepay::Client.new(
|
64
|
+
{
|
65
|
+
client_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
|
66
|
+
client_secret: "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
|
67
|
+
api_base_url: "https://partnerapi-sandbox.pokepay.jp",
|
68
|
+
ssl_key_file: "/path/to/key.pem",
|
69
|
+
ssl_cert_file: "/path/to/cert.pem"
|
70
|
+
}
|
71
|
+
)
|
72
|
+
```
|
73
|
+
|
74
|
+
## Overview
|
75
|
+
|
76
|
+
### APIリクエスト
|
77
|
+
|
78
|
+
Partner APIへの通信はリクエストオブジェクトを作り、`Pokepay::Client.send` メソッドに渡すことで行われます。
|
79
|
+
リクエストクラスは名前空間 `Pokepay::Request` 以下に定義されています。
|
80
|
+
|
81
|
+
たとえば `Pokepay::Request::SendEcho` は送信した内容をそのまま返す処理です。
|
82
|
+
|
83
|
+
```ruby
|
84
|
+
request = Pokepay::Request::SendEcho.new('hello')
|
85
|
+
|
86
|
+
response = client.send(request)
|
87
|
+
# => #<Pokepay::Response::Response 200 OK readbody=>
|
88
|
+
```
|
89
|
+
|
90
|
+
通信の結果として、レスポンスオブジェクトが得られます。
|
91
|
+
これはステータスコードとレスポンスボディ、各レスポンスクラスのオブジェクトをインスタンス変数に持つオブジェクトです。
|
92
|
+
|
93
|
+
```ruby
|
94
|
+
response.code
|
95
|
+
# => 200
|
96
|
+
|
97
|
+
response.body
|
98
|
+
# => {"status"=>"ok", "message"=>"hello"}
|
99
|
+
|
100
|
+
response.object
|
101
|
+
# => #<Pokepay::Response::Echo:0x000055fd7cc0db20 @message="hello">
|
102
|
+
|
103
|
+
response.object.message
|
104
|
+
# => "hello"
|
105
|
+
```
|
106
|
+
|
107
|
+
利用可能なAPI操作については [API Operations](#api-operations) で紹介します。
|
108
|
+
|
109
|
+
<a name="paging"></a>
|
110
|
+
### ページング
|
111
|
+
|
112
|
+
API操作によっては、大量のデータがある場合に備えてページング処理があります。
|
113
|
+
その処理では以下のようなプロパティを持つレスポンスオブジェクトを返します。
|
114
|
+
|
115
|
+
- rows : 列挙するレスポンスクラスのオブジェクトの配列
|
116
|
+
- count : 全体の要素数
|
117
|
+
- pagination : 以下のインスタンス変数を持つオブジェクト
|
118
|
+
- current : 現在のページ位置(1からスタート)
|
119
|
+
- per_page : 1ページ当たりの要素数
|
120
|
+
- max_page : 最後のページ番号
|
121
|
+
- has_prev : 前ページを持つかどうかの真理値
|
122
|
+
- has_next : 次ページを持つかどうかの真理値
|
123
|
+
|
124
|
+
ページングクラスは `Pokepay::Response::Pagination` で定義されています。
|
125
|
+
|
126
|
+
以下にコード例を示します。
|
127
|
+
|
128
|
+
```ruby
|
129
|
+
request = Pokepay::Request::ListTransactions.new({ "page" => 1, "per_page" => 50 })
|
130
|
+
response = client.send(request)
|
131
|
+
|
132
|
+
if response.object.pagination.has_next then
|
133
|
+
next_page = response.object.pagination.current + 1
|
134
|
+
request = Pokepay::Request::ListTransactions.new({ "page" => next_page, "per_page" => 50 })
|
135
|
+
response = client.send(request)
|
136
|
+
end
|
137
|
+
```
|
138
|
+
|
139
|
+
### エラーハンドリング
|
140
|
+
|
141
|
+
エラーの場合は `Net::HTTPBadRequest` などのエラーレスポンスオブジェクトが返ります。
|
142
|
+
エラーレスポンスもステータスコードとレスポンスボディを持ちます。
|
143
|
+
|
144
|
+
```ruby
|
145
|
+
request = Pokepay::Request::SendEcho.new(-1)
|
146
|
+
|
147
|
+
response = client.send(request)
|
148
|
+
# => #<Net::HTTPBadRequest 400 Bad Request readbody=true>
|
149
|
+
|
150
|
+
response.code
|
151
|
+
# => 400
|
152
|
+
|
153
|
+
response.body
|
154
|
+
# => {"type"=>"invalid_parameters", "message"=>"Invalid parameters", "errors"=>{"invalid"=>["message"]}}
|
155
|
+
```
|
156
|
+
<a name="api-operations"></a>
|
157
|
+
## API Operations
|
158
|
+
|
159
|
+
### Transaction
|
160
|
+
- [GetCpmToken](./transaction.md#get-cpm-token): CPMトークンの状態取得
|
161
|
+
- [ListTransactions](./transaction.md#list-transactions): 【廃止】取引履歴を取得する
|
162
|
+
- [CreateTransaction](./transaction.md#create-transaction): 【廃止】チャージする
|
163
|
+
- [ListTransactionsV2](./transaction.md#list-transactions-v2): 取引履歴を取得する
|
164
|
+
- [CreateTopupTransaction](./transaction.md#create-topup-transaction): チャージする
|
165
|
+
- [CreatePaymentTransaction](./transaction.md#create-payment-transaction): 支払いする
|
166
|
+
- [CreateCpmTransaction](./transaction.md#create-cpm-transaction): CPMトークンによる取引作成
|
167
|
+
- [CreateTransferTransaction](./transaction.md#create-transfer-transaction): 個人間送金
|
168
|
+
- [CreateExchangeTransaction](./transaction.md#create-exchange-transaction):
|
169
|
+
- [GetTransaction](./transaction.md#get-transaction): 取引情報を取得する
|
170
|
+
- [RefundTransaction](./transaction.md#refund-transaction): 取引をキャンセルする
|
171
|
+
- [GetTransactionByRequestId](./transaction.md#get-transaction-by-request-id): リクエストIDから取引情報を取得する
|
172
|
+
- [GetBulkTransaction](./transaction.md#get-bulk-transaction): バルク取引ジョブの実行状況を取得する
|
173
|
+
- [ListBulkTransactionJobs](./transaction.md#list-bulk-transaction-jobs): バルク取引ジョブの詳細情報一覧を取得する
|
174
|
+
- [RequestUserStats](./transaction.md#request-user-stats): 指定期間内の顧客が行った取引の統計情報をCSVでダウンロードする
|
175
|
+
|
176
|
+
### Transfer
|
177
|
+
- [GetAccountTransferSummary](./transfer.md#get-account-transfer-summary):
|
178
|
+
- [ListTransfers](./transfer.md#list-transfers):
|
179
|
+
- [ListTransfersV2](./transfer.md#list-transfers-v2):
|
180
|
+
|
181
|
+
### Check
|
182
|
+
- [ListChecks](./check.md#list-checks): チャージQRコード一覧の取得
|
183
|
+
- [CreateCheck](./check.md#create-check): チャージQRコードの発行
|
184
|
+
- [GetCheck](./check.md#get-check): チャージQRコードの表示
|
185
|
+
- [UpdateCheck](./check.md#update-check): チャージQRコードの更新
|
186
|
+
- [CreateTopupTransactionWithCheck](./check.md#create-topup-transaction-with-check): チャージQRコードを読み取ることでチャージする
|
187
|
+
- [CreateTransactionWithCashtray](./check.md#create-transaction-with-cashtray): CashtrayQRコードを読み取ることで取引する
|
188
|
+
|
189
|
+
### Bill
|
190
|
+
- [ListBills](./bill.md#list-bills): 支払いQRコード一覧を表示する
|
191
|
+
- [CreateBill](./bill.md#create-bill): 支払いQRコードの発行
|
192
|
+
- [UpdateBill](./bill.md#update-bill): 支払いQRコードの更新
|
193
|
+
|
194
|
+
### Cashtray
|
195
|
+
- [CreateCashtray](./cashtray.md#create-cashtray): Cashtrayを作る
|
196
|
+
- [CancelCashtray](./cashtray.md#cancel-cashtray): Cashtrayを無効化する
|
197
|
+
- [GetCashtray](./cashtray.md#get-cashtray): Cashtrayの情報を取得する
|
198
|
+
- [UpdateCashtray](./cashtray.md#update-cashtray): Cashtrayの情報を更新する
|
199
|
+
|
200
|
+
### Customer
|
201
|
+
- [DeleteAccount](./customer.md#delete-account): ウォレットを退会する
|
202
|
+
- [GetAccount](./customer.md#get-account): ウォレット情報を表示する
|
203
|
+
- [UpdateAccount](./customer.md#update-account): ウォレット情報を更新する
|
204
|
+
- [ListAccountBalances](./customer.md#list-account-balances): エンドユーザーの残高内訳を表示する
|
205
|
+
- [ListAccountExpiredBalances](./customer.md#list-account-expired-balances): エンドユーザーの失効済みの残高内訳を表示する
|
206
|
+
- [UpdateCustomerAccount](./customer.md#update-customer-account): エンドユーザーのウォレット情報を更新する
|
207
|
+
- [GetCustomerAccounts](./customer.md#get-customer-accounts): エンドユーザーのウォレット一覧を表示する
|
208
|
+
- [CreateCustomerAccount](./customer.md#create-customer-account): 新規エンドユーザーをウォレットと共に追加する
|
209
|
+
- [GetShopAccounts](./customer.md#get-shop-accounts): 店舗ユーザーのウォレット一覧を表示する
|
210
|
+
- [ListCustomerTransactions](./customer.md#list-customer-transactions): 取引履歴を取得する
|
211
|
+
|
212
|
+
### Organization
|
213
|
+
- [ListOrganizations](./organization.md#list-organizations): 加盟店組織の一覧を取得する
|
214
|
+
- [CreateOrganization](./organization.md#create-organization): 新規加盟店組織を追加する
|
215
|
+
|
216
|
+
### Shop
|
217
|
+
- [ListShops](./shop.md#list-shops): 店舗一覧を取得する
|
218
|
+
- [CreateShop](./shop.md#create-shop): 【廃止】新規店舗を追加する
|
219
|
+
- [CreateShopV2](./shop.md#create-shop-v2): 新規店舗を追加する
|
220
|
+
- [GetShop](./shop.md#get-shop): 店舗情報を表示する
|
221
|
+
- [UpdateShop](./shop.md#update-shop): 店舗情報を更新する
|
222
|
+
|
223
|
+
### User
|
224
|
+
|
225
|
+
### Account
|
226
|
+
- [ListUserAccounts](./account.md#list-user-accounts): エンドユーザー、店舗ユーザーのウォレット一覧を表示する
|
227
|
+
- [CreateUserAccount](./account.md#create-user-account): エンドユーザーのウォレットを作成する
|
228
|
+
|
229
|
+
### Private Money
|
230
|
+
- [GetPrivateMoneys](./private_money.md#get-private-moneys): マネー一覧を取得する
|
231
|
+
- [GetPrivateMoneyOrganizationSummaries](./private_money.md#get-private-money-organization-summaries): 決済加盟店の取引サマリを取得する
|
232
|
+
- [GetPrivateMoneySummary](./private_money.md#get-private-money-summary): 取引サマリを取得する
|
233
|
+
|
234
|
+
### Bulk
|
235
|
+
- [BulkCreateTransaction](./bulk.md#bulk-create-transaction): CSVファイル一括取引
|
236
|
+
|
237
|
+
### Event
|
238
|
+
- [CreateExternalTransaction](./event.md#create-external-transaction): ポケペイ外部取引を作成する
|
239
|
+
- [RefundExternalTransaction](./event.md#refund-external-transaction): ポケペイ外部取引をキャンセルする
|
240
|
+
- [GetExternalTransactionByRequestId](./event.md#get-external-transaction-by-request-id): リクエストIDからポケペイ外部取引を取得する
|
241
|
+
|
242
|
+
### Campaign
|
243
|
+
- [ListCampaigns](./campaign.md#list-campaigns): キャンペーン一覧を取得する
|
244
|
+
- [CreateCampaign](./campaign.md#create-campaign): ポイント付与キャンペーンを作る
|
245
|
+
- [GetCampaign](./campaign.md#get-campaign): キャンペーンを取得する
|
246
|
+
- [UpdateCampaign](./campaign.md#update-campaign): ポイント付与キャンペーンを更新する
|
247
|
+
|
248
|
+
### Webhook
|
249
|
+
- [ListWebhooks](./webhook.md#list-webhooks): 作成したWebhookの一覧を返す
|
250
|
+
- [CreateWebhook](./webhook.md#create-webhook): webhookの作成
|
251
|
+
- [DeleteWebhook](./webhook.md#delete-webhook): Webhookの削除
|
252
|
+
- [UpdateWebhook](./webhook.md#update-webhook): Webhookの更新
|
253
|
+
|
254
|
+
### Coupon
|
255
|
+
- [ListCoupons](./coupon.md#list-coupons): クーポン一覧の取得
|
256
|
+
- [CreateCoupon](./coupon.md#create-coupon): クーポンの登録
|
257
|
+
- [GetCoupon](./coupon.md#get-coupon): クーポンの取得
|
258
|
+
- [UpdateCoupon](./coupon.md#update-coupon): クーポンの更新
|
259
|
+
|
260
|
+
### UserDevice
|
261
|
+
- [CreateUserDevice](./user_device.md#create-user-device): ユーザーのデバイス登録
|
262
|
+
- [GetUserDevice](./user_device.md#get-user-device): ユーザーのデバイスを取得
|
263
|
+
- [ActivateUserDevice](./user_device.md#activate-user-device): デバイスの有効化
|
264
|
+
|
265
|
+
### BankPay
|
266
|
+
- [ListBanks](./bank_pay.md#list-banks): 登録した銀行の一覧
|
267
|
+
- [CreateBank](./bank_pay.md#create-bank): 銀行口座の登録
|
268
|
+
- [CreateBankTopupTransaction](./bank_pay.md#create-bank-topup-transaction): 銀行からのチャージ
|
269
|
+
|
data/docs/account.md
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
# Account
|
2
|
+
|
3
|
+
<a name="list-user-accounts"></a>
|
4
|
+
## ListUserAccounts: エンドユーザー、店舗ユーザーのウォレット一覧を表示する
|
5
|
+
ユーザーIDを指定してそのユーザーのウォレット一覧を取得します。
|
6
|
+
|
7
|
+
```RUBY
|
8
|
+
response = $client.send(Pokepay::Request::ListUserAccounts.new(
|
9
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # user_id: ユーザーID
|
10
|
+
page: 3778, # ページ番号
|
11
|
+
per_page: 7882 # 1ページ分の取引数
|
12
|
+
))
|
13
|
+
```
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
### Parameters
|
18
|
+
**`user_id`**
|
19
|
+
|
20
|
+
|
21
|
+
ユーザーIDです。
|
22
|
+
|
23
|
+
指定したユーザーIDのウォレット一覧を取得します。パートナーキーと紐づく組織が発行しているマネーのウォレットのみが表示されます。
|
24
|
+
|
25
|
+
```json
|
26
|
+
{
|
27
|
+
"type": "string",
|
28
|
+
"format": "uuid"
|
29
|
+
}
|
30
|
+
```
|
31
|
+
|
32
|
+
**`page`**
|
33
|
+
|
34
|
+
|
35
|
+
取得したいページ番号です。デフォルト値は1です。
|
36
|
+
|
37
|
+
```json
|
38
|
+
{
|
39
|
+
"type": "integer",
|
40
|
+
"minimum": 1
|
41
|
+
}
|
42
|
+
```
|
43
|
+
|
44
|
+
**`per_page`**
|
45
|
+
|
46
|
+
|
47
|
+
1ページ当たりのウォレット数です。デフォルト値は50です。
|
48
|
+
|
49
|
+
```json
|
50
|
+
{
|
51
|
+
"type": "integer",
|
52
|
+
"minimum": 1
|
53
|
+
}
|
54
|
+
```
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
成功したときは
|
59
|
+
[PaginatedAccountDetails](./responses.md#paginated-account-details)
|
60
|
+
を返します
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
---
|
65
|
+
|
66
|
+
|
67
|
+
<a name="create-user-account"></a>
|
68
|
+
## CreateUserAccount: エンドユーザーのウォレットを作成する
|
69
|
+
既存のエンドユーザーに対して、指定したマネーのウォレットを新規作成します
|
70
|
+
|
71
|
+
```RUBY
|
72
|
+
response = $client.send(Pokepay::Request::CreateUserAccount.new(
|
73
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # user_id: ユーザーID
|
74
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
|
75
|
+
name: "CSoLJdEVZoJB0H5I2jNmYRtpCMs9TezTj3A085y5hWQ3gdeDOWFExGORRYNLJdsZ6n3IGoF44i0499bTqwmusaHN4dAo0kcMwrj6lsuth9pSzmqVAxW3BZh2UFG0NdobuyCqKAyF8XBloHn7nUM7l934bPMQ7DIwFMXGuP", # ウォレット名
|
76
|
+
external_id: "CrmdUDxKggDF", # 外部ID
|
77
|
+
metadata: "{\"key1\":\"foo\",\"key2\":\"bar\"}" # ウォレットに付加するメタデータ
|
78
|
+
))
|
79
|
+
```
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
### Parameters
|
84
|
+
**`user_id`**
|
85
|
+
|
86
|
+
|
87
|
+
ユーザーIDです。
|
88
|
+
|
89
|
+
```json
|
90
|
+
{
|
91
|
+
"type": "string",
|
92
|
+
"format": "uuid"
|
93
|
+
}
|
94
|
+
```
|
95
|
+
|
96
|
+
**`private_money_id`**
|
97
|
+
|
98
|
+
|
99
|
+
マネーIDです。
|
100
|
+
|
101
|
+
作成するウォレットのマネーを指定します。このパラメータは必須です。
|
102
|
+
|
103
|
+
```json
|
104
|
+
{
|
105
|
+
"type": "string",
|
106
|
+
"format": "uuid"
|
107
|
+
}
|
108
|
+
```
|
109
|
+
|
110
|
+
**`name`**
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
```json
|
115
|
+
{
|
116
|
+
"type": "string",
|
117
|
+
"maxLength": 256
|
118
|
+
}
|
119
|
+
```
|
120
|
+
|
121
|
+
**`external_id`**
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
```json
|
126
|
+
{
|
127
|
+
"type": "string",
|
128
|
+
"maxLength": 50
|
129
|
+
}
|
130
|
+
```
|
131
|
+
|
132
|
+
**`metadata`**
|
133
|
+
|
134
|
+
|
135
|
+
ウォレットに付加するメタデータをJSON文字列で指定します。
|
136
|
+
指定できるJSON文字列には以下のような制約があります。
|
137
|
+
- フラットな構造のJSONを文字列化したものであること。
|
138
|
+
- keyは最大32文字の文字列(同じkeyを複数指定することはできません)
|
139
|
+
- valueには128文字以下の文字列が指定できます
|
140
|
+
|
141
|
+
```json
|
142
|
+
{
|
143
|
+
"type": "string",
|
144
|
+
"format": "json"
|
145
|
+
}
|
146
|
+
```
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
成功したときは
|
151
|
+
[AccountDetail](./responses.md#account-detail)
|
152
|
+
を返します
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
---
|
157
|
+
|
158
|
+
|
159
|
+
|
data/docs/bank_pay.md
ADDED
@@ -0,0 +1,235 @@
|
|
1
|
+
# BankPay
|
2
|
+
BankPayを用いた銀行からのチャージ取引などのAPIを提供しています。
|
3
|
+
|
4
|
+
|
5
|
+
<a name="list-banks"></a>
|
6
|
+
## ListBanks: 登録した銀行の一覧
|
7
|
+
登録した銀行を一覧します
|
8
|
+
|
9
|
+
```RUBY
|
10
|
+
response = $client.send(Pokepay::Request::ListBanks.new(
|
11
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # user_device_id: デバイスID
|
12
|
+
private_money_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
13
|
+
))
|
14
|
+
```
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
### Parameters
|
19
|
+
**`user_device_id`**
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
```json
|
24
|
+
{
|
25
|
+
"type": "string",
|
26
|
+
"format": "uuid"
|
27
|
+
}
|
28
|
+
```
|
29
|
+
|
30
|
+
**`private_money_id`**
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
```json
|
35
|
+
{
|
36
|
+
"type": "string",
|
37
|
+
"format": "uuid"
|
38
|
+
}
|
39
|
+
```
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
成功したときは
|
44
|
+
[Banks](./responses.md#banks)
|
45
|
+
を返します
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
---
|
50
|
+
|
51
|
+
|
52
|
+
<a name="create-bank"></a>
|
53
|
+
## CreateBank: 銀行口座の登録
|
54
|
+
銀行口座の登録を始めるAPIです。レスポンスに含まれるredirect_urlをユーザーの端末で開き銀行を登録します。
|
55
|
+
|
56
|
+
ユーザーが銀行口座の登録に成功すると、callback_urlにリクエストが行われます。
|
57
|
+
アプリの場合はDeep Linkを使うことを想定しています。
|
58
|
+
|
59
|
+
|
60
|
+
```RUBY
|
61
|
+
response = $client.send(Pokepay::Request::CreateBank.new(
|
62
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # user_device_id: デバイスID
|
63
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
|
64
|
+
"<Deep Link>", # callback_url: コールバックURL
|
65
|
+
"ポケペイタロウ", # kana: ユーザーの氏名 (片仮名で指定)
|
66
|
+
email: "7GsubMGTjI@cOXK.com", # ユーザーのメールアドレス
|
67
|
+
birthdate: "19901142" # 生年月日
|
68
|
+
))
|
69
|
+
```
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
### Parameters
|
74
|
+
**`user_device_id`**
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
```json
|
79
|
+
{
|
80
|
+
"type": "string",
|
81
|
+
"format": "uuid"
|
82
|
+
}
|
83
|
+
```
|
84
|
+
|
85
|
+
**`private_money_id`**
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
```json
|
90
|
+
{
|
91
|
+
"type": "string",
|
92
|
+
"format": "uuid"
|
93
|
+
}
|
94
|
+
```
|
95
|
+
|
96
|
+
**`callback_url`**
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
```json
|
101
|
+
{
|
102
|
+
"type": "string",
|
103
|
+
"maxLength": 256
|
104
|
+
}
|
105
|
+
```
|
106
|
+
|
107
|
+
**`kana`**
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
```json
|
112
|
+
{
|
113
|
+
"type": "string",
|
114
|
+
"maxLength": 30
|
115
|
+
}
|
116
|
+
```
|
117
|
+
|
118
|
+
**`email`**
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
```json
|
123
|
+
{
|
124
|
+
"type": "string",
|
125
|
+
"format": "email",
|
126
|
+
"maxLength": 300
|
127
|
+
}
|
128
|
+
```
|
129
|
+
|
130
|
+
**`birthdate`**
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
```json
|
135
|
+
{
|
136
|
+
"type": "string",
|
137
|
+
"maxLength": 8
|
138
|
+
}
|
139
|
+
```
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
成功したときは
|
144
|
+
[BankRegisteringInfo](./responses.md#bank-registering-info)
|
145
|
+
を返します
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
---
|
150
|
+
|
151
|
+
|
152
|
+
<a name="create-bank-topup-transaction"></a>
|
153
|
+
## CreateBankTopupTransaction: 銀行からのチャージ
|
154
|
+
指定のマネーのアカウントにbank_idの口座を用いてチャージを行います。
|
155
|
+
|
156
|
+
```RUBY
|
157
|
+
response = $client.send(Pokepay::Request::CreateBankTopupTransaction.new(
|
158
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # user_device_id: デバイスID
|
159
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
|
160
|
+
3269, # amount: チャージ金額
|
161
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # bank_id: 銀行ID
|
162
|
+
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # request_id: リクエストID
|
163
|
+
))
|
164
|
+
```
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
### Parameters
|
169
|
+
**`user_device_id`**
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
```json
|
174
|
+
{
|
175
|
+
"type": "string",
|
176
|
+
"format": "uuid"
|
177
|
+
}
|
178
|
+
```
|
179
|
+
|
180
|
+
**`private_money_id`**
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
```json
|
185
|
+
{
|
186
|
+
"type": "string",
|
187
|
+
"format": "uuid"
|
188
|
+
}
|
189
|
+
```
|
190
|
+
|
191
|
+
**`amount`**
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
```json
|
196
|
+
{
|
197
|
+
"type": "integer",
|
198
|
+
"minimum": 1
|
199
|
+
}
|
200
|
+
```
|
201
|
+
|
202
|
+
**`bank_id`**
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
```json
|
207
|
+
{
|
208
|
+
"type": "string",
|
209
|
+
"format": "uuid"
|
210
|
+
}
|
211
|
+
```
|
212
|
+
|
213
|
+
**`request_id`**
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
```json
|
218
|
+
{
|
219
|
+
"type": "string",
|
220
|
+
"format": "uuid"
|
221
|
+
}
|
222
|
+
```
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
成功したときは
|
227
|
+
[TransactionDetail](./responses.md#transaction-detail)
|
228
|
+
を返します
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
---
|
233
|
+
|
234
|
+
|
235
|
+
|