?>
" class="postbox" <?php 
        echo !$visible ? 'style="display:none;"' : '';
        ?>
>
			<h3 class='handle'><span><?php 
        printf(__('%s Settings', 'tc'), $this->admin_name);
        ?>
</span></h3>
			<div class="inside">
				<span class="description"><?php 
        _e('Accept credit and debit cards (Visa, MasterCard, AmEx, Discover, JCB, Maestro and UnionPay)', 'tc');
        ?>
</span>
				<?php 
        $fields = array('is_ssl' => array('title' => __('Mode', 'tc'), 'type' => 'select', 'options' => array('0' => __('Sandbox / Test', 'tc'), '1' => __('Live (Force SSL)', 'tc')), 'default' => '0'), 'merchant_key' => array('title' => __('Merchant Key', 'tc'), 'type' => 'text'), 'private_key' => array('title' => __('Private Key', 'tc'), 'type' => 'text'), 'public_key' => array('title' => __('Public Key', 'tc'), 'type' => 'text'), 'cse_key' => array('title' => __('CSE Key', 'tc'), 'type' => 'text'), 'currency' => array('title' => __('Currency', 'tc'), 'type' => 'select', 'options' => $this->currencies, 'default' => 'USD'));
        $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
        ?>
				<table class="form-table">
					<?php 
        $form->admin_options();
        ?>
				</table>

			</div>
		</div>
		<?php 
    }
}
tc_register_gateway_plugin('TC_Gateway_Braintree', 'braintree', __('Braintree', 'tc'));
        function isDeclined()
        {
            return $this->declined;
        }
        function isError()
        {
            return $this->error;
        }
        function getResponseText()
        {
            return $this->results[3];
            $strip = array($this->params['x_delim_char'], $this->params['x_encap_char'], '|', ',');
            return str_replace($strip, '', $this->results[3]);
        }
        function getAuthCode()
        {
            return str_replace($this->params['x_encap_char'], '', $this->results[4]);
        }
        function getAVSResponse()
        {
            return str_replace($this->params['x_encap_char'], '', $this->results[5]);
        }
        function getTransactionID()
        {
            return str_replace($this->params['x_encap_char'], '', $this->results[6]);
        }
    }
}
//register payment gateway plugin
tc_register_gateway_plugin('TC_Gateway_AuthorizeNet_AIM', 'authorizenet-aim', __('Authorize.net (AIM)', 'tc'));
            Stripe::setApiKey($this->private_key);
            $order_id = $tc->generate_order_id();
            try {
                $charge = Stripe_Charge::create(array("amount" => $this->total() * 100, "currency" => strtolower($this->currency), "source" => $_SESSION['stripeToken'], "description" => sprintf(__('%s Store Purchase - Order ID - %s, Email - %s', 'tc'), get_bloginfo('name'), $order_id, $this->buyer_info('email')), "application_fee" => round(($this->total() * $percent / 100 + $fixed) * 100)));
                if ($charge->paid == 'true') {
                    $payment_info = array();
                    $payment_info['method'] = sprintf(__('%1$s Card ending in %2$s - Expires %3$s', 'tc'), $charge->card->type, $charge->card->last4, $charge->card->exp_month . '/' . $charge->card->exp_year);
                    $payment_info['transaction_id'] = $charge->id;
                    $payment_info = $this->save_payment_info($payment_info);
                    $paid = true;
                    $order = $tc->create_order($order_id, $this->cart_contents(), $this->cart_info(), $payment_info, $paid);
                    wp_redirect($tc->get_confirmation_slug(true, $order_id));
                    tc_js_redirect($tc->get_confirmation_slug(true, $order_id));
                    exit;
                }
            } catch (Exception $e) {
                unset($_SESSION['stripeToken']);
                $_SESSION['tc_gateway_error'] = sprintf(__('There was an error processing your card - "%s".', 'tc'), $e->getMessage());
                wp_redirect($tc->get_payment_slug(true));
                tc_js_redirect($tc->get_payment_slug(true));
                exit;
            }
            return false;
        }
        function ipn()
        {
            global $tc;
        }
    }
    tc_register_gateway_plugin('TC_Gateway_Stripe_Connect', 'stripe-connect', __('Stripe', 'tc'));
}
				<?php 
        $fields = array('mode' => array('title' => __('Mode', 'tc'), 'type' => 'select', 'options' => array('sandbox' => __('Sandbox / Test', 'tc'), 'live' => __('Live', 'tc')), 'default' => 'sandbox'), 'merchant_id' => array('title' => __('Merchant ID', 'tc'), 'type' => 'text'), 'account_id' => array('title' => __('Account ID', 'tc'), 'type' => 'text'), 'api_key' => array('title' => __('Api Key', 'tc'), 'type' => 'text'), 'language' => array('title' => __('Gateway Language', 'tc'), 'type' => 'select', 'options' => $this->languages), 'currency' => array('title' => __('Currency', 'tc'), 'type' => 'select', 'options' => $this->currencies));
        $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
        ?>
				<table class="form-table">
					<?php 
        $form->admin_options();
        ?>
				</table>
			</div>
		</div>

		<?php 
    }
    function request($posted)
    {
        global $tc;
        if (!empty($posted['reference_sale'])) {
            $order = tc_get_order_id_by_name($posted['reference_sale']);
            if (!empty($posted['response_message_pol'])) {
                // We are here so lets check status and do actions
                if (isset($posted['response_message_pol']) && $posted['response_message_pol'] == 'APPROVED') {
                    $tc->update_order_payment_status($order->ID, true);
                }
            }
        }
    }
}
tc_register_gateway_plugin('TC_Gateway_PayU_Latam', 'payu_latam', __('PayU Latam', 'tc'));
        echo !$visible ? 'style="display:none;"' : '';
        ?>
