moved all const in class
This commit is contained in:
@@ -56,15 +56,18 @@ async function handleResponse(response) {
|
||||
*/
|
||||
function generate_access_token_CIPF()
|
||||
{
|
||||
$paypal_client_id = PLGNTLS_class::PAYPAL_CLIENT_ID;
|
||||
$paypal_client_secret = PLGNTLS_class::PAYPAL_CLIENT_SECRET;
|
||||
$paypal_api_base_url = PLGNTLS_class::PAYPAL_API_BASE_URL;
|
||||
try
|
||||
{
|
||||
if ( !PAYPAL_CLIENT_ID || !PAYPAL_CLIENT_SECRET ) {
|
||||
if ( !$paypal_client_id || !$paypal_client_secret ) {
|
||||
throw new Exception( "MISSING_API_CREDENTIALS" );
|
||||
}
|
||||
$credentials = PAYPAL_CLIENT_ID . ":" . PAYPAL_CLIENT_SECRET;
|
||||
$credentials = $paypal_client_id . ":" . $paypal_client_secret;
|
||||
$auth = base64_encode($credentials);
|
||||
|
||||
$url = PAYPAL_API_BASE_URL . '/v1/oauth2/token';
|
||||
$url = $paypal_api_base_url . '/v1/oauth2/token';
|
||||
$body = http_build_query(array('grant_type' => 'client_credentials'));
|
||||
// Initialize curl
|
||||
$ch = curl_init();
|
||||
|
||||
@@ -17,19 +17,23 @@ if (!defined('ABSPATH')) {
|
||||
*/
|
||||
function paypal_shortcode_content_CIPF()
|
||||
{
|
||||
$slug_paypal_redirection_success = PLGNTLS_class::SLUG_PAYPAL_REDIRECTION_SUCCESS;
|
||||
$slug_paypal_redirection_failure = PLGNTLS_class::SLUG_PAYPAL_REDIRECTION_FAILURE;
|
||||
$paypal_client_id = PLGNTLS_class::PAYPAL_CLIENT_ID;
|
||||
$paypal_message_success = PLGNTLS_class::PAYPAL_MESSAGE_SUCCESS;
|
||||
$paypal_message_failure = PLGNTLS_class::PAYPAL_MESSAGE_FAILURE;
|
||||
|
||||
// if (!can_pay_now_CIPF())
|
||||
// return no_payment_CIPF();
|
||||
$cipfcard_paypal = new PLGNTLS_class();
|
||||
|
||||
$pp_client_id = PAYPAL_CLIENT_ID;
|
||||
$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;
|
||||
$paypal_redirection_success = home_url() . '/' . $slug_paypal_redirection_success;
|
||||
$paypal_redirection_failure = home_url() . '/' . $slug_paypal_redirection_failure;
|
||||
|
||||
$added_to_front = $cipfcard_paypal->add_to_front(
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user