# payplug/2.10.0/src/Front/Layout/OneyBase.php

PayPlug for WooCommerce (Official), version 2.10.0. 93 lines.

- Page: https://pluginprobe.com/plugins/payplug/2.10.0/code/src/Front/Layout/OneyBase.php
- Raw: https://pluginprobe.com/plugins/payplug/2.10.0/raw/src/Front/Layout/OneyBase.php
- Modified: 2024-10-24T16:13:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/payplug/2.10.0/code/src/Front/Layout/OneyBase.php#L10-L20`.

```php
<?php

namespace Payplug\PayplugWoocommerce\Front\Layout;

Abstract Class OneyBase implements InterfaceOneyResources
{

	public function __construct()
	{
		add_action( 'wp_enqueue_scripts', [self::addOneyCSS() ]);
		add_action( 'wp_enqueue_scripts', [self::addOneyJs() ]);
		add_action( 'wp_enqueue_scripts', [self::addOneyScript()]);

	}

	/**
	 * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts.
	 *
	 */
	static function addOneyScript() {
		wp_localize_script('payplug-oney', 'payplug_config', array(
			'ajax_url'      => admin_url('admin-ajax.php'),
			'ajax_action'   => 'simulate_oney_payment'
		));

	}

	/**
	 * Add CSS
	 *
	 */
	static function addOneyCSS() {
		wp_enqueue_style('payplug-oney', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/css/payplug-oney.css', [], PAYPLUG_GATEWAY_VERSION);
	}

	/**
	 * Add JS
	 *
	 */
	static function addOneyJs() {
		wp_enqueue_script('payplug-oney-mobile', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-detect-mobile.js', [], PAYPLUG_GATEWAY_VERSION, true);
		wp_enqueue_script('payplug-oney', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-oney.js', [
			'jquery',
			'jquery-ui-position'
		], PAYPLUG_GATEWAY_VERSION, true);
	}

	/**
	 * Popup Content for Oney Without fees
	 * @param $oney
	 * @return mixed
	 */
	abstract static function simulationPopupContentWithoutFees($oney);

	/**
	 * Popup Content for Oney With fees
	 * @param $oney
	 * @return mixed
	 */
	abstract static function simulationPopupContent($oney);

	/**
	 * Popup footer for Oney without fees
	 * @param $min
	 * @param $max
	 * @return mixed
	 */
	abstract static function footerOneyWithoutFees($min, $max);

	/**
	 * Popup footer for Oney with fees
	 * @param $min
	 * @param $max
	 * @return mixed
	 */
	abstract static function footerOneyWithFees($min, $max);

	/**
	 * disable Oney image on cart
	 * @param $oney
	 * @return mixed
	 */
	abstract static function disabledOneyPopup($oney);

	/**
	 * Oney image on cart
	 * @param $oney
	 * @return mixed
	 */
	abstract static function payWithOney($oney);

}

```