>
			<h3 class='handle'><span><?php 
        printf(__('%s Settings', 'tc'), $this->admin_name);
        ?>
</span></h3>
			<div class="inside">
				<span class="description">
					<?php 
        _e("Accept all major credit cards directly on your site. Your sales proceeds are deposited to any Australian bank account, no merchant account required.", 'tc');
        ?>
				</span>

				<?php 
        $fields = array('is_ssl' => array('title' => __('Mode', 'tc'), 'type' => 'select', 'options' => array('0' => __('Sandbox / Test', 'tc'), '1' => __('Live', 'tc')), 'default' => '0'), 'private_key' => array('title' => __('Secret API Key', 'tc'), 'type' => 'text', 'description' => __('You must login to PIN to <a target="_blank" href="https://dashboard.pin.net.au/account">get your API credentials</a>. You can enter your test keys, then live ones when ready.', 'tc')), 'public_key' => array('title' => __('Publishable API Key', 'tc'), 'type' => 'text'), 'currency' => array('title' => __('Currency', 'tc'), 'type' => 'select', 'options' => $this->currencies, 'default' => 'AUD'));
        $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
        ?>
				<table class="form-table">
					<?php 
        $form->admin_options();
        ?>
				</table>
			</div>
		</div>

		<?php 
    }
}
tc_register_gateway_plugin('TC_Gateway_PIN', 'pin', __('PIN', 'tc'));
</span>
				<?php 
        $fields = array('mode' => array('title' => __('Mode', 'tc'), 'type' => 'select', 'options' => array('sandbox' => __('Sandbox / Test', 'tc'), 'live' => __('Live', 'tc')), 'default' => 'sandbox'), 'account_id' => array('title' => __('Account ID', 'tc'), 'type' => 'text'), 'secret_key' => array('title' => __('Secret Key', 'tc'), 'type' => 'text'), 'payment_methods' => array('title' => __('Payment Methods', 'tc'), 'type' => 'checkboxes', 'options' => $this->payment_methods), 'locale' => array('title' => __('Locale', 'tc'), 'type' => 'select', 'options' => $this->locales, 'default' => 'ja'), 'currency' => array('title' => __('Currency', 'tc'), 'type' => 'select', 'options' => $this->currencies, 'default' => 'JPY'));
        $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
        ?>
				<table class="form-table">
					<?php 
        $form->admin_options();
        ?>
				</table>

			</div>
		</div>

		<?php 
    }
    function ipn()
    {
        global $tc;
        if (isset($_GET['hmac'])) {
            $order_num = $_GET['transaction']['external_order_num'];
            $status = $_GET['transaction']['status'];
            $order = tc_get_order_id_by_name($order_num);
            if ($status == 'captured') {
                $tc->update_order_payment_status($order->ID, true);
            }
        }
    }
}
tc_register_gateway_plugin('TC_Gateway_Komoju', 'komoju', __('Komoju', 'tc'));
        ?>
