Function Reference: geodir_change_payment_method_setting

Summary

This function has not been documented yet.

Source Code

function geodir_change_payment_method_setting()
{
	global $wpdb;
	
	if(current_user_can( 'manage_options' )){
	
		if($_REQUEST['paymentsetting'] && isset($_REQUEST['update_payment_settings_nonce']))
		{
			
			if ( !wp_verify_nonce( $_REQUEST['update_payment_settings_nonce'], 'payment_options_status_update_'.$_REQUEST['id'] ) )
				return;
				
			
			$paymentupdsql = $wpdb->prepare("select option_value from $wpdb->options where option_id=%d",array($_REQUEST['id']));
			
			$paymentupdinfo = $wpdb->get_results($paymentupdsql);
			if($paymentupdinfo)
			{
				foreach($paymentupdinfo as $paymentupdinfoObj)
				{
					$option_value = unserialize($paymentupdinfoObj->option_value);
					$payment_method = trim($_POST['payment_method']);
					$display_order = trim($_POST['display_order']);
					$payment_isactive = $_POST['payment_isactive'];
					$payment_mode = $_POST['payment_mode'];
					if($payment_method)
					{
						$option_value['name'] = $payment_method;
					}
					$option_value['display_order'] = $display_order;
					$option_value['isactive'] = $payment_isactive;
					$option_value['payment_mode'] = $payment_mode;
					$paymentOpts = $option_value['payOpts'];
					for($o=0;$oprepare("update $wpdb->options set option_value= %s where option_id=%d",array($option_value_str,$_REQUEST['id']));
			
			$wpdb->query($updatestatus);
			
			$msg = __('Payment Method Updated Successfully.', 'geodir_payments');
			$msg = urlencode($msg);
			
			wp_redirect(admin_url()."admin.php?page=geodirectory&tab=paymentmanager_fields&subtab=geodir_payment_options&success_msg=".$msg);
			
			exit;
		}
	
	}else{
		
		wp_redirect(geodir_login_url());
		exit();
	
	}

}