- added a default css file to include to have a first handle

- cahnged get_path/url to root_path/url
- changed path setup -> now automatic from inside plugin
This commit is contained in:
asus
2024-03-10 22:37:38 +01:00
parent 9ee35b23bc
commit 1021d9bf71
7 changed files with 146 additions and 127 deletions

View File

@@ -18,7 +18,7 @@ if (!defined('ABSPATH')) {
function add_my_jquery_patch()
{
$handle = 'jquery_validator_url_patch';
$url = PLGNTLS_class::get_url() . 'js/form_builder_patch/url_validation.js';
$url = PLGNTLS_class::root_url() . 'js/form_builder_patch/url_validation.js';
$dependencies = array('de_fb_validate');
$version = '';
$defer = true;

View File

@@ -9,14 +9,14 @@ if (!defined('ABSPATH')) {
include_once(PLGNTLS_class::get_path() . '/php/utils/http_errors.php');
include_once(PLGNTLS_class::get_path() . '/php/paypal/route_api_utils.php');
include_once(PLGNTLS_class::get_path() . '/php/paypal/user_can_pay.php');
include_once(PLGNTLS_class::get_path() . '/php/paypal/update_user_payment.php');
include_once(PLGNTLS_class::get_path() . '/php/paypal/shortcode.php');
include_once(PLGNTLS_class::get_path() . '/php/paypal/route_api_orders.php');
include_once(PLGNTLS_class::get_path() . '/php/paypal/route_api_orders_capture.php');
include_once(PLGNTLS_class::get_path() . '/php/paypal/routes.php');
include_once(PLGNTLS_class::root_path() . '/php/utils/http_errors.php');
include_once(PLGNTLS_class::root_path() . '/php/paypal/route_api_utils.php');
include_once(PLGNTLS_class::root_path() . '/php/paypal/user_can_pay.php');
include_once(PLGNTLS_class::root_path() . '/php/paypal/update_user_payment.php');
include_once(PLGNTLS_class::root_path() . '/php/paypal/shortcode.php');
include_once(PLGNTLS_class::root_path() . '/php/paypal/route_api_orders.php');
include_once(PLGNTLS_class::root_path() . '/php/paypal/route_api_orders_capture.php');
include_once(PLGNTLS_class::root_path() . '/php/paypal/routes.php');

View File

@@ -138,12 +138,14 @@ function failure_payment_for_user_CIPF($user_id, $order_id, $status) {
$acf_id = 'user_'.$user_id;
/*
* remove the order_id from user meta
*
*/
delete_user_meta($user_id, $meta_order_id, $order_id);
/*
* change payement status to failed
* - 'started' -> at order creation
@@ -156,13 +158,11 @@ function failure_payment_for_user_CIPF($user_id, $order_id, $status) {
/*
* change user profil :
* - to active
* - card state is renewal
* other changes on user :
* - pofil is inactive
*
*/
update_field($prof_is_activ['_name'], $prof_is_activ['activ'], $acf_id);
update_field($acf_card_state['_name'], $acf_card_state['renew'], $acf_id);
update_field($prof_is_activ['_name'], $prof_is_activ['inactiv'], $acf_id);
}
@@ -188,12 +188,6 @@ function validate_payment_for_user_CIPF($user_id, $order_id) {
*/
delete_user_meta($user_id, $meta_order_id, $order_id);
/*
* change payement status to success
*
*/
update_field($acf_payment_status['_name'], $acf_payment_status['success'], $acf_id);
/*
* acf uses 'Y-m-d H:i:s' format : https://www.advancedcustomfields.com/resources/date-time-picker/
*
@@ -246,15 +240,15 @@ function validate_payment_for_user_CIPF($user_id, $order_id) {
update_field($acf_card_expiration['_name'], $date_plus_one_year->format($acf_date_format), $acf_id);
/*
* change user profil :
* - to active
* change user :
* - profile is active
* - card state is renewal
* - cannot renew
* - payement status is success
*
*/
update_field($prof_is_activ['_name'], $prof_is_activ['activ'], $acf_id);
update_field($acf_card_state['_name'], $acf_card_state['renew'], $acf_id);
//update_field($acf_prof_can_renew['_name'], $acf_prof_can_renew['cannot'] , $acf_id);
update_field($acf_payment_status['_name'], $acf_payment_status['success'], $acf_id);
}