• プラグイン一覧
    - WCEX Item Combo Set
    - WCEX Amazon Pay
    - WCEX Wishlist お気に入りリスト
  • リリース情報
  • お役立ちコラム
  • お問い合わせ
  • サポート
    • よくある質問
      • WCEX Amazon Pay
      • WCEX Wishlist お気に入りリスト
      • wcex-item-combo-set
    • リファレンス
      • WCEX Amazon Pay
      • WCEX Wishlist お気に入りリスト
      • wcex-item-combo-set
新規会員登録
ログイン
新規会員登録
ログイン
カート
  • プラグイン一覧
    • - WCEX Item Combo Set
    • - WCEX Amazon Pay
    • - WCEX Wishlist お気に入りリスト
  • リリース情報
  • お役立ちコラム
  • サポート
    • - よくある質問
      • - WCEX Amazon Pay
      • - WCEX Wishlist お気に入りリスト
      • - wcex-item-combo-set
    • - リファレンス
      • - WCEX Amazon Pay
      • - WCEX Wishlist お気に入りリスト
      • - wcex-item-combo-set
  • お問い合わせ
Aivec APPs > WCEX Amazon Pay > クラス > Log
レファレンス
バージョン
2.6.4
絞り込み:

目次

  • ソース
  • 関数

フック

  • アクション
  • フィルター

