Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
wajihkm committed Jun 16, 2020
1 parent c22b8f7 commit ff879d9
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 85 deletions.
4 changes: 1 addition & 3 deletions includes/paytabs_functions.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php

if (!defined('PAYTABS_PAYPAGE_VERSION')) {
return;
}
defined('PAYTABS_PAYPAGE_VERSION') or die;

function woocommerce_paytabs_missing_wc_notice()
{
Expand Down
80 changes: 80 additions & 0 deletions includes/paytabs_gateways.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?php

defined('PAYTABS_PAYPAGE_VERSION') or die;

class WC_Gateway_Paytabs_Creditcard extends WC_Gateway_Paytabs
{
protected $_code = 'creditcard';
protected $_title = 'PayTabs - CreditCard';
protected $_description = 'PayTabs - CreditCard payment method';
}

class WC_Gateway_Paytabs_Mada extends WC_Gateway_Paytabs
{
protected $_code = 'mada';
protected $_title = 'PayTabs - Mada';
protected $_description = 'PayTabs - Mada payment method';
}

class WC_Gateway_Paytabs_Stcpay extends WC_Gateway_Paytabs
{
protected $_code = 'stcpay';
protected $_title = 'PayTabs - StcPay';
protected $_description = 'PayTabs - StcPay payment method';
}

class WC_Gateway_Paytabs_Stcpayqr extends WC_Gateway_Paytabs
{
protected $_code = 'stcpayqr';
protected $_title = 'PayTabs - StcPayQR';
protected $_description = 'PayTabs - StcPayQR payment method';
}

class WC_Gateway_Paytabs_Applepay extends WC_Gateway_Paytabs
{
protected $_code = 'applepay';
protected $_title = 'PayTabs - ApplePay';
protected $_description = 'PayTabs - ApplePay payment method';
}

class WC_Gateway_Paytabs_Omannet extends WC_Gateway_Paytabs
{
protected $_code = 'omannet';
protected $_title = 'PayTabs - OmanNet';
protected $_description = 'PayTabs - OmanNet payment method';
}

class WC_Gateway_Paytabs_Sadad extends WC_Gateway_Paytabs
{
protected $_code = 'sadad';
protected $_title = 'PayTabs - Sadad';
protected $_description = 'PayTabs - Sadad payment method';
}

class WC_Gateway_Paytabs_Atfawry extends WC_Gateway_Paytabs
{
protected $_code = 'atfawry';
protected $_title = 'PayTabs - @Fawry';
protected $_description = 'PayTabs - @Fawry payment method';
}

class WC_Gateway_Paytabs_Knpay extends WC_Gateway_Paytabs
{
protected $_code = 'knpay';
protected $_title = 'PayTabs - KnPay';
protected $_description = 'PayTabs - KnPay payment method';
}

class WC_Gateway_Paytabs_Amex extends WC_Gateway_Paytabs
{
protected $_code = 'amex';
protected $_title = 'PayTabs - Amex';
protected $_description = 'PayTabs - Amex payment method';
}

class WC_Gateway_Paytabs_Valu extends WC_Gateway_Paytabs
{
protected $_code = 'valu';
protected $_title = 'PayTabs - valU';
protected $_description = 'valU payments powered by PayTabs';
}
81 changes: 1 addition & 80 deletions includes/paytabs_payment_methods.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php

if (!defined('PAYTABS_PAYPAGE_VERSION')) {
return;
}
defined('PAYTABS_PAYPAGE_VERSION') or die;

class WC_Gateway_Paytabs extends WC_Payment_Gateway
{
Expand Down Expand Up @@ -495,80 +493,3 @@ private function getPaymentMethod($order)
return WooCommerce2 ? $order->payment_method : $order->get_payment_method();
}
}

class WC_Gateway_Paytabs_Creditcard extends WC_Gateway_Paytabs
{
protected $_code = 'creditcard';
protected $_title = 'PayTabs - CreditCard';
protected $_description = 'PayTabs - CreditCard payment method';
}

