Skip to content

Commit

Permalink
Create selcom.wp.php
Browse files Browse the repository at this point in the history
  • Loading branch information
maukoese authored Jun 13, 2022
1 parent c3d29c2 commit 2fa7b34
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions selcom.wp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/**
* Plugin Name: Selcom WooCommerce Payment Gateway
* Description: Selcom WooCommerce Payment Gateway allows you to accept payments via Selcom.
* Version: 1.0
* Author: Osen Concepts
* Author URI: https://osen.co.ke
* License: GPL2
*
*/

// Make sure WooCommerce is active
if (
!in_array(
'woocommerce/woocommerce.php',
apply_filters('active_plugins', get_option('active_plugins'))
)
) {
return;
}

add_action('plugins_loaded', function () {require_once plugin_dir_path(__FILE__) . 'class.gateway.php';}, 11);
add_filter( 'woocommerce_payment_gateways', fn ($gateways) => array_merge($gateways, ['WC_Gateway_Selcom']), 10, 1 );
add_filter(
'plugin_row_meta', fn ($links, $file) => $file == plugin_basename(__FILE__)
? array_merge($links, ['<a href="https://developers.selcommobile.com">' . __('API Docs') . '</a>'])
: $links
, 10, 2);

0 comments on commit 2fa7b34

Please sign in to comment.