webcoe Posted November 24, 2014 Share Posted November 24, 2014 (edited) Salve a tutti, sono abbastanza nuovo in ambito php e prestashop ho necessità di passare ad un file php dei dati cliente e del carrello per effettuare pagamenti tramite il portale gestpay il codice di esempio che ho per fare i test di funzionamento è <?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> dovrei passare a questo file informazioni come il prezzo totale (amount) il nome dell'acquirente, l'id della transazione ecc. per poi poterle usare al suo interno Come posso fare per ottenere e passare questi dati? Edited November 24, 2014 by webcoe (see edit history) Link to comment Share on other sites More sharing options...
webcoe Posted November 25, 2014 Author Share Posted November 25, 2014 Nessuno? Link to comment Share on other sites More sharing options...
webcoe Posted November 27, 2014 Author Share Posted November 27, 2014 up Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now