View Single Post
  #5  
Old 11-29-2017, 12:00 PM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: xcart5 module intergration

Quote:
Originally Posted by nivetha
3.this is my question ?

Here is my code which i had used in xcart 4.6 & 4.7 version payment section. Please help me , where i need to use the code in xcart 5.3.3.4 version


// Setup the URL to CartStack...
$emailAddress = $userinfo['email'];

// required, get from session or db...
$cartTotal = $cart['total_cost']; // optional, more accurate reporting...
$url =
"https://api.cartstack.com/ss/v1/?key=6cc64f627ae9418b820a41891dce6b13&siteid=k 5BYYFZK&e
mail=".$emailAddress."&total=". $cartTotal;

// Initialize cURL...
$ch = curl_init();

// Set URL and Return directives...
curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Send the request...
$jsonResponse = curl_exec($ch);

// Close cURL...
curl_close($ch);

// Handle JSON response...
$response = json_decode($jsonResponse, true);

// Successful call is response code 100...
if ($response['resp'] != "100&quot
{ /* Handle error responses, see "Response Codes" above... */ }

When do you want to run this code? Once I know that, I can suggest where to put this code in.

Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote