Transaction の更新
作成されたトランザクションをオープンやクローズ、またはキャンセルします。
備考
Mobage Bank API の使い方
Bank API の詳細な使い方について、下記の各ページをご参照下さい。
ngCore SDK | Native SDK | Unity SDK
URI Fragment
/bank/debit/@app/{transactionId}
署名方式
OAuth2
HTTP メソッド
PUT
リクエストヘッダー
- Authorization は必須になります。例に示した "Authorization: bearer oauth2_token" を HTTP ヘッダーに追加して下さい。
- Content-Type: application/json; charset=utf-8
URL クエリパラメータ
| パラメータ名 | 型 | 説明 | 必須 |
|---|---|---|---|
| fileds | リスト | "state"だけ指定可能 | No |
| format | 文字列 | "json"を指定して下さい | No |
リクエスト本文
下記キーと値を持つ JSON 文字列。
{
"state":"open" // either "open", "closed" or "canceled"
}
レスポンスコード
| HTTP Status Code | HTTP Status Message | Meaning |
|---|---|---|
| 202 | Accepted | Request was accepted for processing. |
| 400 | Bad Request | Corrupt request data on the client side |
| 401 | Unauthorized | Authorization error |
| 403 | Forbidden | The resource exists, but access is not possible due to a reason other than an authorization error. |
| 404 | Not Found | The resource does not exist. |
| 409 | Conflict | Illegal state. |
| 500 | Internal Server Error | An error on the API server side |
| 503 | Service Unavailable | The API cannot be used temporarily |
レスポンス本文
-
成功の場合、更新されたトランザクションが返ってきます。
-
Content-Type: application/json; charset=utf-8
パラメータ名 説明 published トランザクションが作成された時間 comment トランザクションに対するコメント id トランザクション ID updated トランザクションが更新された時間 items アイテム配列。ただいまアイテムは 1 つだけ指定可能 items[].item 下記パラメータを持つオブジェクト items[].item.imageUrl アイテム画像の URL items[].item.name アイテム名 items[].item.id 購入対象アイテム ID items[].item.price アイテム価格 items[].item.description アイテムの説明文 items[].quantity 本トランザクションで購入するアイテム個数 state トランザクションのステート
実例
Base String
// OAuth2 認証では Base String は必要ありません。
Http リクエスト
PUT /social/api/restful/v2.02/bank/debit/@app/EBF8C5E8-D722-3F49-8F2F-60595A4C6F30?fields=state HTTP/1.1
Host: ssl.sb.sp.mbga-platform.jp
Accept-Encoding: gzip
Authorization: bearer c885aa1e5a99504e54843e5952fb5793
Accept: */*
Content-Type: application/json; charset=utf-8
Content-Length: 16
Expect: 100-continue
{"state":"open"}
HTTP レスポンス
HTTP/1.0 202 Accepted
Content-Type: application/json; charset=utf-8
Content-Length: 349
Connection: close
Date: Sun, 29 Sep 2013 12:29:36 GMT
Server: Unknown
{"published":"2013-09-29T12:28:26","comment":"Purchase of 2 Sample Item(s)","id":"EBF8C5E8-D722-3F49-8F2F-60595A4C6F30","updated":"2013-09-29T12:29:36","items":[{"item":{"imageUrl":"http://mobage.com/homepage-assets/images/icon.png","name":"Sample Item","id":"item_1","price":100,"description":"This is a sample item"},"quantity":2}],"state":"open"}