summaryrefslogtreecommitdiff
path: root/html/app/models/market/Payment_template.txt
blob: 4a66a1a4fa4895bb7e4a8194862108eda36db4ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
class WC_Piraeusbank_Gateway extends WC_Payment_Gateway {

	public function __construct()
		    
	function pb_get_pages($title = false, $indent = true)

	function pb_get_installments($title = false, $indent = true)

	function generate_piraeusbank_form($order_id)

	function process_payment($order_id)

	function receipt_page($order)

	function check_piraeusbank_response()

	function piraeusbank_message()

	function woocommerce_add_piraeusbank_gateway($methods)
	
	function piraeusbank_plugin_action_links($links, $file)

}



class WC_NBG_Gateway extends WC_Payment_Gateway {

	public function __construct()

	public function admin_options()

	function init_form_fields()

	function nbg_get_pages($title = false, $indent = true)

	function nbg_get_installments($title = false, $indent = true)

	function generate_nbg_form($order_id)

	function process_payment($order_id)

	function receipt_page($order) {

	function check_nbg_response()

	function nbg_message()

	function woocommerce_add_nbg_gateway($methods)

	function nbg_plugin_action_links($links, $file)

}



global $wc;

            $this->id = 'nbg_gateway';
            $this->icon = apply_filters('nbg_icon', plugins_url('assets/nbg.png', __FILE__));
            $this->has_fields = false;
            $this->notify_url = WC()->api_request_url('WC_NBG_Gateway');
			$this->method_description = __('National Bank Greece Payment Gateway allows you to accept payment through various channels such as Maestro, Mastercard  and Visa cards On your Woocommerce Powered Site.', 'woocommerce-nbg-payment-gateway');
            $this->redirect_page_id = $this->get_option('redirect_page_id');
			$this->method_title = 'National Bank of Greece Gateway';
			
			// Load the form fields.
			$this->init_form_fields();
		    
            //dhmioyrgia vashs

            global $wpdb;

            if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "nbg_transactions'") === $wpdb->prefix . 'nbg_transactions') {
                // The database table exist
            } else {
                // Table does not exist
                $query = 'CREATE TABLE IF NOT EXISTS ' . $wpdb->prefix . 'nbg_transactions (id int(11) unsigned NOT NULL AUTO_INCREMENT,merchantreference varchar(30) not null, reference varchar(100) not null, orderid varchar(100) not null , timestamp datetime default null, PRIMARY KEY (id))';
                $wpdb->query($query);
            }
			

            // Load the settings.
            $this->init_settings();


            // Define user set variables
            $this->title = $this->get_option('title');
            $this->description = $this->get_option('description');
			$this->nbg_Username = $this->get_option('nbg_Username');
            $this->nbg_Password = $this->get_option('nbg_Password');
			
		    $this->nbg_description= $this->get_option('nbg_description');
            $this->mode = $this->get_option('mode');			
            $this->nbg_installments= $this->get_option('nbg_installments');
            //Actions
            add_action('woocommerce_receipt_nbg_gateway', array($this, 'receipt_page'));
            add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this