" class="postbox" <?php 
        echo !$visible ? 'style="display:none;"' : '';
        ?>
>
			<h3 class='handle'><span><?php 
        printf(__('%s Settings', 'tc'), $this->admin_name);
        ?>
</span></h3>
			<div class="inside">
				<span class="description"><?php 
        _e('This method will be automatically activated if order total is 0 (zero). This is the only method which will be shown to buyers in this case - other payment options will be hidden.', 'tc');
        ?>
</span>
				<?php 
        $fields = array('public_name' => array('title' => __('Public Method Name', 'tc'), 'type' => 'text', 'description' => __('Insert public name for this payment method which will be visible to buyers', 'tc'), 'default' => $this->public_name), 'admin_name' => array('title' => __('Admin Method Name', 'tc'), 'type' => 'text', 'description' => __('Insert admin name for this payment method which will be visible within the administration panel (Orders screen etc.)', 'tc'), 'default' => $this->admin_name), 'info' => array('title' => __('Payment Method Info', 'tc'), 'type' => 'wp_editor', 'description' => __('Information about the payment method which will be visible to user.', 'tc')), 'instructions' => array('title' => __('Payment Instructions', 'tc'), 'type' => 'wp_editor', 'description' => __('An additional message shown on the payment confirmation page.', 'tc')), 'zero_total_status' => array('title' => __('Automatic Payment Status', 'tc'), 'type' => 'select', 'options' => array('order_received' => __('Order Received', 'tc'), 'order_paid' => __('Order Paid', 'tc')), 'default' => 'order_received', 'description' => __('Automatic payment status which will be set for all custom offline payment orders.', 'tc')));
        $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
        ?>
				<table class="form-table">
					<?php 
        $form->admin_options();
        ?>
				</table>

			</div>
		</div>
		<?php 
    }
}
tc_register_gateway_plugin('TC_Gateway_Free_Orders', 'free_orders', __('Free Orders', 'tc'));
" class="postbox" <?php 
        echo !$visible ? 'style="display:none;"' : '';
        ?>
>
			<h3 class='handle'><span><?php 
        printf(__('%s Settings', 'tc'), $this->admin_name);
        ?>
</span></h3>
			<div class="inside">
				<span class="description">
					<?php 
        _e('Accept all major credit and debit cards directly on your site. Credit cards go directly to Paymill\'s secure environment, and never hit your servers so you can avoid most PCI requirements.', 'tc');
        ?>
				</span>

				<?php 
        $fields = array('is_ssl' => array('title' => __('Force SSL', 'tc'), 'type' => 'select', 'options' => array('0' => __('No', 'tc'), '1' => __('Yes', 'tc')), 'default' => '0'), 'private_key' => array('title' => __('Private Key', 'tc'), 'type' => 'text', 'description' => __('You must login to Paymill to <a target="_blank" href="https://app.paymill.com/en-gb/auth/login">get your API credentials</a>. You can enter your test keys, then live ones when ready.', 'tc')), 'public_key' => array('title' => __('Public Key', 'tc'), 'type' => 'text', 'description' => '', 'default' => ''), 'currency' => array('title' => __('Currency', 'tc'), 'type' => 'select', 'options' => $this->currencies, 'default' => 'USD'));
        $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
        ?>
				<table class="form-table">
					<?php 
        $form->admin_options();
        ?>
				</table>
			</div>
		</div>  
		<?php 
    }
}
tc_register_gateway_plugin('TC_Gateway_Paymill', 'paymill', __('Paymill', 'tc'));
        $fields = array('is_ssl' => array('title' => __('Mode', 'tc'), 'type' => 'select', 'options' => array('0' => __('Sandbox / Test', 'tc'), '1' => __('Live', 'tc')), 'default' => '0'), 'api_username' => array('title' => __('API Username', 'tc'), 'type' => 'text'), 'api_password' => array('title' => __('API Password', 'tc'), 'type' => 'text'), 'api_signature' => array('title' => __('API Signature', 'tc'), 'type' => 'text', 'description' => ''), 'currency' => array('title' => __('Currency', 'tc'), 'type' => 'select', 'options' => $this->currencies, 'default' => 'USD'));
        $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
        ?>
				<table class="form-table">
					<?php 
        $form->admin_options();
        ?>
				</table>
			</div>
		</div>
		<?php 
    }
    function NVPToArray($NVPString)
    {
        $proArray = array();
        while (strlen($NVPString)) {
            // name
            $keypos = strpos($NVPString, '=');
            $keyval = substr($NVPString, 0, $keypos);
            // value
            $valuepos = strpos($NVPString, '&') ? strpos($NVPString, '&') : strlen($NVPString);
            $valval = substr($NVPString, $keypos + 1, $valuepos - $keypos - 1);
            // decoding the respose
            $proArray[$keyval] = urldecode($valval);
            $NVPString = substr($NVPString, $valuepos + 1, strlen($NVPString));
        }
        return $proArray;
    }
}
tc_register_gateway_plugin('TC_Gateway_PayPal_Pro', 'paypal_pro', __('PayPal PRO', 'tc'));
" class="postbox" <?php 
        echo !$visible ? 'style="display:none;"' : '';
        ?>
