acting_name = 'e-SCOTT'; $this->acting_formal_name = 'e-SCOTT Smart'; $this->acting_card = 'escott_card'; $this->acting_conv = 'escott_conv'; $this->acting_atodene = ''; $this->acting_flg_card = 'acting_escott_card'; $this->acting_flg_conv = 'acting_escott_conv'; $this->acting_flg_atodene = ''; $this->pay_method = array( 'acting_escott_card', 'acting_escott_conv', ); $this->merchantfree3 = 'wc1collne'; $this->quick_key_pre = 'escott'; parent::__construct( 'escott' ); $this->initialize_data(); } /** * Return an instance of this class. */ public static function get_instance() { if ( is_null( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } /** * Initialize. */ public function initialize_data() { $options = get_option( 'usces', array() ); $options['acting_settings']['escott']['merchant_id'] = ( isset( $options['acting_settings']['escott']['merchant_id'] ) ) ? $options['acting_settings']['escott']['merchant_id'] : ''; $options['acting_settings']['escott']['merchant_pass'] = ( isset( $options['acting_settings']['escott']['merchant_pass'] ) ) ? $options['acting_settings']['escott']['merchant_pass'] : ''; $options['acting_settings']['escott']['tenant_id'] = ( isset( $options['acting_settings']['escott']['tenant_id'] ) ) ? $options['acting_settings']['escott']['tenant_id'] : '0001'; $options['acting_settings']['escott']['ope'] = ( isset( $options['acting_settings']['escott']['ope'] ) ) ? $options['acting_settings']['escott']['ope'] : 'test'; $options['acting_settings']['escott']['card_activate'] = ( isset( $options['acting_settings']['escott']['card_activate'] ) ) ? $options['acting_settings']['escott']['card_activate'] : 'off'; $options['acting_settings']['escott']['card_key_aes'] = ( isset( $options['acting_settings']['escott']['card_key_aes'] ) ) ? $options['acting_settings']['escott']['card_key_aes'] : ''; $options['acting_settings']['escott']['card_key_iv'] = ( isset( $options['acting_settings']['escott']['card_key_iv'] ) ) ? $options['acting_settings']['escott']['card_key_iv'] : ''; $options['acting_settings']['escott']['seccd'] = ( isset( $options['acting_settings']['escott']['seccd'] ) ) ? $options['acting_settings']['escott']['seccd'] : 'on'; $options['acting_settings']['escott']['sec3d_activate'] = ( isset( $options['acting_settings']['escott']['sec3d_activate'] ) ) ? $options['acting_settings']['escott']['sec3d_activate'] : 'off'; $options['acting_settings']['escott']['token_code'] = ( isset( $options['acting_settings']['escott']['token_code'] ) ) ? $options['acting_settings']['escott']['token_code'] : ''; $options['acting_settings']['escott']['quickpay'] = ( isset( $options['acting_settings']['escott']['quickpay'] ) ) ? $options['acting_settings']['escott']['quickpay'] : 'off'; $options['acting_settings']['escott']['chooseable_quickpay'] = ( isset( $options['acting_settings']['escott']['chooseable_quickpay'] ) ) ? $options['acting_settings']['escott']['chooseable_quickpay'] : 'on'; $options['acting_settings']['escott']['operateid'] = ( isset( $options['acting_settings']['escott']['operateid'] ) ) ? $options['acting_settings']['escott']['operateid'] : '1Gathering'; $options['acting_settings']['escott']['howtopay'] = ( isset( $options['acting_settings']['escott']['howtopay'] ) ) ? $options['acting_settings']['escott']['howtopay'] : '1'; $options['acting_settings']['escott']['conv_activate'] = ( isset( $options['acting_settings']['escott']['conv_activate'] ) ) ? $options['acting_settings']['escott']['conv_activate'] : 'off'; $options['acting_settings']['escott']['conv_limit'] = ( ! empty( $options['acting_settings']['escott']['conv_limit'] ) ) ? $options['acting_settings']['escott']['conv_limit'] : '7'; $options['acting_settings']['escott']['conv_fee_type'] = ( isset( $options['acting_settings']['escott']['conv_fee_type'] ) ) ? $options['acting_settings']['escott']['conv_fee_type'] : ''; $options['acting_settings']['escott']['conv_fee'] = ( isset( $options['acting_settings']['escott']['conv_fee'] ) ) ? $options['acting_settings']['escott']['conv_fee'] : ''; $options['acting_settings']['escott']['conv_fee_limit_amount'] = ( isset( $options['acting_settings']['escott']['conv_fee_limit_amount'] ) ) ? $options['acting_settings']['escott']['conv_fee_limit_amount'] : ''; $options['acting_settings']['escott']['conv_fee_first_amount'] = ( isset( $options['acting_settings']['escott']['conv_fee_first_amount'] ) ) ? $options['acting_settings']['escott']['conv_fee_first_amount'] : ''; $options['acting_settings']['escott']['conv_fee_first_fee'] = ( isset( $options['acting_settings']['escott']['conv_fee_first_fee'] ) ) ? $options['acting_settings']['escott']['conv_fee_first_fee'] : ''; $options['acting_settings']['escott']['conv_fee_amounts'] = ( isset( $options['acting_settings']['escott']['conv_fee_amounts'] ) ) ? $options['acting_settings']['escott']['conv_fee_amounts'] : array(); $options['acting_settings']['escott']['conv_fee_fees'] = ( isset( $options['acting_settings']['escott']['conv_fee_fees'] ) ) ? $options['acting_settings']['escott']['conv_fee_fees'] : array(); $options['acting_settings']['escott']['conv_fee_end_fee'] = ( isset( $options['acting_settings']['escott']['conv_fee_end_fee'] ) ) ? $options['acting_settings']['escott']['conv_fee_end_fee'] : ''; $options['acting_settings']['escott']['atodene_activate'] = 'off'; $options['acting_settings']['escott']['activate'] = ( isset( $options['acting_settings']['escott']['activate'] ) ) ? $options['acting_settings']['escott']['activate'] : 'off'; update_option( 'usces', $options ); $available_settlement = get_option( 'usces_available_settlement', array() ); if ( ! in_array( 'escott', $available_settlement, true ) ) { $available_settlement['escott'] = 'e-SCOTT Smart'; update_option( 'usces_available_settlement', $available_settlement ); } $noreceipt_status = get_option( 'usces_noreceipt_status', array() ); if ( ! in_array( 'acting_escott_conv', $noreceipt_status, true ) ) { $noreceipt_status[] = 'acting_escott_conv'; update_option( 'usces_noreceipt_status', $noreceipt_status ); } $this->unavailable_method = array( 'acting_welcart_card', 'acting_zeus_card', 'acting_zeus_conv', 'acting_sbps_card' ); } /** * Admin scripts. * admin_print_footer_scripts */ public function admin_scripts() { $admin_page = filter_input( INPUT_GET, 'page', FILTER_DEFAULT ); switch ( $admin_page ) : case 'usces_settlement': $settlement_selected = get_option( 'usces_settlement_selected', array() ); if ( in_array( $this->paymod_id, $settlement_selected, true ) ) : $acting_opts = $this->get_acting_settings(); ?> paymod_id ) { return; } $this->error_mes = ''; $options = get_option( 'usces', array() ); $payment_method = usces_get_system_option( 'usces_payment_method', 'settlement' ); $post_data = wp_unslash( $_POST ); unset( $options['acting_settings']['escott'] ); $options['acting_settings']['escott']['merchant_id'] = ( isset( $post_data['merchant_id'] ) ) ? trim( $post_data['merchant_id'] ) : ''; $options['acting_settings']['escott']['merchant_pass'] = ( isset( $post_data['merchant_pass'] ) ) ? trim( $post_data['merchant_pass'] ) : ''; $options['acting_settings']['escott']['tenant_id'] = ( isset( $post_data['tenant_id'] ) ) ? trim( $post_data['tenant_id'] ) : ''; $options['acting_settings']['escott']['ope'] = ( isset( $post_data['ope'] ) ) ? $post_data['ope'] : ''; $options['acting_settings']['escott']['card_activate'] = ( isset( $post_data['card_activate'] ) ) ? $post_data['card_activate'] : 'off'; $options['acting_settings']['escott']['card_key_aes'] = ( isset( $post_data['card_key_aes'] ) ) ? $post_data['card_key_aes'] : ''; $options['acting_settings']['escott']['card_key_iv'] = ( isset( $post_data['card_key_iv'] ) ) ? $post_data['card_key_iv'] : ''; $options['acting_settings']['escott']['seccd'] = ( isset( $post_data['seccd'] ) ) ? $post_data['seccd'] : 'on'; $options['acting_settings']['escott']['sec3d_activate'] = ( isset( $post_data['sec3d_activate'] ) ) ? $post_data['sec3d_activate'] : 'off'; $options['acting_settings']['escott']['token_code'] = ( isset( $post_data['token_code'] ) ) ? trim( $post_data['token_code'] ) : ''; $options['acting_settings']['escott']['quickpay'] = ( isset( $post_data['quickpay'] ) ) ? $post_data['quickpay'] : ''; $options['acting_settings']['escott']['chooseable_quickpay'] = ( isset( $post_data['chooseable_quickpay'] ) ) ? $post_data['chooseable_quickpay'] : 'on'; $options['acting_settings']['escott']['operateid'] = ( isset( $post_data['operateid'] ) ) ? $post_data['operateid'] : '1Gathering'; $options['acting_settings']['escott']['howtopay'] = ( isset( $post_data['howtopay'] ) ) ? $post_data['howtopay'] : ''; $options['acting_settings']['escott']['conv_activate'] = ( isset( $post_data['conv_activate'] ) ) ? $post_data['conv_activate'] : 'off'; $options['acting_settings']['escott']['conv_limit'] = ( ! empty( $post_data['conv_limit'] ) ) ? $post_data['conv_limit'] : '7'; $options['acting_settings']['escott']['conv_fee_type'] = ( isset( $post_data['conv_fee_type'] ) ) ? $post_data['conv_fee_type'] : ''; $options['acting_settings']['escott']['conv_fee'] = ( isset( $post_data['conv_fee'] ) ) ? $post_data['conv_fee'] : ''; $options['acting_settings']['escott']['conv_fee_limit_amount'] = ( isset( $post_data[ 'conv_fee_limit_amount_' . $options['acting_settings']['escott']['conv_fee_type'] ] ) ) ? $post_data[ 'conv_fee_limit_amount_' . $options['acting_settings']['escott']['conv_fee_type'] ] : ''; $options['acting_settings']['escott']['conv_fee_first_amount'] = ( isset( $post_data['conv_fee_first_amount'] ) ) ? $post_data['conv_fee_first_amount'] : ''; $options['acting_settings']['escott']['conv_fee_first_fee'] = ( isset( $post_data['conv_fee_first_fee'] ) ) ? $post_data['conv_fee_first_fee'] : ''; $options['acting_settings']['escott']['conv_fee_amounts'] = ( isset( $post_data['conv_fee_amounts'] ) ) ? explode( '|', $post_data['conv_fee_amounts'] ) : array(); $options['acting_settings']['escott']['conv_fee_fees'] = ( isset( $post_data['conv_fee_fees'] ) ) ? explode( '|', $post_data['conv_fee_fees'] ) : array(); $options['acting_settings']['escott']['conv_fee_end_fee'] = ( isset( $post_data['conv_fee_end_fee'] ) ) ? $post_data['conv_fee_end_fee'] : ''; if ( 'on' === $options['acting_settings']['escott']['card_activate'] || 'on' === $options['acting_settings']['escott']['conv_activate'] ) { $unavailable_activate = false; foreach ( $payment_method as $settlement => $payment ) { if ( in_array( $settlement, $this->unavailable_method, true ) && 'activate' === $payment['use'] ) { $unavailable_activate = true; break; } } if ( $unavailable_activate ) { $this->error_mes .= __( '* Settlement that can not be used together is activated.', 'usces' ) . '
'; } else { if ( WCUtils::is_blank( $post_data['merchant_id'] ) ) { $this->error_mes .= __( '* Please enter the Merchant ID.', 'usces' ) . '
'; } if ( WCUtils::is_blank( $post_data['merchant_pass'] ) ) { $this->error_mes .= __( '* Please enter the Merchant Password.', 'usces' ) . '
'; } if ( WCUtils::is_blank( $post_data['tenant_id'] ) ) { $this->error_mes .= __( '* Please enter the Tenant ID.', 'usces' ) . '
'; } if ( WCUtils::is_blank( $post_data['ope'] ) ) { $this->error_mes .= __( '* Please select the operating environment.', 'usces' ) . '
'; } if ( WCUtils::is_blank( $post_data['operateid'] ) ) { $this->error_mes .= __( '* Please select the processing classification.', 'usces' ) . '
'; } if ( 'on' === $options['acting_settings']['escott']['card_activate'] ) { if ( WCUtils::is_blank( $post_data['token_code'] ) ) { $this->error_mes .= __( '* Please enter the Token auth code.', 'usces' ) . '
'; } } } } if ( '' === $this->error_mes ) { $usces->action_status = 'success'; $usces->action_message = __( 'Options are updated.', 'usces' ); if ( 'on' === $options['acting_settings']['escott']['card_activate'] || 'on' === $options['acting_settings']['escott']['conv_activate'] ) { $options['acting_settings']['escott']['activate'] = 'on'; if ( 'public' === $options['acting_settings']['escott']['ope'] ) { $options['acting_settings']['escott']['send_url'] = 'https://www.e-scott.jp/online/aut/OAUT002.do'; $options['acting_settings']['escott']['send_url_member'] = 'https://www.e-scott.jp/online/crp/OCRP005.do'; $options['acting_settings']['escott']['send_url_conv'] = 'https://www.e-scott.jp/online/cnv/OCNV005.do'; $options['acting_settings']['escott']['redirect_url_conv'] = 'https://link.kessai.info/JLP/JLPcon'; $options['acting_settings']['escott']['api_token'] = 'https://www.e-scott.jp/euser/stn/CdGetJavaScript.do'; $options['acting_settings']['escott']['send_url_token'] = 'https://www.e-scott.jp/online/atn/OATN005.do'; $options['acting_settings']['escott']['send_url_3dsecure'] = 'https://www.e-scott.jp/online/tds/OTDS010.do'; } else { $options['acting_settings']['escott']['send_url'] = 'https://www.test.e-scott.jp/online/aut/OAUT002.do'; $options['acting_settings']['escott']['send_url_member'] = 'https://www.test.e-scott.jp/online/crp/OCRP005.do'; $options['acting_settings']['escott']['send_url_conv'] = 'https://www.test.e-scott.jp/online/cnv/OCNV005.do'; $options['acting_settings']['escott']['redirect_url_conv'] = 'https://link.kessai.info/JLPCT/JLPcon'; $options['acting_settings']['escott']['api_token'] = 'https://www.test.e-scott.jp/euser/stn/CdGetJavaScript.do'; $options['acting_settings']['escott']['send_url_token'] = 'https://www.test.e-scott.jp/online/atn/OATN005.do'; $options['acting_settings']['escott']['send_url_3dsecure'] = 'https://www.test.e-scott.jp/online/tds/OTDS010.do'; $options['acting_settings']['escott']['tenant_id'] = '0001'; } $toactive = array(); if ( 'on' === $options['acting_settings']['escott']['card_activate'] ) { if ( ! empty( $options['acting_settings']['escott']['token_code'] ) ) { $options['acting_settings']['escott']['card_activate'] = 'token'; } } if ( 'on' === $options['acting_settings']['escott']['card_activate'] || 'token' === $options['acting_settings']['escott']['card_activate'] ) { $usces->payment_structure['acting_escott_card'] = __( 'Credit card transaction (e-SCOTT)', 'usces' ); foreach ( $payment_method as $settlement => $payment ) { if ( 'acting_escott_card' === $settlement && 'deactivate' === $payment['use'] ) { $toactive[] = $payment['name']; } } } else { unset( $usces->payment_structure['acting_escott_card'] ); } if ( 'on' === $options['acting_settings']['escott']['conv_activate'] ) { $usces->payment_structure['acting_escott_conv'] = __( 'Online storage agency (e-SCOTT)', 'usces' ); foreach ( $payment_method as $settlement => $payment ) { if ( 'acting_escott_conv' === $settlement && 'deactivate' === $payment['use'] ) { $toactive[] = $payment['name']; } } } else { unset( $usces->payment_structure['acting_escott_conv'] ); } usces_admin_orderlist_show_wc_trans_id(); if ( 0 < count( $toactive ) ) { $usces->action_message .= __( 'Please update the payment method to "Activate". General Setting > Payment Methods', 'usces' ); } } else { $options['acting_settings']['escott']['activate'] = 'off'; unset( $usces->payment_structure['acting_escott_card'] ); unset( $usces->payment_structure['acting_escott_conv'] ); } $deactivate = array(); foreach ( $payment_method as $settlement => $payment ) { if ( ! array_key_exists( $settlement, $usces->payment_structure ) ) { if ( 'deactivate' !== $payment['use'] ) { $payment['use'] = 'deactivate'; $deactivate[] = $payment['name']; usces_update_system_option( 'usces_payment_method', $payment['id'], $payment ); } } } if ( 0 < count( $deactivate ) ) { $deactivate_message = sprintf( __( '"Deactivate" %s of payment method.', 'usces' ), implode( ',', $deactivate ) ); $usces->action_message .= $deactivate_message; } } else { $usces->action_status = 'error'; $usces->action_message = __( 'Data have deficiency.', 'usces' ); $options['acting_settings']['escott']['activate'] = 'off'; unset( $usces->payment_structure['acting_escott_card'] ); unset( $usces->payment_structure['acting_escott_conv'] ); $deactivate = array(); foreach ( $payment_method as $settlement => $payment ) { if ( in_array( $settlement, $this->pay_method, true ) ) { if ( 'deactivate' !== $payment['use'] ) { $payment['use'] = 'deactivate'; $deactivate[] = $payment['name']; usces_update_system_option( 'usces_payment_method', $payment['id'], $payment ); } } } if ( 0 < count( $deactivate ) ) { $deactivate_message = sprintf( __( '"Deactivate" %s of payment method.', 'usces' ), implode( ',', $deactivate ) ); $usces->action_message .= $deactivate_message . __( 'Please complete the setup and update the payment method to "Activate".', 'usces' ); } } ksort( $usces->payment_structure ); update_option( 'usces', $options ); update_option( 'usces_payment_structure', $usces->payment_structure ); } /** * クレジット決済設定画面フォーム * usces_action_settlement_tab_body */ public function settlement_tab_body() { $acting_opts = $this->get_acting_settings(); $settlement_selected = get_option( 'usces_settlement_selected', array() ); if ( in_array( $this->paymod_id, $settlement_selected, true ) ) : $ope = ( isset( $acting_opts['ope'] ) && 'public' === $acting_opts['ope'] ) ? 'public' : 'test'; $card_activate = ( isset( $acting_opts['card_activate'] ) && ( 'on' === $acting_opts['card_activate'] || 'token' === $acting_opts['card_activate'] ) ) ? 'on' : 'off'; $sec3d_activate = ( isset( $acting_opts['sec3d_activate'] ) && 'on' === $acting_opts['sec3d_activate'] ) ? 'on' : 'off'; $seccd = ( isset( $acting_opts['seccd'] ) && 'on' === $acting_opts['seccd'] ) ? 'on' : 'off'; $quickpay = ( isset( $acting_opts['quickpay'] ) && 'on' === $acting_opts['quickpay'] ) ? 'on' : 'off'; $chooseable_quickpay = ( isset( $acting_opts['chooseable_quickpay'] ) && 'on' === $acting_opts['chooseable_quickpay'] ) ? 'on' : 'off'; $operateid = ( isset( $acting_opts['operateid'] ) ) ? $acting_opts['operateid'] : '1Gathering'; $howtopay = ( isset( $acting_opts['howtopay'] ) ) ? $acting_opts['howtopay'] : '1'; $conv_activate = ( isset( $acting_opts['conv_activate'] ) && 'on' === $acting_opts['conv_activate'] ) ? 'on' : 'off'; ?>
acting_formal_name, 'usces' ); ?>
paymod_id ) : if ( '' !== $this->error_mes ) : ?>
error_mes ); ?>
If you have only one shop to contract, enter 0001.', 'usces' ) ); ?>



(authentication assist)', 'usces' ) ); /* セキュリティコード */ ?>






get_fee_name( $acting_opts['conv_fee_type'] ) ); ?>

