-
Notifications
You must be signed in to change notification settings - Fork 0
/
omoney.php
48 lines (37 loc) · 1.36 KB
/
omoney.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
<?php
/**
* @package Omoney
*/
/*
Plugin Name: Orange Money
Description: Orange money plugin to enable purchase by orange money.
Version: 1.0
Author: Mamoudou SISSOKO
Author URI: https://www.linkedin.com/in/mamoudou-sissoko-1169a6170
*/
if ( !function_exists( 'add_action' ) ) {
echo 'Hi there! You\'re not supposed to be here.';
exit;
}
define( 'OMONEY_VERSION', '1.0' );
define( 'OMONEY_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
require_once( OMONEY_PLUGIN_DIR . 'class.omoney.http.helper.php' );
require_once( OMONEY_PLUGIN_DIR . 'class.omoney.manager.php' );
/* require_once( OMONEY_PLUGIN_DIR . 'class.omoney.gateway.php' ); */
require_once( OMONEY_PLUGIN_DIR . 'class.omoney.php' );
register_activation_hook( __FILE__, array( 'Omoney', 'plugin_activation' ) );
register_deactivation_hook( __FILE__, array( 'Omoney', 'plugin_deactivation' ) );
add_action( 'init', array( 'Omoney', 'init' ) );
function orangemoney_add_gateway_class( $gateways ) {
$gateways[] = 'WC_OMoney_Gateway';
return $gateways;
}
function orangemoney_init_gateway_class() {
include "class.omoney.gateway.php";
}
add_filter( 'woocommerce_payment_gateways', 'orangemoney_add_gateway_class' );
add_action( 'plugins_loaded', 'orangemoney_init_gateway_class' );
if (is_admin()) {
require_once( OMONEY_PLUGIN_DIR . 'class.omoney-admin.php' );
add_action( 'init', array( 'OmoneyAdmin', 'init' ) );
}