61 lines
1.4 KiB
PHP
61 lines
1.4 KiB
PHP
<?php
|
|
|
|
include_once(PLGNTLS_class::get_path() . '/php/paypal/route_api_orders.php');
|
|
|
|
|
|
|
|
/*
|
|
function check_paypal_request()
|
|
{
|
|
error_log("----");
|
|
if (is_page('test_paypal_payment'))
|
|
error_log("on test_paypal_payment");
|
|
else if (is_page('test_paypal_ok'))
|
|
error_log("on test_paypal_ok");
|
|
else if (is_page('test_paypal_infos'))
|
|
error_log("on test_paypal_infos");
|
|
else
|
|
return;
|
|
error_log("_GET");
|
|
error_log(json_encode($_GET));
|
|
error_log("_POST");
|
|
error_log(json_encode($_POST));
|
|
// error_log("_COOKIE");
|
|
// error_log(json_encode($_COOKIE));
|
|
}
|
|
add_action('template_redirect', 'check_paypal_request');
|
|
*/
|
|
|
|
|
|
|
|
|
|
function paypal_shortcode_content()
|
|
{
|
|
$fipfcard_paypal = new PLGNTLS_class();
|
|
/*
|
|
<input type="hidden" name="custom" value="5678" />
|
|
*/
|
|
|
|
$pp_sdk_currency = "EUR";
|
|
$pp_sdk_debug = "true";
|
|
$pp_sdk_base_url="https://sandbox.paypal.com";
|
|
$pp_sdk_base_url="https://www.paypal.com";
|
|
// $pp_sdk_client_token="abc123xyz==";
|
|
$pp_sdk_src="$pp_sdk_base_url/sdk/js?client-id=" . PAYPAL_CLIENT_ID . "¤cy=$pp_sdk_currency&debug=$pp_sdk_debug";
|
|
$pp_sdk_src="$pp_sdk_base_url/sdk/js?client-id=" . PAYPAL_CLIENT_ID ;
|
|
// $pp_sdk_attributes="src='$pp_sdk_src' data-client-token='$pp_sdk_client_token'";
|
|
// $pp_sdk_attributes="src='$pp_sdk_src'";
|
|
// $pp_sdk_html_script="<script $pp_sdk_attributes></script>";
|
|
|
|
return $fipfcard_paypal->add_to_front(
|
|
array(
|
|
$pp_sdk_src,
|
|
"js/paypal/paypal.js",
|
|
"html/paypal/paypal.html",
|
|
),
|
|
);
|
|
}
|
|
|
|
|
|
?>
|