wip paypal tests

This commit is contained in:
asus
2024-02-21 23:58:53 +01:00
parent 6158f738a2
commit 1262aeb706
3 changed files with 88 additions and 4 deletions

View File

@@ -79,6 +79,7 @@ $data = $data->user_email;
$acf_get_fields = get_fields( get_the_ID() );
$user_data = get_userdata( get_current_user_id() );
$current_user = wp_get_current_user();
$user_email = get_field('user_email', 'MarieM');
return $fipfcard_tools->add_to_front
@@ -103,6 +104,7 @@ $data = $data->user_email;
"acf_get_fields",
"user_data",
"current_user",
"user_email",
"names",
"ages",
)
@@ -120,13 +122,91 @@ function custom_frontend_posting_form() {
}
add_shortcode('custom_frontend_posting_form', 'custom_frontend_posting_form');
// function author_shortode_test($field) {
// // global $authordata;
// // $user_id = $authordata->ID;
//
// $author_username = get_query_var('author_name');
// $author = get_user_by('slug', $author_username);
// $user_id = $author->ID;
//
// $acf_field = $field['field'];
// $acf_post_id = "user_{$user_id}";
//
// $acf_shortcode = "[acf field='" . $acf_field . "' post_id='" . $acf_post_id . "']";
//
// error_log("---");
// error_log("acf_shortcode:");
// error_log($acf_shortcode);
// // error_log("get_userdata:");
// // error_log(json_encode(get_userdata($user_id)->data->user_email));
// error_log("get_fields($acf_post_id):");
// error_log(json_encode(get_fields($acf_post_id)));
// error_log("get_field($acf_field, $acf_post_id):");
// error_log(json_encode(get_field($acf_field, $acf_post_id)));
//
// //$shortcode = "[acf field=" . $field['field'] . "]";
// wp_reset_query();
// $acf_return = do_shortcode($acf_shortcode);
// // error_log("acf_return:");
// // error_log(json_encode($acf_return));
// return $acf_return;
// // regarder option repeter de diviengine
// // peutetre plugin gratuit ?
// // plugin menu avec conditions
// }
// add_shortcode('fipf_acf', 'author_shortode_test', 10, 1);
function check_paypal_request()
{
error_log("----");
if (is_page('paypal_ok'))
error_log("on paypal_ok");
else if (is_page('paypal_infos'))
error_log("on paypal_infos");
else
return;
error_log("_GET");
error_log(json_encode($_GET));
error_log("_POST");
error_log(json_encode($_POST));
}
add_action('template_redirect', 'check_paypal_request');
function paypal_shortcode_content()
{
ob_start();
?>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="83KQ9F8BSP7NQ" />
<input type="hidden" name="currency_code" value="EUR" />
<input type="image" src="https://www.paypalobjects.com/fr_XC/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" title="PayPal, votre réflexe sécurité pour payer en ligne." alt="Acheter" />
</form>
<?php
return ob_get_clean();
}
add_shortcode('fipf_paypal_shortcode', 'paypal_shortcode_content');
//function my_custom_url_handler($query)
//{
// if ($_SERVER['REQUEST_METHOD'] !== 'POST' )
// return ;
// if ($_SERVER['QUERY_STRING'] !== 'update_profile_acf' )
// return ;
// // ! add verification that user can do this edit !
//
// foreach($_POST['field_name'] as $field)
// {
// error_log("_POST[$field]");
// error_log($_POST[$field]);
// }
//}
/*