acting_formal_name, 'usces' ); ?>

>', 'usces' ); ?>

 













() ()
0
acting_flg_conv === wp_unslash( $_REQUEST['MerchantFree2'] ) ) ) { $this->acting_notice_ip_guard( wp_unslash( $_REQUEST ) ); $acting_opts = $this->get_acting_settings(); if ( $acting_opts['merchant_id'] === wp_unslash( $_REQUEST['MerchantId'] ) ) { $response_data = wp_unslash( $_REQUEST ); $order_id = usces_get_order_id_by_trans_id( $response_data['MerchantFree1'] ); if ( ! empty( $order_id ) ) { /* オーダーステータス変更 */ usces_change_order_receipt( $order_id, 'receipted' ); /* ポイント付与 */ usces_action_acting_getpoint( $order_id ); $response_data['OperateId'] = 'receipted'; $order_meta = usces_unserialize( $usces->get_order_meta_value( $response_data['MerchantFree2'], $order_id ) ); $meta_value = array_merge( $order_meta, $response_data ); $usces->set_order_meta_value( $response_data['MerchantFree2'], usces_serialize( $meta_value ), $order_id ); usces_log( '[' . $this->acting_name . '] conv receipted : ' . print_r( $response_data, true ), 'acting_transaction.log' ); } else { usces_log( '[' . $this->acting_name . '] conv receipted order_id error : '.print_r( $response_data, true ), 'acting_transaction.log' ); } } header( "HTTP/1.0 200 OK" ); die(); } } /** * 受注編集画面に表示する決済情報の値整形 * usces_filter_settle_info_field_value * * @param string $value Value. * @param string $key Key. * @param string $acting Acting type. * @return string */ public function settlement_info_field_value( $value, $key, $acting ) { if ( 'escott_card' !== $acting && 'escott_conv' !== $acting ) { return $value; } switch ( $key ) { case 'acting': switch ( $value ) { case 'escott_card': $value = __( 'e-SCOTT - Credit card transaction', 'usces' ); break; case 'escott_conv': $value = __( 'e-SCOTT - Online storage agency', 'usces' ); break; } break; } $value = parent::settlement_info_field_value( $value, $key, $acting ); return $value; } }