class WC_Gateway_Paytabs_Mada extends WC_Gateway_Paytabs
{
protected $_code = 'mada';
protected $_title = 'PayTabs - Mada';
protected $_description = 'PayTabs - Mada payment method';
}

class WC_Gateway_Paytabs_Stcpay extends WC_Gateway_Paytabs
{
protected $_code = 'stcpay';
protected $_title = 'PayTabs - StcPay';
protected $_description = 'PayTabs - StcPay payment method';
}

class WC_Gateway_Paytabs_Stcpayqr extends WC_Gateway_Paytabs
{
protected $_code = 'stcpayqr';
protected $_title = 'PayTabs - StcPayQR';
protected $_description = 'PayTabs - StcPayQR payment method';
}

class WC_Gateway_Paytabs_Applepay extends WC_Gateway_Paytabs
{
protected $_code = 'applepay';
protected $_title = 'PayTabs - ApplePay';
protected $_description = 'PayTabs - ApplePay payment method';
}

class WC_Gateway_Paytabs_Omannet extends WC_Gateway_Paytabs
{
protected $_code = 'omannet';
protected $_title = 'PayTabs - OmanNet';
protected $_description = 'PayTabs - OmanNet payment method';
}

class WC_Gateway_Paytabs_Sadad extends WC_Gateway_Paytabs
{
protected $_code = 'sadad';
protected $_title = 'PayTabs - Sadad';
protected $_description = 'PayTabs - Sadad payment method';
}

class WC_Gateway_Paytabs_Atfawry extends WC_Gateway_Paytabs
{
protected $_code = 'atfawry';
protected $_title = 'PayTabs - @Fawry';
protected $_description = 'PayTabs - @Fawry payment method';
}

class WC_Gateway_Paytabs_Knpay extends WC_Gateway_Paytabs
{
protected $_code = 'knpay';
protected $_title = 'PayTabs - KnPay';
protected $_description = 'PayTabs - KnPay payment method';
}

class WC_Gateway_Paytabs_Amex extends WC_Gateway_Paytabs
{
protected $_code = 'amex';
protected $_title = 'PayTabs - Amex';
protected $_description = 'PayTabs - Amex payment method';
}

class WC_Gateway_Paytabs_Valu extends WC_Gateway_Paytabs
{
protected $_code = 'valu';
protected $_title = 'PayTabs - valU';
protected $_description = 'valU payments powered by PayTabs';
}
5 changes: 3 additions & 2 deletions paytabs-paypage.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Plugin Name: PayTabs - WooCommerce Payment Gateway
* Plugin URI: https://paytabs.com/
* Description: PayTabs is a <strong>3rd party payment gateway</strong>. Ideal payment solutions for your internet business.
* Version: 3.2.1
* Version: 3.2.2
* Author: PayTabs
* Author URI: https://paytabs.com/
* Revision Date : 19/April/2020
Expand All @@ -21,7 +21,7 @@
//load plugin function when woocommerce loaded
add_action('plugins_loaded', 'woocommerce_paytabs_init', 0);

define('PAYTABS_PAYPAGE_VERSION', '3.2.1');
define('PAYTABS_PAYPAGE_VERSION', '3.2.2');
define('PAYTABS_PAYPAGE_DIR', plugin_dir_path(__FILE__));
define('PAYTABS_PAYPAGE_ICONS_URL', plugins_url("icons/", __FILE__));
define('PAYTABS_DEBUG_FILE', WP_CONTENT_DIR . "/debug_paytabs.log");
Expand Down Expand Up @@ -52,6 +52,7 @@ function woocommerce_paytabs_init()
}

require_once PAYTABS_PAYPAGE_DIR . "includes/paytabs_payment_methods.php";
require_once PAYTABS_PAYPAGE_DIR . "includes/paytabs_gateways.php";


/**
Expand Down

0 comments on commit ff879d9

Please sign in to comment.