-
Notifications
You must be signed in to change notification settings - Fork 2
/
pms-taiwan-gateways.php
93 lines (85 loc) · 2.57 KB
/
pms-taiwan-gateways.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/**
* Plugin Name: Paid Member Subscriptions Taiwan Gateways
* Plugin URI: https://www.applemint.tech/
* Description: The extension that helps you to add gateways in Taiwan to the plugin Paid Member Subscriptions.
* Version: 1.1.2
* Requires at least: 5.6
* Requires PHP: 7.3
* Author: applemint Ltd.
* Author URI: https://www.applemint.tech/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: pms-taiwan-gateways
*
* @package pms-taiwan-gateways
*/
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Currently plugin version.
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define( 'PMSTWGATE_VERSION', '1.1.1' );
/**
* The code that runs during plugin activation.
* This action is documented in includes/class-pms-taiwan-gateways-activator.php
*/
/**
* The code that runs during plugin deactivation.
* This action is documented in includes/class-pms-taiwan-gateways-deactivator.php
* To-dos
*/
/**
* The core plugin class that is used to define internationalization,
* admin-specific hooks, and public-facing site hooks.
*/
require plugin_dir_path( __FILE__ ) . 'includes/class-pms-taiwan-gateways.php';
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.0
*/
function run_pms_taiwan_gateways() {
$plugin = new PMS_Taiwan_Gateways();
$plugin->run();
}
run_pms_taiwan_gateways();
if ( ! function_exists( 'pms_custom_gateway' ) ) {
/**
* Add custom gateway for pms.
*
* @since 1.0.0
*
* @param array $arr will retrieve the default gateways.
*/
function pms_custom_gateway( $arr ) {
$arr['ECPay'] = array(
'display_name_user' => __( 'ECPay', 'pms-taiwan-gateways' ),
'display_name_admin' => __( 'ECPay', 'pms-taiwan-gateways' ),
'class_name' => 'PMS_Payment_Gateway_TW_ECPay',
);
return $arr;
}
}
add_filter( 'pms_payment_gateways', 'pms_custom_gateway', 101, 1 );
if ( ! function_exists( 'pms_add_ecpay_payment_type' ) ) {
/**
* Register the label of the payment type.
*
* @since 1.0.0
*
* @param array $arr will retrieve the default gateways.
*/
function pms_add_ecpay_payment_type( $arr ) {
$arr['web_accept_ecpay'] = __( 'ECPay', 'pms-taiwan-gateways' );
return $arr;
}
}
add_filter( 'pms_payment_types', 'pms_add_ecpay_payment_type', 10, 1 );