PluginProbe ʕ •ᴥ•ʔ
GlobalPayments Gateway Provider for WooCommerce / 1.1.4
GlobalPayments Gateway Provider for WooCommerce v1.1.4
1.20.2 1.20.1 1.19.3 1.19.2 1.19.1 1.19.0 1.18.4 1.18.3 trunk 1.0.0 1.0.0-b2 1.0.2 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.6 1.10.7 1.10.8 1.11.0 1.12.0 1.12.1 1.13.0 1.13.1 1.13.2 1.13.3 1.13.4 1.13.7 1.13.8 1.14.0 1.14.1 1.14.2 1.14.3 1.14.4 1.14.5 1.14.6 1.14.7 1.14.8 1.14.9 1.15.0 1.15.2 1.15.4 1.15.5 1.15.6 1.15.8 1.15.9 1.16.0 1.16.1 1.16.2 1.16.3 1.16.4 1.16.5 1.16.6 1.17.0 1.17.1 1.18.0 1.18.1 1.18.2 1.2.0 1.2.1 1.2.2 1.3.0 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5
global-payments-woocommerce / src / Plugin.php
global-payments-woocommerce / src Last commit date
Data 5 years ago Gateways 4 years ago Plugin.php 4 years ago
Plugin.php
84 lines
1 <?php
2 /**
3 * Returns information about the package and handles init.
4 */
5
6 namespace GlobalPayments\WooCommercePaymentGatewayProvider;
7
8 use GlobalPayments\WooCommercePaymentGatewayProvider\Gateways\HeartlandGateway;
9 use GlobalPayments\WooCommercePaymentGatewayProvider\Gateways\HeartlandGiftCards\HeartlandGiftGateway;
10 use GlobalPayments\WooCommercePaymentGatewayProvider\Gateways\HeartlandGiftCards\HeartlandGiftCardOrder;
11
12 defined( 'ABSPATH' ) || exit;
13
14 /**
15 * Main plugin class.
16 */
17 class Plugin {
18 /**
19 * Version.
20 *
21 * @var string
22 */
23 const VERSION = '1.1.4';
24
25 /**
26 * Init the package.
27 */
28 public static function init() {
29 load_plugin_textdomain( 'globalpayments-gateway-provider-for-woocommerce', false, self::get_path() . '/languages' );
30
31 if ( ! class_exists( 'WC_Payment_Gateway' ) ) {
32 return;
33 }
34
35 add_filter( 'woocommerce_payment_gateways', array( self::class, 'add_gateways' ) );
36 add_action( 'woocommerce_order_actions', array( Gateways\AbstractGateway::class, 'addCaptureOrderAction' ) );
37 add_action( 'woocommerce_order_action_capture_credit_card_authorization', array( Gateways\AbstractGateway::class, 'capture_credit_card_authorization' ) );
38 }
39
40 /**
41 * Appends our payment gateways to WooCommerce's known list
42 *
43 * @param string[] $methods
44 *
45 * @return string[]
46 */
47 public static function add_gateways( $methods ) {
48 $gateways = array(
49 Gateways\HeartlandGateway::class,
50 Gateways\GeniusGateway::class,
51 Gateways\TransitGateway::class,
52 Gateways\GpApiGateway::class,
53 );
54
55 foreach ( $gateways as $gateway ) {
56 $methods[] = $gateway;
57 }
58
59 return $methods;
60 }
61
62 /**
63 * Return the version of the package.
64 *
65 * @return string
66 */
67 public static function get_version() {
68 return self::VERSION;
69 }
70
71 /**
72 * Return the path to the package.
73 *
74 * @return string
75 */
76 public static function get_path() {
77 return dirname( __DIR__ );
78 }
79
80 public static function get_url( $path ) {
81 return plugins_url( $path, dirname( __FILE__ ) );
82 }
83 }
84