Jump to content

Customer and cart data


webcoe

Recommended Posts

Hi,

 

I'm new in php and prestashop,

i want to get customer and cart data and use them in my php file

 

the code is

<?php 
// WSCryptDecrypt consuming example in php 
// The script use the NuSoap - SOAP toolkit for PHP http://sourceforge.net/projects/nusoap/ 
//Setting up the basic parameter set to retrieve an encrypted string form GestPay 
$shopLogin = 'GESPAY61751'; //YOUR SHOP LOGIN Eg. production code '9000001' , test code 'gespay0001' 
$currency = '242'; //payment currency 242 -> Euro 
$amount = '0.05'; //payment amount 
$shopTransactionID = 'aBgtsr234wZy7'; //your payment order identifier 
// advanced parameter, to use these you must enable each one on the Merchant Back Office environment 
//$languageId = '2'; //english 
$BuyerName = 'John Smith'; 
$BuyerEmail = '[email protected]'; 
//Custom fileds 
//$customInfo = 'MyCUSTOMPAR1=12*P1*MyCUSTOMPAR2=398'; 
//load the NuSoap toolkit 
require_once($_SERVER["DOCUMENT_ROOT"]."/scorcioni/nusoap.php"); 

//setting up the WSLD url 
//Production 
//$wsdl = "https://ecomms2s.sella.it/gestpay/gestpayws/WSCryptDecrypt.asmx?WSDL"; 
//Test 
$wsdl = "https://testecomm.sella.it/gestpay/gestpayws/WSCryptDecrypt.asmx?WSDL"; 

//NuSoap client 
$client = new nusoap_client($wsdl,true); 
//setting up the parameters array 
$param = array('shopLogin' => $shopLogin, 'uicCode' => $currency, 'amount' => $amount, 'shopTransactionId' => $shopTransactionID); //,'buyerName' => '', 'buyerEmail' => '', 'languageId' => '', 'customInfo' => ''); 
//Call the Encrypt method 
$objectresult = $client->call('Encrypt', $param); 
//Check for call error 
$err = $client->getError(); 
if ($err) { 
// A call error has occurred 
// Display the error 
echo '<h2>Error</h2><pre>' . $err . '</pre>'; 
} else { 
//check ErrorCode 
$errCode = $objectresult['EncryptResult']['GestPayCryptDecrypt']['ErrorCode']; 
if ($errCode == '0') { 
//the call returned the encrypted string 
$encString = $objectresult['EncryptResult']['GestPayCryptDecrypt']['CryptDecryptString']; 
}else{ 
//An error has occurred check ErrorCode and ErrorDescription 
echo '<!DOCTYPE HTML><head><style>html,body{margin: 0;padding: 0;} .error{width:100%;margin:0;border-bottom:1px solid black;background-color:#FFEC8B;text-align:center;font-size:1em;font-weight:blod;color:red;padding: 0;}</style></head><html><body>'; 
echo '<div class="error">Error:'; 
echo $errCode; 
echo '<br>ErrorDesc:'; 
echo $objectresult['EncryptResult']['GestPayCryptDecrypt']['ErrorDescription'] ; 
echo '</div></body></html>'; 
exit(); 
} 
} 

?> 
<!DOCTYPE HTML><head /><body> 
<!-- TEST URL--> 
<form name="PaymentForm" method="POST" action="https://testecomm.sella.it/pagam/pagam.aspx"> 
<!-- Production URL 
<form name="PaymentForm" method="POST" action="https://ecomm.sella.it/pagam/pagam.aspx"> 
--> 
<input type="hidden" name="a" value="<?php echo( $shopLogin) ?>" /> 
<input type="hidden" name="b" value="<?php echo( $encString) ?>" /> 
</form> 
<script> 
document.PaymentForm.submit(); 
</script> 
</body> 
</html> 

i want put those information in $buyerName, $amount, $shopTransactionID, ecc. in this file

 

how can I do it?

 

Thanks

Edited by webcoe (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...