Credit Mutuel CyberMUT functionsCyberMUT
This extension allows you to process credit cards transactions using Credit
Mutuel CyberMUT system (http://www.creditmutuel.fr/centre_commercial/vendez_sur_internet.html).
CynerMUT is a popular Web Payment Service in France, provided by the
Credit Mutuel bank. If you are foreign in France, these functions will not
be useful for you.
These functions are only available if PHP has been compiled with the
option, where DIR is
the location of libcm-mac.a and cm-mac.h. You will require the
appropriate SDK for your platform, which may be sent to you after your
CyberMUT's subscription (contact them via Web, or go to the nearest
Credit Mutuel).
The use of these functions is almost identical to the original functions,
except for the parameters of return for CreerFormulaireCM and CreerReponseCM,
which are returned directly by functions PHP, whereas they had passed in
reference in the original functions.
These functions have been added in PHP 4.0.4. ???
These functions only provide a link to CyberMUT SDK. Be sure to read the
CynerMUT Developers Guide for full details of the required parameters.
cybermut_creerformulairecmGenerate HTML form of request for paymentDescriptionstring pfpro_initstring url_CMstring versionstring TPEstring montantstring ref_commandestring texte_librestring url_retourstring url_retour_okstring url_retour_errstring languestring code_societestring texte_boutoncynermut_creerformulairecm is used to generate the
HTML form of request for payment.
See also cybermut_testmaccybermut_creerreponsecm.
First step of payment (equiv cgi1.c)
<?php
// Directory where are located the keys
putenv("CMKEYDIR=/var/creditmut/cles");
// Version number
$VERSION="1.2";
$retour = creditmut_creerformulairecm(
"https://www.creditmutuel.fr/test/telepaiement/paiement.cgi",
$VERSION,
"1234567890",
"300FRF",
$REFERENCE,
$TEXTE_LIBRE,
$URL_RETOUR,
$URL_RETOUR_OK,
$URL_RETOUR_ERR,
"francais",
"company",
"Paiement par carte bancaire");
echo $retour;
?>
cybermut_testmacMake sure that there no was data diddling contained
in the received message of confirmation Descriptionbool cybermut_testmacstring code_MACstring versionstring TPEstring cdatestring montantstring ref_commandestring texte_librestring code-retourcybermut_testmac is used to make sure that there was
not data diddling contained in the received message of confirmation.
Pay attention to parameters code-retour and texte-libre, which cannot be
evaluated as is, because auf the dash. You must retrieve them by using:
$code_retour=$HTTP_GET_VARS["code-retour"];
$texte_libre=$HTTP_GET_VARS["texte-libre"];
See also cybermut_creerformulairecmcybermut_creerreponsecm.
Last step of payment (equiv cgi2.c)
<?php_track_vars?>
<?php
// Directory where are located the keys
putenv("CMKEYDIR=/var/creditmut/cles");
// Version number
$VERSION="1.2";
$texte_libre = $HTTP_GET_VARS["texte-libre"];
$code_retour = $HTTP_GET_VARS["code-retour"];
$mac_ok = creditmut_testmac($MAC,$VERSION,$TPE,$date,$montant,$reference,$texte_libre,$code_retour);
if ($mac_ok) {
//
// insert data processing here
//
//
$result=creditmut_creerreponsecm("OK");
} else {
$result=creditmut_creerreponsecm("Document Falsifie");}
?>
cybermut_creerreponsecmGenerate the acknowledgement of delivery of the confirmation
of paymentDescriptionstring cybermut_creerreponsecmstring phrase
Returns: string containing the message of aknowledgement of delivery.
The parameter is "OK" if the message of confirmation of the payment
were correctly auhentified by cybermut_testmac.
Any other chain is regarded as an error message.
See also cybermut_creerformulairecmcybermut_testmac.