-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsimpay-woocommerce-payment.php
53 lines (43 loc) · 1.56 KB
/
simpay-woocommerce-payment.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
<?php
/*
* Plugin Name: SimPay.pl Płatności Online WooCommerce
* Plugin URI: https://simpay.pl
* Description: Wtyczka WooCommerce, która umożliwi Ci przyjmowanie płatności Online
* Version: 1.0.2
* Author: Payments Solution Sp. z o.o.
* Author URI: https://simpay.pl
* Developer: Patryk Vizauer
* Developer URI: https://github.com/PatryQHyper
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: simpay_woocommerce_payment
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action( 'plugins_loaded', 'simpay_woocommerce_payment_init' );
function simpay_woocommerce_payment_init() {
if ( ! class_exists( 'WC_Payment_Gateway' ) ) {
return;
}
require_once plugin_dir_path( __FILE__ ) . 'src/SimPay_Gateway.php';
require_once plugin_dir_path( __FILE__ ) . 'src/SimPay_IPN_Handler.php';
add_filter( 'woocommerce_payment_gateways', 'simpay_woocommerce_payment_gateways' );
function simpay_woocommerce_payment_gateways( $methods ) {
$methods[] = 'SimPay_Gateway';
return $methods;
}
}
add_action( 'enqueue_block_assets', 'simpay_woocommerce_payment_block_assets' );
function simpay_woocommerce_payment_block_assets() {
if ( ! function_exists( 'is_checkout' ) || ! is_checkout() ) {
return;
}
wp_enqueue_script(
'simpay_woocommerce_payment_blocks_integration',
plugins_url( 'assets/js/simpay_woocommerce_payment_blocks_integration.js', __FILE__ ),
array( 'wc-blocks-registry', 'wp-element', 'wp-i18n', 'wp-hooks' ),
'1.0.0',
true
);
}