60 lines
1.2 KiB
PHP
60 lines
1.2 KiB
PHP
<?php
|
|
|
|
/*
|
|
* it means someone outside wp is accessing the file, in this case kill it.
|
|
*/
|
|
if (!defined('ABSPATH')) {
|
|
die('You can not access this file!');
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* call to paypal_shortcode_content()
|
|
*/
|
|
function paypal_shortcode_content_FIPF()
|
|
{
|
|
// if (!can_pay_now_CIPF())
|
|
// return no_payment_CIPF();
|
|
$fipfcard_paypal = new PLGNTLS_class();
|
|
|
|
$pp_client_id = PAYPAL_CLIENT_ID;
|
|
$pp_sdk_currency = "EUR";
|
|
$pp_sdk_base_url = "https://www.paypal.com";
|
|
$pp_sdk_url = "{$pp_sdk_base_url}/sdk/js?client-id={$pp_client_id}¤cy={$pp_sdk_currency}";
|
|
|
|
$paypal_redirection_success = PAYPAL_REDIRECTION_SUCCESS;
|
|
$paypal_redirection_failure = PAYPAL_REDIRECTION_FAILURE;
|
|
$paypal_message_success = PAYPAL_MESSAGE_SUCCESS;
|
|
$paypal_message_failure = PAYPAL_MESSAGE_FAILURE;
|
|
|
|
$added_to_front = $fipfcard_paypal->add_to_front(
|
|
array(
|
|
$pp_sdk_url,
|
|
array("js/paypal/paypal.js", 'type'=>'module'),
|
|
"html/paypal/paypal.html",
|
|
),
|
|
compact (
|
|
'paypal_redirection_success',
|
|
'paypal_redirection_failure',
|
|
'paypal_message_success',
|
|
'paypal_message_failure',
|
|
),
|
|
);
|
|
|
|
return $added_to_front;
|
|
}
|
|
add_shortcode('fipf_paypal_shortcode', 'paypal_shortcode_content_FIPF');
|
|
|
|
|
|
function no_payment_CIPF() {
|
|
return;
|
|
}
|
|
|
|
|
|
|
|
?>
|