Credit Mutuel CyberMUT functions CyberMUT 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_creerformulairecm Generate HTML form of request for payment Description string pfpro_init string url_CM string version string TPE string montant string ref_commande string texte_libre string url_retour string url_retour_ok string url_retour_err string langue string code_societe string texte_bouton cynermut_creerformulairecm is used to generate the HTML form of request for payment. See also cybermut_testmac cybermut_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_testmac Make sure that there no was data diddling contained in the received message of confirmation Description bool cybermut_testmac string code_MAC string version string TPE string cdate string montant string ref_commande string texte_libre string code-retour cybermut_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_creerformulairecm cybermut_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_creerreponsecm Generate the acknowledgement of delivery of the confirmation of payment Description string cybermut_creerreponsecm string 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_creerformulairecm cybermut_testmac.