>
			<h3 class='handle'><span><?php 
        printf(__('%s Settings', 'tc'), $this->admin_name);
        ?>
</span></h3>
			<div class="inside">
				<span class="description">
					<?php 
        echo __('PayTabs works by sending the user to PayTabs to enter their payment information.', 'tc');
        ?>
				</span>

				<?php 
        $fields = array('merchantid' => array('title' => __('Merchant ID / Username', 'tc'), 'type' => 'text'), 'password' => array('title' => __('Password', 'tc'), 'type' => 'text'), 'language' => array('title' => __('Language', 'tc'), 'type' => 'select', 'options' => $this->paytabs_languages, 'default' => 'English'));
        $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
        ?>
				<table class="form-table">
					<?php 
        $form->admin_options();
        ?>
				</table>
			</div>
		</div>
		<?php 
    }
}
tc_register_gateway_plugin('TC_Gateway_PayTabs', 'paytabs', __('PayTabs', 'tc'));
            } else {
                $json = wp_remote_get('https://voguepay.com/?v_transaction_id=' . $transaction_id . '&type=json');
            }
            $transaction = json_decode($json['body'], true);
            $transaction_id = $transaction['transaction_id'];
            $merchant_ref = $transaction['merchant_ref'];
            $order_id = tc_get_order_id_by_name($merchant_ref);
            //get order id from order name
            $order_id = $order_id->ID;
            $order = new TC_Order($order_id);
            $order_total = $order->details->tc_payment_info['total'];
            $amount_paid = $transaction['total'];
            if ($transaction['status'] == 'Approved') {
                if (round($amount_paid, 2) < round($order_total, 2)) {
                    $tc->update_order_status($order->ID, 'order_fraud');
                    //die('Fraud detected. Price paid ' . $amount_paid . ' and original price of ' . $order_total . ' do not match.');
                    $_SESSION['tc_gateway_error'] = sprintf(__('Something went wrong. Price paid %s and original price of %s do not match.', 'tc'), $amount_paid, $order_total);
                    wp_redirect($tc->get_payment_slug(true));
                    tc_js_redirect($tc->get_payment_slug(true));
                    exit;
                }
                $tc->update_order_payment_status($order_id, true);
                //die( 'IPN Processed OK. Payment for order successfull.' );
            } else {
                //die( 'IPN Processed OK. Payment Failed' );
            }
        }
    }
}
tc_register_gateway_plugin('TC_Gateway_VoguePay', 'voguepay', __('VoguePay', 'tc'));
        ?>
" class="postbox" <?php 
        echo !$visible ? 'style="display:none;"' : '';
        ?>
>
			<h3 class='handle'><span><?php 
        printf(__('%s Settings', 'tc'), $this->admin_name);
        ?>
</span></h3>
			<div class="inside">
				<span class="description"><?php 
        _e('Track offline / custom payments (Cash on Delivery, Money Orders, Bank Deposits, Cheques etc.) manually.', 'tc');
        ?>
