wip payment kind of works with bugs
This commit is contained in:
59
plugins/fipfcard_plugin/php/paypal/shortcode.php
Normal file
59
plugins/fipfcard_plugin/php/paypal/shortcode.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user