Payment
payment.get
決済情報を取得する為の API です。
API の定義
| REST Base URI | http://app.mbga-platform.jp/social/api/restful/v2 ( Service ) http://app.sb.mbga-platform.jp/social/api/restful/v2 ( Sandbox ) |
| REST HTTP Method | GET |
| REST URI Fragment | ``` payment/{userId}/{groupId}/{appId}{-prefix |
| REST Query Parameters | GetPayment-Request-Parameters |
| Return Object | Payment |
認可
| type | permission | description |
|---|---|---|
| ANONYMOUS | false | 未認証でのアクセス |
| SECURITY_TOKEN | false | セキュリティトークンを用いた認証 |
| OAUTH_MOBILE | false | モバイル用で発行された OAuth Token を用いた認証 |
| OAUTH_CONSUMER | true | Consumer Request を用いた認証 |
RESTful API レスポンスコード
| HTTP Status Code | HTTP Status Message | JSON-RPC Error Codes | Meaning |
|---|---|---|---|
| 200 | OK | – | データの取得が成功した場合 |
| 400 | Bad Request | -32700, -32600, -32601, -32602, 400 | クライアント側のリクエストデータが不正です |
| 401 | Unauthorized | 401 | 認証エラーです |
| 403 | Forbidden | 403 | リソースは存在するが認証エラー以外の理由でアクセス出来ない場合です |
| 404 | Not Found | 404 | 存在しないリソースです |
| 405 | Method Not Allowed | 405 | その操作が許可されていない場合です |
| 500 | Internal Server Error | -32603 | API サーバー側のエラーです |
| 503 | Service Unavailable | – | 一時的に API が利用不可となっている場合です |
JSON-RPC エラーコード
エラー時の Error オブジェクトの code フィールドに含まれる値です。
| RPC Code | Meaning |
|---|---|
| -32700 (Parse error) | 不正な JSON format です |
| -32600 (Invalid Request) | 不正な JSON-RPC リクエストです |
| -32601 (Method not found) | 存在しないメソッドまたは利用不能なメソッドです |
| -32602 (Invalid params) | 不正な API リクエストパラメータです |
| -32603 (Internal server error) | API サーバー側のエラーです |
| 400 (Bad Request) | 他のエラーに該当しないクライアント側の不正なリクエストです |
| 401 (Unauthorized) | 認証エラーです |
| 403 (Forbidden) | リソースは存在するが認証エラー以外の理由でアクセス出来ない場合です |
| 404 (Not Found) | 存在しないリソースです |
| 405 (Method Not Allowed) | その操作が許可されていない場合です |
データ型
Get-Payment-Request-Parameters
userId, groupId, appId, paymentId は URI Template Parameters として指定し、それ以外のパラメータは Query String として指定します。
| Name | Type | Description |
|---|---|---|
| userId | UserId | Required |
| groupId | GroupId | Required '@self' のみ指定可能 |
| appId | AppId | Required '@app' のみ指定可能 |
| paymentId | PaymentId | Required UUID形式 |
ベースとなるデータ型
- Starndard-Request-Parameters
Starndard-Request-Parameters
サポートしているフィールド一覧は下記になります。
| Name | Type | Description |
|---|---|---|
| format | String | Optional 'json' のみ指定可能 |
詳しくは 6.1 Standard Request Parameters - OpenSocial Core API Server Specification をご参照下さい。
Payment
| Name | Type | Description |
|---|---|---|
| id | String | Payment オブジェクトの id 値です。UUID 形式です。 |
| appId | Integer | この決済トランザクションを行うアプリケーションの id です。 |
| userId | String | この決済トランザクションを行うユーザーの guid です。 |
| status | Integer | この決済トランザクションのステータス値です。 |
| entry | Array | PaymentEntry オブジェクトのコレクションです。 |
| callbackUrl | String | パートナー様側の決済完了通知用の URL (モバイル用) |
| finishUrl | String | パートナー様側の決済終了画面用の URL (モバイル用) |
| endpointUrl | String | この決済トランザクションを実行する Mobage 側の URL |
| deviceId | String | 決済を行った device の 種別です。PC: PC / Mobile: 携帯 |
| published | Date | 生成日時 |
| updated | Date | 更新日時 |
status カラム値
| 値 | 説明 |
|---|---|
| 0 | 決済開始時 |
| 1 | エラー |
| 10 | 成功 |
PaymentEntry
| Name | Type | Description |
|---|---|---|
| paymentId | String | Payment オブジェクトの id。 |
| itemId | Integer | パートナー様がアイテムを区別するための識別子です。(SKU_ID と同じです) |
| name | String | アイテムの名称です。 |
| unitPrice | Integer | アイテムの単価 (コイン) です。 |
| amount | Integer | アイテムの購入個数です。 |
| imageUrl | String | アイテム画像のあるURLです。 |
| description | String | アイテムの説明文です。 |
サンプルデータ
RESTful API
Payment情報を取得する
GET /social/api/restful/v2/payment/99999/@self/@app/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Host: app.sb.mbga-platform.jp
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"entry" : [
{
"itemId" : 1,
"amount" : 5,
"imageUrl" : "http://example.com/img/example.gif",
"paymentId" : "3E37C512-6891-35C1-84FE-B081B5443997",
"name" : "金庫",
"unitPrice" : 100,
"description" : "今は購入出来ない伝説のアイテムです"
}
],
"status" : 10,
"userId" : "sb.mbga.jp:99999",
"endpointUrl" : "",
"appId" : 99999999,
"callbackUrl" : "",
"finishUrl" : "",
"id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"deviceId": "PC",
"published" : "2010-02-15T11:21:58",
"updated" : "2010-02-15T11:21:58"
}
更新履歴
- 2010/12/09
- status カラム値 から "キャンセル" を削除