Event(イベント)
Event(イベント)APIを使用すると、加盟店アカウント上で生成されたEvent を検索できます。Event(新しい顧客の作成や課金の取消など)は、HTTP POST リクエストやOpn PaymentsサーバーのWebHooks
を起動することで、フレキシブルな 自動化を提供します。サポート済みイベントの詳細については、 WebHooks documentationをご参照ください。
Attributes
Name | Type | Description |
---|---|---|
object | string | 固定値 |
id | string |
|
livemode | boolean | 本番モード ( |
location | string | 現在の |
created | string | イベントが作成されたISO 8601 形式( |
data | object | 発生したイベントに関連付けられたオブジェクト。 |
key | string | イベントの状態(例: |
team_uid | string | イベントをトリガーしたサブマーチャントのIDです。 注: このフィールドは、加盟店がプラットフォーム向けソリューションを導入している場合にのみ適用されます。 |
Example
-
JSON Response
{ "object": "event", "livemode": false, "location": "/events/evnt_test_no1t4tnemucod0e51mo", "data": { "object": "charge", "id": "chrg_test_no1t4tnemucod0e51mo", "location": "/charges/chrg_test_no1t4tnemucod0e51mo", "amount": 12345, "authorization_type": null, "authorized_amount": 12345, "captured_amount": 12345, "net": 11862, "fee": 451, "fee_vat": 32, "interest": 0, "interest_vat": 0, "funding_amount": 12345, "refunded_amount": 0, "transaction_fees": { "fee_flat": "0.0", "fee_rate": "3.65", "vat_rate": "7.0" }, "platform_fee": { "fixed": null, "amount": null, "percentage": null }, "currency": "THB", "funding_currency": "THB", "ip": "203.0.113.1", "refunds": { "object": "list", "data": [], "limit": 20, "offset": 0, "total": 0, "location": "/charges/chrg_test_no1t4tnemucod0e51mo/refunds", "order": "chronological", "from": "1970-01-01T00:00:00Z", "to": "2019-12-31T12:59:59Z" }, "link": null, "description": null, "metadata": { "order_id": "P26042018-01", "color": "pink" }, "card": { "object": "card", "id": "card_test_no1t4tnemucod0e51mo", "livemode": false, "location": null, "deleted": false, "street1": "1448/4 Praditmanutham Road", "street2": null, "city": "Bangkok", "state": null, "phone_number": "0123456789", "postal_code": "10320", "country": "th", "financing": "credit", "bank": "Bank of the Unbanked", "brand": "Visa", "fingerprint": "XjOdjaoHRvUGRfmZacMPcJtm0U3SEIIfkA7534dQeVw=", "first_digits": null, "last_digits": "4242", "name": "Somchai Prasert", "expiration_month": 12, "expiration_year": 2024, "security_code_check": true, "tokenization_method": null, "created_at": "2019-12-31T12:59:59Z" }, "source": null, "schedule": null, "customer": null, "dispute": null, "transaction": "trxn_test_no1t4tnemucod0e51mo", "failure_code": null, "failure_message": null, "status": "successful", "authorize_uri": "https://api.omise.co/payments/paym_test_no1t4tnemucod0e51mo/authorize", "return_uri": "https://www.example.com/orders/54321/complete", "created_at": "2019-12-31T12:59:59Z", "paid_at": "2019-12-31T12:59:59Z", "expires_at": "2019-12-31T12:59:59Z", "expired_at": null, "reversed_at": null, "zero_interest_installments": true, "branch": null, "terminal": null, "device": null, "authorized": true, "capturable": false, "capture": true, "disputable": true, "livemode": false, "refundable": true, "reversed": false, "reversible": false, "voided": false, "paid": true, "expired": false }, "id": "evnt_test_no1t4tnemucod0e51mo", "key": "charge.create", "created": "2019-12-31T12:59:59Z" }
振込情報リストの取得
- GET https://api.omise.co/eventseventに属するすべての お客様のアカウントオブジェクトの list を返します。
Request Parameters
Name | Type | Description |
---|---|---|
from | string | (任意, default: |
limit | integer | (任意, default: |
offset | integer | (任意, default: |
order | string | (任意, default: |
to | string | (任意) ISO 8601形式 ( |
Example
-
イベント情報リストの取得
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
curl https://api.omise.co/events \ -u $OMISE_SECRET_KEY:
$events = OmiseEvent::retrieve();
const omise = require('omise')({ secretKey: 'skey_test_no1t4tnemucod0e51mo', }); const event = await omise.events.list(); console.log(event);
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" events = Omise::Event.list
var events = await Client.Events.GetList(order: Ordering.ReverseChronological); Console.WriteLine($"total events: {events.Total}");
ScopedList<Event> events = client.events().list(); System.out.printf("no. of events: %d", events.getTotal());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" events = omise.Event.retrieve()
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.EventList{} err := client.Do(result, &operations.ListEvents{}) if err != nil { log.Fatalln(err) } log.Println(result)
Omise.configure(secret_key: "skey_test_4xs8breq3htbkj03d2x") Omise.Event.list
List events for charge
- GET https://api.omise.co/charges/{id}/eventsReturns a list of events belonging to charge matching :id
.
Request Parameters
Name | Type | Description |
---|---|---|
from | string | (任意, default: |
limit | integer | (任意, default: |
offset | integer | (任意, default: |
order | string | (任意, default: |
to | string | (任意) ISO 8601形式 ( |
イベント情報の取得
- GET https://api.omise.co/events/{id}既存のイベントオブジェクトを返します 。
Example
-
イベント情報の取得
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
curl https://api.omise.co/events/evnt_test_5fzo43xgisxdvptf77i \ -u $OMISE_SECRET_KEY:
$event = OmiseEvent::retrieve('event_id');
const omise = require('omise')({ secretKey: 'skey_test_no1t4tnemucod0e51mo', }); const event = await omise.events.retrieve('evnt_test_no1t4tnemucod0e51mo'); console.log(event);
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" event = Omise::Event.retrieve("evnt_test_52cin5n9bb6lytxduh9")
var ev = await Client.Events.Get("evnt_test_58fffxu2gn498pb03pd"); Console.WriteLine($"event action: {ev.Key} {ev.Data.Id}");
Event event = client.events().get("evnt_test_5vxs0ajpo78"); System.out.printf("key of event: %s", event.getKey());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" event = omise.Event.retrieve("evnt_test_no1t4tnemucod0e51mo") # After retrieving it, the event can be refreshed: event.reload()
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.Event{} err := client.Do(result, &operations.RetrieveEvent{ EventID: "evnt_test_no1t4tnemucod0e51mo", }) if err != nil { log.Fatalln(err) } log.Println(result)
Omise.configure(secret_key: "skey_test_4xs8breq3htbkj03d2x") Omise.Event.retrieve("evnt_test_52cin5n9bb6lytxduh9")