</span>
				<?php 
        $fields = array('public_name' => array('title' => __('Public Method Name', 'tc'), 'type' => 'text', 'description' => __('Insert public name for this payment method which will be visible to buyers', 'tc'), 'default' => $this->public_name), 'admin_name' => array('title' => __('Admin Method Name', 'tc'), 'type' => 'text', 'description' => __('Insert admin name for this payment method which will be visible within the administration panel (Orders screen etc.)', 'tc'), 'default' => $this->admin_name), 'info' => array('title' => __('Payment Method Info', 'tc'), 'type' => 'wp_editor', 'description' => __('Information about the payment method which will be visible to user upon choosing this payment method.', 'tc')), 'instructions' => array('title' => __('Payment Instructions', 'tc'), 'type' => 'wp_editor', 'description' => __('Your customers who checkout using the custom offline payment method will be given a set of instructions (set by you) to complete the purchase process immediately after checkout completion. Available placeholders: ORDER_ID', 'tc')), 'instructions_email' => array('title' => __('E-mail Instructions', 'tc'), 'type' => 'select', 'options' => array('no' => __('No', 'tc'), 'yes' => __('Yes', 'tc')), 'default' => 'no', 'description' => __('Send an email with the payment instructions to a customer upon creating an order. The e-mail will be sent only if status of a order is "Order Received".', 'tc')), 'instructions_email_subject' => array('title' => __('Instructions E-mail Subject', 'tc'), 'type' => 'text', 'default' => __('Payment Instructions', 'tc')), 'automatic_status' => array('title' => __('Automatic Payment Status', 'tc'), 'type' => 'select', 'options' => array('order_received' => __('Order Received', 'tc'), 'order_paid' => __('Order Paid', 'tc')), 'default' => 'order_received', 'description' => __('Automatic payment status which will be set for all custom offline payment orders.', 'tc')));
        $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
        ?>
				<table class="form-table">
					<?php 
        $form->admin_options();
        ?>
				</table>

			</div>
		</div>
		<?php 
    }
}
tc_register_gateway_plugin('TC_Gateway_Custom_Offline_Payments', 'custom_offline_payments', __('Offline Payments', 'tc'));
					<?php 
            $fields = array('access_key' => array('title' => __('Mijireh Access Key', 'tc'), 'type' => 'text'), 'currency' => array('title' => __('Currency', 'tc'), 'type' => 'select', 'options' => $this->currencies, 'default' => 'USD'));
            $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
            ?>
					<table class="form-table">
						<?php 
            $form->admin_options();
            ?>
					</table>
				</div>
			</div>  
			<?php 
        }
    }
    tc_register_gateway_plugin('TC_Gateway_Mijireh', 'mijireh', __('Mijireh', 'tc'));
}
//Addon updater
global $tc;
$tc_general_settings = get_option('tc_general_setting', false);
$addon_slug = 'mijireh-checkout';
if (!defined('TC_NU')) {
    //updates are allowed
    $license_key = defined('TC_LCK') && TC_LCK !== '' ? TC_LCK : (isset($tc_general_settings['license_key']) && $tc_general_settings['license_key'] !== '' ? $tc_general_settings['license_key'] : '');
    if ($license_key !== '') {
        $updater_file = $tc->plugin_dir . 'includes/plugin-update-checker/plugin-update-checker.php';
        if (file_exists($updater_file)) {
            require_once $updater_file;
            $tc_plugin_update_checker = PucFactory::buildUpdateChecker('https://tickera.com/update/?action=get_metadata&slug=' . $addon_slug, __FILE__, $addon_slug, 1);
        }
    }
" class="postbox" <?php 
        echo !$visible ? 'style="display:none;"' : '';
        ?>
>
			<h3 class='handle'><span><?php 
        printf(__('%s Settings', 'tc'), $this->admin_name);
        ?>
</span></h3>
			<div class="inside">
				<span class="description">
					<?php 
        _e('Accepts credit card payments with Optimal Payments Netbanx in your store', 'tc');
        ?>
				</span>

				<?php 
        $fields = array('mode' => array('title' => __('Mode', 'tc'), 'type' => 'select', 'description' => '', 'default' => 'sandbox', 'options' => array('sandbox' => __('Sandbox / Test'), 'live' => __('Live', 'tc'))), 'account_number' => array('title' => __('Account Number', 'tc'), 'type' => 'text', 'description' => '', 'default' => ''), 'api_key_id' => array('title' => __('Api Key ID', 'tc'), 'type' => 'text', 'description' => '', 'default' => ''), 'api_key_secret' => array('title' => __('Api Key Secret', 'tc'), 'type' => 'text', 'description' => '', 'default' => ''));
        $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
        ?>
				<table class="form-table">
					<?php 
        $form->admin_options();
        ?>
				</table>
			</div>
		</div>  
		<?php 
    }
}
tc_register_gateway_plugin('TC_Gateway_Netbanx', 'netbanx', __('Netbanx', 'tc'));
" class="postbox" <?php 
        echo !$visible ? 'style="display:none;"' : '';
        ?>
