/
/
home
/
melaqxso
/
nymetrocualumni.com
/
wp-content
/
plugins
/
give-square
/
includes
Server: server63.web-hosting.com (198.54.116.184)
You: 216.73.216.61
PHP 7.4.33
Dir:
/home/melaqxso/nymetrocualumni.com/wp-content/plugins/give-square/includes
Edit:
/home/melaqxso/nymetrocualumni.com/wp-content/plugins/give-square/includes/actions.php
<?php /** * Frontend Actions for Give Square Gateway * * @package Give-Square * @since 1.0.0 * @license https://opensource.org/licenses/gpl-license GNU Public License * @copyright Copyright (c) 2018, GiveWP */ // Exit if accessed directly. use Give\Helpers\Call; use GiveSquare\Addon\Log\Log; use GiveSquare\GatewayConnect\Actions\RenewSquareAccessToken; if (!defined('ABSPATH')) { exit; } /** * Add Card Nonce Field to Card Form. * * @since 1.0.0 * * @param array $args List of additional arguments. * * @param int $form_id Donation Form ID. */ function give_square_add_card_nonce_field($form_id, $args) { $id_prefix = !empty($args['id_prefix']) ? $args['id_prefix'] : ''; echo sprintf( '<input type="hidden" id="card-nonce-%1$s" name="card_nonce" value="%2$s"/>', esc_html($id_prefix), give_square_generate_card_nonce() ); } add_action('give_square_after_cc_fields', 'give_square_add_card_nonce_field', 10, 2); /** * Add an errors div per form. * * @since 1.0.0 * * @param array $args List of Donation Arguments. * * @access public * * @param int $form_id Donation Form ID. * * @return void */ function give_square_add_errors($form_id, $args) { echo '<div id="give-square-payment-errors-' . esc_html($args['id_prefix']) . '"></div>'; } add_action('give_donation_form_after_cc_form', 'give_square_add_errors', 8899, 2); /** * This function will be used to renew access token. * * @since 1.2.0 Refactor code to use SquareAccount modal to renew access token * @since 1.0.0 */ function give_square_renew_access_token() { $get_data = give_clean($_GET); $mode = $get_data['mode'] ?: give_square_get_test_mode_text(); try { Call::invoke(RenewSquareAccessToken::class, $mode); $return_url = esc_url_raw( admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=gateways§ion=square-settings&give-messages[]=square-renew-success' ) ); } catch (Exception $exception) { Log::error( sprintf( '%1$s square account renew access token failure', 'test' === $mode ? esc_html__('Sandbox', 'give-square') : esc_html__('Live', 'give-square') ), ['Error' => $exception->getMessage()] ); $return_url = esc_url_raw( admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=gateways§ion=square-settings&give-messages[]=square-renew-failure' ) ); } finally { if (!wp_doing_cron()) { wp_redirect($return_url); } } } add_action('give_weekly_scheduled_events', 'give_square_renew_access_token'); add_action('give_square_renew_token', 'give_square_renew_access_token');
Ukuran: 2.8 KB