<?php

/*

Plugin Name: WooCommerce Bank Of Baroda E-Gateway

Plugin URI: http://wordpress.org/plugins/woocommerce-BankOfBaroda

Description: Add Bank Of Baroda E-Gateway for WooCommerce.

Version: 1.0.0

Author: Tanvi Chanchalani

Author URI: http://www.iconwebsolutions.info/bank-of-baroda-e-gateway-plugin-for-woocommerce/

*/



//Additional links on the plugin page

add_filter( 'plugin_row_meta', 'wcCpg_register_plugin_links1', 10, 2 );

function wcCpg_register_plugin_links1($links, $file) {

	$base = plugin_basename(__FILE__);

	if ($file == $base) {

		$links[] = '<a href="http://www.iconwebsolutions.info/" target="_blank">' . __( 'Icon Web Solutions', 'rsb' ) . '</a>';

		$links[] = '<a href="http://icontraining.in/" target="_blank">' . __( 'Icon Training', 'rsb' ) . '</a>';

	}

	return $links;

}







/* WooCommerce fallback notice. */

function woocommerce_cpg_fallback_notice1() {

    echo '<div class="error"><p>' . sprintf( __( 'WooCommerce Bank Of Baroda E-Gateway depends on the last version of %s to work!', 'wcCpg' ), '<a href="http://wordpress.org/extend/plugins/woocommerce/">WooCommerce</a>' ) . '</p></div>';

}



/* Load functions. */

function bob_payment_gateway_load() {

    if ( ! class_exists( 'WC_Payment_Gateway' ) ) {

        add_action( 'admin_notices', 'woocommerce_cpg_fallback_notice1' );

        return;

    }

   

    function wc_bob_add_gateway( $methods ) {

        $methods[] = 'WC_BOB_Payment_Gateway';

             return $methods;

    }

	add_filter( 'woocommerce_payment_gateways', 'wc_bob_add_gateway' );

	

	

    // Include the WooCommerce Custom Payment Gateways classes.

    require_once plugin_dir_path( __FILE__ ) . 'class-wc-bob_payment_gateway.php';
	

  }



add_action( 'plugins_loaded', 'bob_payment_gateway_load', 0 );







/* Adds custom settings url in plugins page. */

function wcCpg_action_links1( $links ) {

    $settings = array(

		'settings' => sprintf(

		'<a href="%s">%s</a>',

		admin_url( 'admin.php?page=woocommerce_settings&tab=payment_gateways' ),

		__( 'Payment Gateways', 'wcCpg' )

		)

    );



    return array_merge( $settings, $links );

}

add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'wcCpg_action_links1' );





?>