>
			<h3 class='handle'><span><?php 
        printf(__('%s Settings', 'tc'), $this->admin_name);
        ?>
</span></h3>
			<div class="inside">
				<span class="description">
					<?php 
        _e("Simplify makes it easy to accept payments for U.S citizen online consumer.", 'tc');
        ?>
				</span>

				<?php 
        $fields = array('public_key' => array('title' => __('Public API Key', 'tc'), 'type' => 'text'), 'private_key' => array('title' => __('Private API Key', 'tc'), 'type' => 'text'), 'currency' => array('title' => __('Currency', 'tc'), 'type' => 'select', 'options' => $this->currencies, 'default' => 'USD'));
        $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
        ?>
				<table class="form-table">
					<?php 
        $form->admin_options();
        ?>
				</table>
			</div>
		</div>  
		<?php 
    }
}
tc_register_gateway_plugin('TC_Gateway_Simplify', 'simplify_commerce', __('Simplify Commerce', 'tc'));
					<span class="description">
						<?php 
            _e('Mollie provides a fully PCI Compliant and secure way to collect payments via iDeal, Credit Card, Bancontact / Mister Cash, SOFORT Banking, Overbooking, Bitcoin, PayPal, paysafecard and AcceptEmail.', 'tc-mollie');
            ?>
					</span>

					<?php 
            $fields = array('api_key' => array('title' => __('Mollie API Key', 'tc-mollie'), 'type' => 'text'), 'public_name' => array('title' => __('Payment Method Name (shown on front)', 'tc-mollie'), 'type' => 'text'));
            $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
            ?>
					<table class="form-table">
						<?php 
            $form->admin_options();
            ?>
					</table>
				</div>
			</div>
			<?php 
        }
        function process_gateway_settings($settings)
        {
            return $settings;
        }
        function ipn()
        {
            global $tc;
            $settings = get_option('tc_settings');
        }
    }
    tc_register_gateway_plugin('TC_Gateway_Mollie', 'mollie', __('Mollie', 'tc-mollie'));
}
        echo !$visible ? 'style="display:none;"' : '';
        ?>
>
			<h3 class='handle'><span><?php 
        printf(__('%s Settings', 'tc'), $this->admin_name);
        ?>
