📘 公式リファレンス📦 リファレンス/オブジェクト中級
transaction オブジェクト
決済トランザクションの詳細情報を扱うオブジェクト。注文やチェックアウト時の支払い履歴、ステータス、金額、決済プロバイダーの情報を保持する。
用途
注文確認メールやアカウント画面で決済状況を表示したり、管理画面の注文詳細から支払い内容を確認したいとき。
設置場所
{{ order.transactions }} または {{ checkout.transactions }} でトランザクション配列にアクセスし、ループ内で {{ transaction.status }}、{{ transaction.amount | money }}、{{ transaction.created_at | date }}などのプロパティを参照する。
注意点
amount は通貨の最小単位(円は1/100単位)で返されるため、金額表示には `money` フィルターを必ず適用する。JPY や KRW など小数点を持たない通貨でも10倍された値が返されるため、raw 値での計算は避けること。created_at はタイムスタンプ文字列なので、`date` フィルターで整形する。
仕様
296 行 / json{
"access": {
"global": false,
"parents": [
{
"object": "checkout",
"property": "transactions"
},
{
"object": "order",
"property": "transactions"
}
],
"template": []
},
"deprecated": false,
"deprecation_reason": "",
"description": "",
"properties": [
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "number",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The ID of the transaction.",
"name": "id"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The name of the transaction.",
"name": "name"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "string",
"name": "success",
"description": "",
"array_value": ""
},
{
"type": "string",
"name": "pending",
"description": "",
"array_value": ""
},
{
"type": "string",
"name": "failure",
"description": "",
"array_value": ""
},
{
"type": "string",
"name": "error",
"description": "",
"array_value": ""
}
],
"summary": "The status of the transaction.",
"name": "status"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "> Tip:\n> Use the [`date` filter](/docs/api/liquid/filters/date) to format the timestamp.",
"examples": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "A timestamp of when the transaction was created.",
"name": "created_at"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "This includes things like whether the payment was a test, or an authorization code if there was one.",
"examples": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "Information from the payment provider about the payment receipt.",
"name": "receipt"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "string",
"name": "authorization",
"description": "The reserving of money that the customer has agreed to pay.",
"array_value": ""
},
{
"type": "string",
"name": "capture",
"description": "The transfer of the money that was reserved during the `authorization` step.",
"array_value": ""
},
{
"type": "string",
"name": "sale",
"description": "A combination of `authorization` and `capture` in one step.",
"array_value": ""
},
{
"type": "string",
"name": "void",
"description": "The cancellation of a pending `authorization` or `capture`.",
"array_value": ""
},
{
"type": "string",
"name": "refund",
"description": "The partial, or full, refund of captured funds.",
"array_value": ""
}
],
"summary": "The type of transaction.",
"name": "kind"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The [handleized](/docs/api/liquid/basics#modifying-handles) name of the payment provider used for the transaction.",
"name": "gateway"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The status of the transaction, translated based on the current locale.",
"name": "status_label"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "transaction_payment_details",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The transaction payment details.",
"name": "payment_details"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "The amount is in the customer's local (presentment) currency.\n\nFor currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000.\n\n> Tip:\n> Use [money filters](/docs/api/liquid/filters/money-filters) to output a formatted amount.",
"examples": [],
"return_type": [
{
"type": "number",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The amount of the transaction in the currency's subunit.",
"name": "amount"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The name of the payment provider used for the transaction.",
"name": "gateway_display_name"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "boolean",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "Whether the transaction is pending, and whether additional customer info is required to process the payment.",
"name": "show_buyer_pending_payment_instructions?"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "A notice that contains instructions for the customer on how to complete their payment.\nThe messages are specific to the payment method used.",
"name": "buyer_pending_payment_notice"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "array",
"name": "",
"description": "",
"array_value": "pending_payment_instruction_input"
}
],
"summary": "A list of `pending_payment_instruction_input` header-value pairs, with payment method-specific details.\nThe customer can use these details to complete their purchase offline.\n\nIf the payment method doesn’t support pending payment instructions, then an empty array is returned.\n\n| Supported payment method | Expected Values |\n| --- | ----------- |\n| ShopifyPayments - Multibanco | [{header=\"Entity\", value=\"12345\"}, {header=\"Reference\", value=\"999999999\"}] |",
"name": "buyer_pending_payment_instructions"
}
],
"summary": "A transaction associated with a checkout or order.",
"name": "transaction",
"examples": [],
"json_data": {
"path": "/",
"handle": "customer.orders[1].transactions[0]",
"data_from_file": ""
},
"return_type": []
}出典・ライセンス
- Repository:
- https://github.com/Shopify/theme-liquid-docs
- License:
- MIT
このコードは Shopify 著作の MIT ライセンスソースです。 原本の著作権は Shopify が保有します。日本語訳は ALSEL によるものです。
関連項目
📘 公式リファレンス📦 リファレンス/オブジェクト初級
content_for_header オブジェクト
Shopify が必要とするスクリプト(分析・チェックアウト・言語設定など)をすべて動的に出力するオブジェクト。theme.liquid の <head> タグ内に埋め込む必須要素。
📁 theme-liquid-docs·MIT·20 行
📘 公式リファレンス📦 リファレンス/オブジェクト中級
metaobjects オブジェクト
ストア全体のメタオブジェクト定義にアクセスするグローバルオブジェクト。個別のメタオブジェクトはタイプとハンドルで参照でき、メタオブジェクト定義のエントリをループで反復処理できる。
📁 theme-liquid-docs·MIT·20 行
📘 公式リファレンス📦 リファレンス/オブジェクト初級
additional_checkout_buttons オブジェクト
PayPal Express Checkout など、オフサイト決済に対応した外部決済プロバイダーがストアに設定されているかを真偽値で返す。`content_for_additional_checkout_buttons` と組み合わせて、該当するチェックアウトボタンを条件付きで表示する。
📁 theme-liquid-docs·MIT·27 行
📘 公式リファレンス📦 リファレンス/オブジェクト初級
canonical_url オブジェクト
現在のページの正規 URL を取得するオブジェクト。Google などの検索エンジンに対してどのページ版が正規であるかを指定するために使用する。
📁 theme-liquid-docs·MIT·27 行
📘 公式リファレンス📦 リファレンス/オブジェクト初級
content_for_index オブジェクト
ホームページに表示するセクションの内容を動的に返すオブジェクト。Liquid インデックステンプレートで必ず使用する。
📁 theme-liquid-docs·MIT·27 行
📘 公式リファレンス📦 リファレンス/オブジェクト初級
content_for_additional_checkout_buttons オブジェクト
PayPal、Apple Pay、Google Pay など複数の決済プロバイダが有効になっているとき、その決済ボタンを HTML として出力するオブジェクト。`additional_checkout_buttons` で有無を判定したうえで、このオブジェクトで実際のボタンを表示する。
📁 theme-liquid-docs·MIT·27 行