ファンクション

    クラス

    Log

    Represents a log to insert into usces_log table

    ソース #ソース

    ファイル: src/Models/Log.php

    class Log implements JsonSerializable
    {
    
        const LOG_TYPE = 'amazonpay_transaction_history';
        const RESPONSE_OK = 'OK';
        const ACTION_DEFERRED_AUTHORIZE = 'deferred-authorize';
        const ACTION_AUTHORIZE = 'authorize';
        const ACTION_ASYNC_AUTHORIZE = 'async-authorize';
        const ACTION_CAPTURE_PAYMENTS = 'capture';
        const ACTION_AUTHORIZE_AND_CAPTURE = 'authorize-and-capture';
        const ACTION_ASYNC_CAPTURE_PAYMENTS = 'async-capture';
        const ACTION_CANCEL_TRANS = 'cancel';
        const ACTION_ASYNC_REFUND = 'async-refund';
        const ACTION_REFUND = 'refund';
    
        /**
         * 取引ID
         *
         * @var string
         */
        private $chargePermissionId;
    
        /**
         * Current local timestamp
         *
         * @var string
         */
        private $timestamp;
    
        /**
         * 処理区分
         *
         * @var string
         */
        private $actionType;
    
        /**
         * Only set if an error occured.
         *
         * @var GenericError|null
         */
        private $error;
    
        /**
         * 処理結果
         *
         * @var string
         */
        private $responseCode;
    
        /**
         * Authorize, capture, or refund amount
         *
         * @var null|int
         */
        private $amount;
    
        /**
         * Creates a `Log` instance for passing to `Logger`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @param string            $chargePermissionId
         * @param string            $actionType
         * @param string            $responseCode
         * @param int               $amount
         * @param GenericError|null $error
         * @param string            $timestamp
         * @return void
         */
        public function __construct(
            $chargePermissionId,
            $actionType,
            $responseCode,
            $amount = null,
            $error = null,
            $timestamp = null
        ) {
            $this->chargePermissionId = $chargePermissionId;
            $this->actionType = $actionType;
            $this->responseCode = $responseCode;
            $this->amount = $amount;
            $this->error = $error;
            $this->timestamp = !empty($timestamp) ? $timestamp : current_time('mysql');
        }
    
        /**
         * Returns action type text translation for a given action key
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @param string $key
         * @return string
         */
        public static function getActionTypeText($key) {
            $actionType = '';
            switch ($key) {
                case self::ACTION_DEFERRED_AUTHORIZE:
                    $actionType = __('Back-order', 'wcexaap');
                    break;
                case self::ACTION_AUTHORIZE: // 与信
                    $actionType = __('Authorize Payment', 'wcexaap');
                    break;
                case self::ACTION_ASYNC_AUTHORIZE: // 与信(非同期)
                    $actionType = __('Async Authorize Payment', 'wcexaap');
                    break;
                case self::ACTION_CAPTURE_PAYMENTS: // 売上計上
                    $actionType = __('Capture', 'wcexaap');
                    break;
                case self::ACTION_AUTHORIZE_AND_CAPTURE: // 与信売上計上
                    $actionType = __('Authorize and Capture', 'wcexaap');
                    break;
                case self::ACTION_ASYNC_CAPTURE_PAYMENTS: // 売上計上(非同期)
                    $actionType = __('Async Capture Payment', 'wcexaap');
                    break;
                case self::ACTION_CANCEL_TRANS: // 取消
                    $actionType = __('Cancel', 'wcexaap');
                    break;
                case self::ACTION_ASYNC_REFUND: // 返金(非同期)
                    $actionType = __('Async Refund', 'wcexaap');
                    break;
                case self::ACTION_REFUND: // 返金
                    $actionType = __('Refund', 'wcexaap');
                    break;
            }
    
            return $actionType;
        }
    
        /**
         * Object shape for `json_encode`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return array
         */
        public function jsonSerialize() {
            return [
                'chargePermissionId' => $this->chargePermissionId,
                'actionType' => $this->actionType,
                'responseCode' => $this->responseCode,
                'amount' => $this->amount,
                'error' => $this->error,
                'timestamp' => $this->timestamp,
            ];
        }
    
        /**
         * Overrides amount value
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @param int|string $amount
         * @return void
         */
        public function setAmount($amount) {
            $this->amount = $amount;
        }
    
        /**
         * Getter for `$chargePermissionId`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return string
         */
        public function getChargePermissionId() {
            return $this->chargePermissionId;
        }
    
        /**
         * Getter for `$timestamp`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return string
         */
        public function getTimestamp() {
            return $this->timestamp;
        }
    
        /**
         * Getter for `$actionType`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return string
         */
        public function getActionType() {
            return $this->actionType;
        }
    
        /**
         * Getter for `$error`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return GenericError|null
         */
        public function getError() {
            return $this->error;
        }
    
        /**
         * Getter for `$responseCode`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return string
         */
        public function getResponseCode() {
            return $this->responseCode;
        }
    
        /**
         * Getter for `$amount`
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @return int|null
         */
        public function getAmount() {
            return $this->amount;
        }
    }
    

    ソースを伸ばす ソースを縮める


    関数 #関数

    Top ↑

    • __construct — Creates a `Log` instance for passing to `Logger`
    • getActionType — Getter for `$actionType`
    • getActionTypeText — Returns action type text translation for a given action key
    • getAmount — Getter for `$amount`
    • getChargePermissionId — Getter for `$chargePermissionId`
    • getError — Getter for `$error`
    • getResponseCode — Getter for `$responseCode`
    • getTimestamp — Getter for `$timestamp`
    • jsonSerialize — Object shape for `json_encode`
    • setAmount — Overrides amount value

    • 新規会員登録
    • ログイン
      • プラグイン一覧
      • 会社概要
      • リリース情報
      • よくある質問
      • お役立ちコラム
      • お問い合わせ
      • 個人情報保護方針
      • 特定商取引法に基づく表記
      • 情報セキュリティ基本方針
      • 利用規約

    アイベック合同会社は「Welcart」「Amazon Pay」の公式パートナーです。

    ※Amazon、Amazon.co.jp、Amazon Payおよびそれらのロゴは、Amazon.com,inc.またはその関連会社の商標です。
    ※LINE Pay、およびLINE Pay 提携サービスのロゴは、法律上保護を受ける商標です。

    © 2025 Aivec llc All Rights Reserved.