</span></h3>
			<div class="inside">
				<span class="description">
					<?php 
        _e('PayUMoney works by sending the user to <a href="https://www.payumoney.com/">PayUMoney</a> to enter their payment information. Note that PayUMoney will only take payments in Indian Rupee.', 'tc');
        ?>
				</span>

				<?php 
        $fields = array('mode' => array('title' => __('Mode', 'tc'), 'type' => 'select', 'options' => array('sandbox' => __('Sandbox / Test', 'tc'), 'live' => __('Live', 'tc')), 'default' => 'sandbox'), 'merchantid' => array('title' => __('Merchant ID', 'tc'), 'type' => 'text'), 'salt' => array('title' => __('SALT', 'tc'), 'type' => 'text'), 'currency' => array('title' => __('Currency', 'tc'), 'type' => 'select', 'options' => $this->currencies, 'default' => 'USD'));
        $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
        ?>
				<table class="form-table">
					<?php 
        $form->admin_options();
        ?>
				</table>
			</div>
		</div>

		<?php 
    }
}
tc_register_gateway_plugin('TC_Gateway_PayUMoney', 'payumoney', __('PayUMoney', 'tc'));
Example #18
0
            $hash = md5($sale_id . $this->get_option('sid', '', '2checkout') . $_REQUEST['invoice_id'] . $this->get_option('sid', 'secret_word', '2checkout'));
            if ($_REQUEST['md5_hash'] != strtolower($hash)) {
                header('HTTP/1.0 403 Forbidden');
                header('Content-type: text/plain; charset=UTF-8');
                echo "2Checkout hash key doesn't match";
                exit;
            }
            if (strtolower($_REQUEST['invoice_status']) != "deposited") {
                header('HTTP/1.0 200 OK');
                header('Content-type: text/plain; charset=UTF-8');
                echo 'Waiting for deposited invoice status.';
                exit;
            }
            if (intval(round($total, 2)) >= round($order->details->tc_payment_info['total'], 2)) {
                $tc->update_order_payment_status($order_id, true);
                header('HTTP/1.0 200 OK');
                header('Content-type: text/plain; charset=UTF-8');
                echo 'Order completed and verified.';
                exit;
            } else {
                $tc->update_order_status($order_id, 'order_fraud');
                header('HTTP/1.0 200 OK');
                header('Content-type: text/plain; charset=UTF-8');
                echo 'Fraudulent order detected and changed status.';
                exit;
            }
        }
    }
}
tc_register_gateway_plugin('TC_Gateway_2Checkout', 'checkout', __('2Checkout', 'tc'));
    {
        global $tc;
        $posted = stripslashes_deep($_POST);
        if ($this->validate_response()) {
            $refno = $_POST['RefNo'];
            $transid = $_POST['TransId'];
            $estatus = $_POST['Status'];
            $errdesc = $_POST['ErrDesc'];
            $order = tc_get_order_id_by_name($refno);
            if ($estatus == 1) {
                $tc->update_order_payment_status($order->ID, true);
            } else {
                //not paid
            }
        } else {
            //echo 'INVALID RESPONSE';
        }
    }
    function validate_response()
    {
        $signature = $this->iPay88_signature($_POST);
        if ($_POST['Signature'] == $signature) {
            return true;
        } else {
            return true;
            //should be false here
        }
    }
}
tc_register_gateway_plugin('TC_Gateway_iPay88', 'ipay', __('iPay88', 'tc'));
</span></h3>
			<div class="inside">
				<span class="description">
					<?php 
        _e("Sell tickets via PayPal standard payment gateway", 'tc');
        ?>
				</span>

				<?php 
        $fields = array('mode' => array('title' => __('Mode', 'tc'), 'type' => 'select', 'options' => array('sandbox' => __('Sandbox / Test', 'tc'), 'live' => __('Live', 'tc')), 'default' => '0'), 'email' => array('title' => __('PayPal E-Mail', 'tc'), 'type' => 'text'), 'locale' => array('title' => __('Locale', 'tc'), 'type' => 'select', 'options' => $this->locales, 'default' => 'US'), 'currency' => array('title' => __('Currency', 'tc'), 'type' => 'select', 'options' => $this->currencies, 'default' => 'USD'));
        $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
        ?>
				<table class="form-table">
					<?php 
        $form->admin_options();
        ?>
				</table>
			</div>
		</div>
		<?php 
    }
    function ipn()
    {
        global $tc;
        if (isset($_REQUEST['custom'])) {
            $this->order_confirmation($_REQUEST['custom']);
        }
    }
}
tc_register_gateway_plugin('TC_Gateway_PayPal_Standard', 'paypal_standard', __('PayPal Standard', 'tc'));
" class="postbox" <?php 
        echo !$visible ? 'style="display:none;"' : '';
        ?>
>
			<h3 class='handle'><span><?php 
        printf(__('%s Settings', 'tc'), $this->admin_name);
        ?>
</span></h3>
			<div class="inside">
				<span class="description">
					<?php 
        _e('Accept credit card payments', 'tc');
        ?>
				</span>

				<?php 
        $fields = array('mode' => array('title' => __('Mode', 'tc'), 'type' => 'select', 'description' => '', 'default' => 'sandbox', 'options' => array('sandbox' => __('Sandbox / Test'), 'live' => __('Live'))), 'merchant_id' => array('title' => __('Merchant ID', 'tc'), 'type' => 'text', 'description' => '', 'default' => ''), 'api_access' => array('title' => __('API access passcode', 'tc'), 'type' => 'text', 'description' => '', 'default' => ''), 'currency' => array('title' => __('Currency', 'tc'), 'type' => 'select', 'description' => __('Selecting a currency other than that used for your store may cause problems at checkout.', 'tc'), 'default' => 'USD', 'options' => $this->currencies));
        $form = new TC_Form_Fields_API($fields, 'tc', 'gateways', $this->plugin_name);
        ?>
				<table class="form-table">
					<?php 
        $form->admin_options();
        ?>
				</table>
			</div>
		</div>
		<?php 
    }
}
tc_register_gateway_plugin('TC_Gateway_Beanstream', 'beanstream', __('Beanstream', 'tc'));