Well guys as the title says.
I need some one with goog knowloage of cs-cart to implement a payment module API to the cs-cart for me.
This module generates MB references to the client so he can go to an ATM and pay the value with 3 parts:
entity
Reference (generated by the entity)
Value (price of the product given by the cs-cart)
This is the API:
```php
// Include the SOAP classes
require_once('nusoap/lib/nusoap.php');
// Specify the Hi-Media client account
// Coloque o seu Login e Password da seguinte forma: $idcliente=â€EXEMPLO†e
// $password="EXEMPLO"
// variaveis a preencher:
$username="yourusername";
$password="yourpassword";
$origem="teste"; //For your reference, you can write anything you want (for further information check other Hi-Media documentation)
$valor="10.98";
$informacao="informacao teste";
$email = "test@email.com";
// variaveis para receber valores
$reference = "";
$entity = "";
$value = "";
$error = "";
$res = getReferenceFromWebService($username, $password, $valor, $origem, $informacao, $email, $reference, $entity, $value, $error);
// mostrar valores
if($res){
echo (" entidade: ".$entity."
referencia: ".$reference."
valor: ".$value." euros ");
}
else{
echo ( "error: ".$error);
}
function getReferenceFromWebService($username, $password, $valor, $origem, $informacao, $email, &$reference, &$entity, &$value, &$error){
$IDUserBackoffice="-1";
$action='http://hm.comprafacil.pt/SIBSClick/webservice/SaveCompraToBDValor2';
$serverpath ='https://hm.comprafacil.pt/SIBSClick/webservice/clicksmsV4.asmx';
$client = new soapclient($serverpath);
// Check for errors and output them
$err = $client->getError();
if ($err) {
echo '
Constructor error
' . $err . '';
}
// Compose the SOAP message
$msg=$client->serializeEnvelope(''.$origem.''.$username.''.$password.''.$valor.''.$informacao.''.$email.''.$IDUserBackoffice.'','',array(),'document', 'literal');
// Send the SOAP message
$response = $client->send($msg,$action);
// Check for errors and output them
if ($client->fault) {
echo '
Fault
';';
print_r($response);
echo '
}
// Output the SOAP query and response
//echo "
SOAP query
";//echo '
' . htmlspecialchars($client->request, ENT_QUOTES) . '';
//echo "
SOAP response
";//echo '
' . htmlspecialchars($client->response, ENT_QUOTES) . '';
// Save the SOAP response result to a variable
$result=$response['SaveCompraToBDValor2Result'];
$res = false;
if($result == "true"){
//Save the SOAP response result values to the corresponding variables
$reference=$response['referencia'];
$entity=$response['entidade'];
$value=$response['valorOut'];
$error=$response['error'];
$res = true;
}
else{
$error=$response['error'];
}
return $res;
}
?>
```
For those who dont understand this payment heres an example:
I choosed on a store where I buy stuff this type of payment. Once I clicked it something shows down the text like this:
Than the client proceeds with the normal checkout after payment is choosen.
Regards
Nelson