Need a programmer to implement an API into cs-cart as a payment module.

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

Holy smokes… no one can helop me out in the midle of so many developers here?

Quite impressive, guess I need to give the cash to some one else.

[quote name=‘nbento’]Holy smokes… no one can helop me out in the midle of so many developers here?

Quite impressive, guess I need to give the cash to some one else.[/quote]



I only read english bro - kinda hard to know what you want developed if the spec is in russian.

Thats not russian, thats Portuguese… BIG difference.



I’ll translate.

```php

// Include the SOAP classes
require_once('nusoap/lib/nusoap.php');


// Specify the Hi-Media client account
// Put your Login and Password like this: $idcliente=”EXAMPLE” and
// $password="EXAMPLE"

// variables that need to be filled:

$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="test info";
$email = "test@email.com";

// Variables to recieve values from Hi media

$reference = "";
$entity = "";
$value = "";
$error = "";

$res = getReferenceFromWebService($username, $password, $valor, $origem, $informacao, $email, $reference, $entity, $value, $error);

// show values

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;

}
?> ```



Let me know if this is enough.

nbento,



Como é que funciona isso do pagamento por multibanco, precisas de ter algum contrato com um banco… podes explicar? É que a mim me dava imenso jeito para os clientes portugueses, só que não sei como fazer ou onde pedir. Se puder ter o mesmo na minha loja até divido o preço do addon contigo (se não fôr muito claro claro).

E.Qi.Librium

vaais ao comprafacil.pt e registas a tua emrpesa. Está feito. Só que tens de gerar a porcaria das referências a mão… ora se tiveres muitas torna-se complicado. Eles forneçem a tal API, mas é neecssário integral-la o que pelos vistos aqui ninguém deve saber o que fazer lol

Obrigada, vou lá ver isso :wink:

So. No one?