PluginProbe
PayPlug for WooCommerce (Official) / 2.6.4
PayPlug for WooCommerce (Official) v2.6.4
3.0.0 2.18.0 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.1.0 1.10.0 1.10.1 1.2.1 1.2.10 1.2.11 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 All 101 releases
payplug / src / Front / Layout / OneyBase.php

OneyBase.php in PayPlug for WooCommerce (Official) 2.6.4, at src/Front/Layout/OneyBase.php

93 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Payplug\PayplugWoocommerce\Front\Layout;
4
5 Abstract Class OneyBase implements InterfaceOneyResources
6 {
7
8 public function __construct()
9 {
10 add_action( 'wp_enqueue_scripts', [self::addOneyCSS() ]);
11 add_action( 'wp_enqueue_scripts', [self::addOneyJs() ]);
12 add_action( 'wp_enqueue_scripts', [self::addOneyScript()]);
13
14 }
15
16 /**
17 * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts.
18 *
19 */
20 static function addOneyScript() {
21 wp_localize_script('payplug-oney', 'payplug_config', array(
22 'ajax_url' => admin_url('admin-ajax.php'),
23 'ajax_action' => 'simulate_oney_payment'
24 ));
25
26 }
27
28 /**
29 * Add CSS
30 *
31 */
32 static function addOneyCSS() {
33 wp_enqueue_style('payplug-oney', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/css/payplug-oney.css', [], PAYPLUG_GATEWAY_VERSION);
34 }
35
36 /**
37 * Add JS
38 *
39 */
40 static function addOneyJs() {
41 wp_enqueue_script('payplug-oney-mobile', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-detect-mobile.js', [], PAYPLUG_GATEWAY_VERSION, true);
42 wp_enqueue_script('payplug-oney', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-oney.js', [
43 'jquery',
44 'jquery-ui-position'
45 ], PAYPLUG_GATEWAY_VERSION, true);
46 }
47
48 /**
49 * Popup Content for Oney Without fees
50 * @param $oney
51 * @return mixed
52 */
53 abstract static function simulationPopupContentWithoutFees($oney);
54
55 /**
56 * Popup Content for Oney With fees
57 * @param $oney
58 * @return mixed
59 */
60 abstract static function simulationPopupContent($oney);
61
62 /**
63 * Popup footer for Oney without fees
64 * @param $min
65 * @param $max
66 * @return mixed
67 */
68 abstract static function footerOneyWithoutFees($min, $max);
69
70 /**
71 * Popup footer for Oney with fees
72 * @param $min
73 * @param $max
74 * @return mixed
75 */
76 abstract static function footerOneyWithFees($min, $max);
77
78 /**
79 * disable Oney image on cart
80 * @param $oney
81 * @return mixed
82 */
83 abstract static function disabledOneyPopup($oney);
84
85 /**
86 * Oney image on cart
87 * @param $oney
88 * @return mixed
89 */
90 abstract static function payWithOney($oney);
91
92 }
93