' . esc_html__( 'MemoMatch needs WooCommerce to be installed and active.', 'memomatch' ) . '
'; } ); return; } require_once MEMOMATCH_DIR . 'includes/class-memomatch-gateway.php'; require_once MEMOMATCH_DIR . 'includes/class-memomatch-gateway-zelle.php'; require_once MEMOMATCH_DIR . 'includes/class-memomatch-gateway-venmo.php'; require_once MEMOMATCH_DIR . 'includes/class-memomatch-gateway-cashapp.php'; require_once MEMOMATCH_DIR . 'includes/class-memomatch-admin.php'; add_filter( 'woocommerce_payment_gateways', 'memomatch_register_gateways' ); MemoMatch_Admin::init(); } ); /** * List of gateway class names. * * @return string[] */ function memomatch_gateway_classes() { return array( 'MemoMatch_Gateway_Zelle', 'MemoMatch_Gateway_Venmo', 'MemoMatch_Gateway_CashApp' ); } /** * Add our gateways to WooCommerce. * * @param array $gateways Existing gateways. * @return array */ function memomatch_register_gateways( $gateways ) { return array_merge( $gateways, memomatch_gateway_classes() ); } /** * Register the gateways with the block based checkout. */ add_action( 'woocommerce_blocks_loaded', function () { if ( ! class_exists( '\Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' ) ) { return; } require_once MEMOMATCH_DIR . 'includes/class-memomatch-blocks.php'; add_action( 'woocommerce_blocks_payment_method_type_registration', function ( $registry ) { foreach ( array( 'memomatch_zelle', 'memomatch_venmo', 'memomatch_cashapp' ) as $id ) { $registry->register( new MemoMatch_Blocks( $id ) ); } } ); } ); /** * Settings link on the plugins screen. */ add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), function ( $links ) { $url = admin_url( 'admin.php?page=wc-settings&tab=checkout' ); array_unshift( $links, '' . esc_html__( 'Settings', 'memomatch' ) . '' ); return $links; } ); /** * Link to MemoMatch Pro on the plugins screen when Pro is not installed. */ add_filter( 'plugin_row_meta', function ( $links, $file ) { if ( plugin_basename( MEMOMATCH_FILE ) === $file && ! defined( 'MMP_VERSION' ) ) { $links[] = '' . esc_html__( 'Confirm payments automatically with MemoMatch Pro', 'memomatch' ) . ''; } return $links; }, 10, 2 ); /** * Where to buy MemoMatch Pro. * * @return string */ function memomatch_pro_url() { return 'https://checkout.freemius.com/plugin/44669/plan/78723/'; }