PluginProbe
Cashfree for WooCommerce / 4.8.0
Cashfree for WooCommerce v4.8.0
4.8.1 4.8.0 trunk 1.0 1.2 4.2.1 4.2.2 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.5.0 4.5.1 All 42 releases
cashfree / includes / wc-cashfree-functions.php

wc-cashfree-functions.php in Cashfree for WooCommerce 4.8.0, at includes/wc-cashfree-functions.php

36 lines 999 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Cashfree functions
4 */
5
6 defined( 'ABSPATH' ) || exit;
7
8 function wc_get_cashfree_template( $template_name, $args = array(), $template_path = '' ) {
9 wc_get_template( $template_name, $args, $template_path, WC_CASHFREE_DIR_PATH . 'templates/' );
10 }
11
12 /**
13 * Register the script and inject parameters.
14 *
15 * @param string $handle Script handle the data will be attached to.
16 * @param array|null $params Parameters injected.
17 */
18 function wc_cashfree_script( $handle, $params = null ) {
19 $script = ( include 'wc-cashfree-scripts.php' )[ $handle ];
20 wp_enqueue_script( $handle, $script['src'], $script['deps'], $script['version'], true );
21
22 if ( null !== $params ) {
23 wp_localize_script( $handle, str_replace( '-', '_', $handle ) . '_params', $params );
24 }
25 }
26
27 /**
28 * Register and load wc-cashfree script.
29 *
30 * @param array $settings Gateway settings.
31 */
32 function wc_cashfree_js( $settings ) {
33 wc_cashfree_script('wc-cashfree-checkout-js');
34 wc_cashfree_script('wc-cashfree-checkout');
35 }
36