'.htmlentities(urldecode($_GET['msg'])).''.$content;
}
/**
* Gateway class
*/
class WC_Airpay extends WC_Payment_Gateway {
protected $msg = array();
public function __construct(){ // construct form //
// Go wild in here
$this -> id = 'Airpay';
$this -> method_title = __('Airpay');
$this -> icon = WP_PLUGIN_URL . "/" . plugin_basename(dirname(__FILE__)) . '/images/logo.png';
$this -> has_fields = false;
$this -> init_form_fields();
$this -> init_settings();
$this -> title = $this -> settings['title'];
$this -> description = $this -> settings['description'];
$this -> merchantIdentifier = $this -> settings['merchantIdentifier'];
$this -> secret_key = $this -> settings['secret_key'];
$this -> username = $this -> settings['username'];
$this -> Password = $this -> settings['Password'];
$this -> redirect_page_id = $this -> settings['redirect_page_id'];
$this -> mode = $this -> settings['mode'];
$this -> log = $this -> settings['log'];
$this -> liveurl = "https://payments.airpay.co.in/pay/index.php";
$this -> msg['message'] = "";
$this -> msg['class'] = "";
add_action('init', array(&$this, 'check_Airpay_response'));
//update for woocommerce >2.0
add_action( 'woocommerce_api_' . strtolower( get_class( $this ) ), array( $this, 'check_Airpay_response' ) );
add_action('valid-Airpay-request', array(&$this, 'successful_request')); // this save
if ( version_compare( WOOCOMMERCE_VERSION, '2.0.0', '>=' ) ) {
add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( &$this, 'process_admin_options' ) );
} else {
add_action( 'woocommerce_update_options_payment_gateways', array( &$this, 'process_admin_options' ) );
}
add_action('woocommerce_receipt_Airpay', array(&$this, 'receipt_page'));
add_action('woocommerce_thankyou_Airpay',array(&$this, 'thankyou_page'));
}
function init_form_fields(){
$this -> form_fields = array(
'enabled' => array(
'title' => __('Enable/Disable'),
'type' => 'checkbox',
'label' => __('Enable Airpay Payment Module.'),
'default' => 'no'),
'title' => array(
'title' => __('Title:'),
'type'=> 'text',
'description' => __('This controls the title which the user sees during checkout.'),
'default' => __('Airpay')),
'description' => array(
'title' => __('Description:'),
'type' => 'textarea',
'description' => __('This controls the description which the user sees during checkout.'),
'default' => __('The best payment gateway provider in India for e-payment through credit card, debit card & netbanking.')),
'merchantIdentifier' => array(
'title' => __('Merchant Id'),
'type' => 'text',
'description' => __('This id(Merchant Id) given to Merchant by Airpay.')),
'username' => array(
'title' => __('User Name'),
'type' => 'text',
'description' => __('Given to Merchant by Airpay'),
),
'Password' => array(
'title' => __('Password'),
'type' => 'password',
'description' => __('Given to Merchant by Airpay'),
),
'secret_key' => array(
'title' => __('Secret Key'),
'type' => 'text',
'description' => __('Given to Merchant by Airpay'),
),
'redirect_page_id' => array(
'title' => __('Return Page'),
'type' => 'select',
'options' => $this -> get_pages('Select Page'),
'description' => "URL of success page"
),
'log' => array(
'title' => __('Do you want to log'),
'type' => 'text',
'options' => 'text',
'description' => "(yes/no)"
)
);
}
/**
* Admin Panel Options
* - Options for bits like 'title' and availability on a country-by-country basis
**/
public function admin_options(){
echo '
'.__('Airpay Payment Gateway').'
';
echo '
'.__('India online payment solutions for all your transactions by Airpay').'
';
echo '
';
$this -> generate_settings_html();
echo '
';
}
/**
* There are no payment fields for Airpay, but we want to show the description if set.
**/
function payment_fields(){
if($this -> description) echo wpautop(wptexturize($this -> description));
}
/**
* Receipt Page
**/
function receipt_page($order){
echo '
'.__('Thank you for your order, please click the button below to pay with Airpay.').'