-
Notifications
You must be signed in to change notification settings - Fork 0
/
woo-paylot.php
74 lines (46 loc) · 1.65 KB
/
woo-paylot.php
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
<?php
/*
Plugin Name: Paylot WooCommerce Crypto-payment Gateway
Plugin URI: https://www.paylot.co
Description: A WooCommerce crypto-payment gateway for WordPress
Version: 1.0
Author: Onyekelu Chukwuebuka
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
WC requires at least: 4.7
WC tested up to: 4.9.8
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
define( 'WC_PAYLOT_MAIN_FILE', __FILE__ );
define( 'WC_PAYLOT_URL', untrailingslashit( plugins_url( '/', __FILE__ ) ) );
function pyl_wc_paylot_init() {
if ( ! class_exists( 'WC_Payment_Gateway' ) ) {
return;
}
if ( class_exists( 'WC_Payment_Gateway_CC' ) ) {
require_once dirname( __FILE__ ) . '/includes/class-paylot.php';
} else{
require_once dirname( __FILE__ ) . '/includes/class-paylot-deprecated.php';
}
add_filter( 'woocommerce_payment_gateways', 'pyl_wc_add_paylot_gateway', 99 );
}
add_action( 'plugins_loaded', 'pyl_wc_paylot_init', 99 );
/**
* Add Settings link to the plugin entry in the plugins menu
**/
function pyl_woo_paylot_plugin_action_links( $links ) {
$settings_link = array(
'settings' => '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=paylot' ) . '" title="View Paylot WooCommerce Settings">Settings</a>'
);
return array_merge( $links, $settings_link );
}
add_filter('plugin_action_links_' . plugin_basename( __FILE__ ), 'pyl_woo_paylot_plugin_action_links' );
/**
* Add Paylot Gateway to WC
**/
function pyl_wc_add_paylot_gateway( $methods ) {
$methods[] = 'pyl_WC_Paylot_Gateway';
return $methods;
}