$lines = explode("\n", $dm['time']);
		$script_delivery_time .= '
	delivery_time[' . $dm['id'] . '] = [];';
		foreach( (array)$lines as $line ) {
			if( trim($line) != '' ) {
				$script_delivery_time .= '
	delivery_time[' . $dm['id'] . '].push("' . trim($line) . '");';
			}
		}
	}
	echo $script_delivery_time;

	//支払方法
	$payments_str = '';
	$payments_arr = array();
	$payments = wc2_get_payment_option();
	$payments = apply_filters( 'wc2_filter_available_payment_method', $payments );
	foreach( (array)$payments as $array ) {
		switch( $array['settlement'] ) {
			case 'acting_zeus_card':
				$paymod_base = 'zeus';
				if( 'on' == $settlement[$paymod_base]['card_activate'] 
					&& 'on' == $settlement[$paymod_base]['activate'] ) {
					$payments_str .= "'" . $array['name'] . "': '" . $paymod_base . "', ";
					$payments_arr[] = $paymod_base;
				}
				break;
			case 'acting_zeus_conv':
				$paymod_base = 'zeus';
				if( 'on' == $settlement[$paymod_base]['conv_activate'] 
					&& 'on' == $settlement[$paymod_base]['activate'] ) {
function wc2_is_complete_settlement($payment_method, $receipt_status = '')
{
    $complete = false;
    $general = wc2_get_option('general');
    if ($general['point_assign'] == 0) {
        $complete = true;
    } else {
        $payments = wc2_get_payment_option('id');
        if (isset($payments[$payment_method]['settlement'])) {
            switch ($payments[$payment_method]['settlement']) {
                case 'acting':
                    if (false !== strpos($receipt_status, 'pending')) {
                        break;
                    }
                case 'acting_zeus_card':
                case 'acting_remise_card':
                case 'acting_jpayment_card':
                case 'acting_paypal_ec':
                case 'acting_sbps_card':
                case 'acting_telecom_card':
                case 'acting_digitalcheck_card':
                case 'acting_mizuho_card':
                case 'acting_anotherlane_card':
                case 'acting_veritrans_card':
                case 'COD':
                    $complete = true;
            }
        }
    }
    $complete = apply_filters('wc2_filter_is_complete_settlement', $complete, $payment_method, $receipt_status);
    return $complete;
}
Exemple #3
0
function wc2_delivery_secure_form_e() {
	$html = '';
	$payments = wc2_get_payment_option();
	$payments = apply_filters( 'wc2_filter_available_payment_method', $payments );
	foreach( (array)$payments as $payment ) {
		switch( $payment['settlement'] ) {
			case 'acting_zeus_card':
			case 'acting_zeus_conv':
				//include( WC2_PLUGIN_DIR.'/public/includes/secure-form-zeus.php' );
				break;
		}
	}
	echo $html;
}
 public function payment_ajax()
 {
     if (!check_ajax_referer('wc2_setting_payment', 'wc2_nonce', false)) {
         die;
     }
     if (!isset($_POST['action']) or !isset($_POST['mode'])) {
         die;
     }
     if ($_POST['action'] != 'payment_ajax') {
         die;
     }
     $res = '';
     $html = '';
     switch ($_POST['mode']) {
         case 'add':
             $data = array();
             $data['name'] = isset($_POST['name']) ? $_POST['name'] : '';
             $data['explanation'] = isset($_POST['explanation']) ? $_POST['explanation'] : '';
             $data['settlement'] = isset($_POST['settlement']) ? $_POST['settlement'] : WC2_UNSELECTED;
             $data['charge'] = isset($_POST['charge']) ? $_POST['charge'] : 'none';
             $data['charge_price'] = isset($_POST['charge_price']) ? (int) $_POST['charge_price'] : 0;
             $data['use'] = 'activate';
             if ($data['name'] != '' and $data['settlement'] != WC2_UNSELECTED) {
                 $id = wc2_add_admin_option('payment_method', $data);
                 if (0 > $id) {
                     $html = '<p>同じ支払方法名が存在します。</p>';
                 } else {
                     $data['id'] = $id;
                     $html = $this->payment_list_row($data, $id);
                 }
                 $res = $id . WC2_SPLIT . $html;
             }
             break;
         case 'update':
             $data = array();
             $id = isset($_POST['id']) ? (int) $_POST['id'] : '';
             $data['name'] = isset($_POST['name']) ? $_POST['name'] : '';
             $data['explanation'] = isset($_POST['explanation']) ? $_POST['explanation'] : '';
             $data['settlement'] = isset($_POST['settlement']) ? $_POST['settlement'] : WC2_UNSELECTED;
             $data['charge'] = isset($_POST['charge']) ? $_POST['charge'] : 'none';
             $data['charge_price'] = isset($_POST['charge_price']) ? (int) $_POST['charge_price'] : 0;
             $data['use'] = isset($_POST['use']) ? $_POST['use'] : 'activate';
             if ($data['name'] != '' and $data['settlement'] != WC2_UNSELECTED) {
                 $id = wc2_update_admin_option('payment_method', $id, $data);
                 if (0 > $id) {
                     $html = '<p>同じ支払方法名が存在します。</p>';
                 }
                 $res = $id . WC2_SPLIT . $html;
             }
             break;
         case 'delete':
             $id = isset($_POST['id']) ? (int) $_POST['id'] : '';
             wc2_delete_admin_option('payment_method', $id);
             $payments = wc2_get_payment_option();
             $res = count($payments) . '';
             break;
         case 'sort':
             $idstr = isset($_POST['idstr']) ? $_POST['idstr'] : '';
             $res = wc2_sort_admin_option('payment_method', $idstr);
             break;
     }
     $res = apply_filters('wc2_filter_admin_payment_ajax', $res);
     die($res);
 }