-
Notifications
You must be signed in to change notification settings - Fork 0
/
wsuws-woocommerce-payment-gateway.php
37 lines (32 loc) · 1.36 KB
/
wsuws-woocommerce-payment-gateway.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
<?php
/*
Plugin Name: WSUWS WooCommerce Payment Gateway
Version: 1.5.0
Description: A WooCommerce payment gateway for WSU's webservice payment system.
Author: washingtonstateuniversity, jeremyfelt
Author URI: https://web.wsu.edu/
Plugin URI: https://github.com/washingtonstateuniversity/WSUWP-Plugin-WSUWS-WooCommerce-Payment-Gateway
*/
namespace WSU\WSUWS_Woo_Gateway;
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
add_action( 'plugins_loaded', 'WSU\WSUWS_Woo_Gateway\bootstrap' );
/**
* Loads the WSUWS payment gateway class, which extends WooCommerce.
*
* @since 0.0.1
*/
function bootstrap() {
if ( class_exists( 'WC_Payment_Gateway' ) ) {
require dirname( __FILE__ ) . '/includes/class-payment-gateway.php';
add_filter( 'woocommerce_payment_gateways', array( '\WSU\WSUWS_Woo_Gateway\Gateway\Payment_Gateway', 'add_gateway' ) );
}
include_once dirname( __FILE__ ) . '/includes/gateway-response.php';
include_once dirname( __FILE__ ) . '/includes/gateway-request.php';
include_once dirname( __FILE__ ) . '/includes/include-settings.php';
include_once dirname( __FILE__ ) . '/includes/product-settings.php';
add_action( 'woocommerce_order_status_on-hold_to_processing', '\WSU\WSUWS_Woo_Gateway\request\capture_payment' );
add_action( 'woocommerce_order_status_on-hold_to_completed', '\WSU\WSUWS_Woo_Gateway\request\capture_payment' );
}