diff --git a/functions/cybermut.xml b/functions/cybermut.xml new file mode 100755 index 0000000000..de9694eaa2 --- /dev/null +++ b/functions/cybermut.xml @@ -0,0 +1,227 @@ + + CrŽdit Mutuel CyberMUT functions + CyberMUT + + + This extension allows you to process credit cards transactions using + CrŽdit Mutuel CyberMUT system ( + &url.cybermut;). + + + CynerMUT is a popular Web Payment Service in France, provided by the + CrŽdit 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 CrŽdit 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.6. + + + + 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. + + + 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; +?> + + + + See also + cybermut_testmac and + cybermut_creerreponsecm. + + + + + + + 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: + +<?php + $code_retour=$HTTP_GET_VARS["code-retour"]; + $texte_libre=$HTTP_GET_VARS["texte-libre"]; +?> + + + + Last step of payment (equiv cgi2.c) + +<?php +// Make sure that Enable Track Vars is ON. +// 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");} + +?> + + + + See also + cybermut_creerformulairecm and + cybermut_creerreponsecm. + + + + + + + cybermut_creerreponsecm + + Generate the acknowledgement of delivery of the confirmation + of payment + + + + Description + + + string cybermut_creerreponsecm + string phrase + + + + cybermut_creerreponsecm returns a string containing + delivery aknowledgement message. + + + 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 and + cybermut_testmac. + + + + +