• プラグイン一覧
    - 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 > クラス > Utils
レファレンス
バージョン
2.6.4
絞り込み:

目次

  • ソース
  • 関数

フック

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

ファンクション

    クラス

    Utils

    Admin utils

    ソース #ソース

    ファイル: src/V1/Utils.php

    final class Utils
    {
        /**
         * Prevents instantiation of this class.
         *
         * @throws Exception Thrown if instantiation is attempted.
         */
        private function __construct() {
            throw new Exception("Can't create instance of this class");
        }
    
        /**
         * Prepares error response object for nag dialog box.
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @param string $method
         * @param string $amazon_order_status
         * @return array
         */
        public static function adminErrorResponse($method, $amazon_order_status) {
            $res = [];
            switch ($amazon_order_status) {
                case 'captured':
                    $res['message'] = __('This order has already been captured. It cannot be modified.', 'wcexaap');
                    break;
                case 'canceled':
                    $res['message'] = __('This order has already been cancelled. It cannot be modified.', 'wcexaap');
                    break;
            }
            $res['method'] = $method;
            $res['status'] = 'error';
            return $res;
        }
    
        /**
         * Prepares admin message string to be displayed at the top of the admin panel.
         *
         * @author Evan D Shaw <evandanielshaw@gmail.com>
         * @param int     $order_id
         * @param string  $status
         * @param string  $message
         * @param boolean $success_msg
         * @return string
         */
        public static function adminMessageString($order_id, $status, $message, $success_msg = false) {
            $msgstr = '';
            switch ($status) {
                case 'error':
                    $msgstr = 'ERROR (ORDER_ID ' . $order_id . ')<br/>[Amazon Pay] -> ' . $message;
                    break;
                case 'success':
                    if ($success_msg) {
                        $msgstr = 'SUCCESS (ORDER_ID ' . $order_id . ')<br/>[Amazon Pay] -> ' . $message;
                    }
                    break;
            }
            return $msgstr;
        }
    }
    

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


    関数 #関数

    Top ↑

    • __construct — Prevents instantiation of this class.
    • adminErrorResponse — Prepares error response object for nag dialog box.
    • adminMessageString — Prepares admin message string to be displayed at the top of the admin panel.

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

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

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

    © 2025 Aivec llc All Rights Reserved.