1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<reference id="ref.cybermut">
<title>Crédit Mutuel CyberMUT functions</title>
<titleabbrev>CyberMUT</titleabbrev>
<partintro>
<simpara>
This extension allows you to process credit cards transactions using
Crédit Mutuel CyberMUT system (
<ulink url="&url.cybermut;">&url.cybermut;</ulink>).
</simpara>
<simpara>
CyberMUT 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.
</simpara>
<simpara>
These functions are only available if PHP has been compiled with the
<link linkend="install.configure.with-cybermut"><option role="configure">
--with-cybermut[=DIR]</option></link>
option, where DIR is the location of <filename>libcm-mac.a</filename>
and <filename>cm-mac.h</filename>.
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).
</simpara>
<simpara>
The use of these functions is almost identical to the original functions,
except for the parameters of return for <function>cybermut_creerformulairecm</function>
and <function>cybermut_creerreponsecm</function>,
which are returned directly by functions PHP, whereas they had passed in
reference in the original functions.
</simpara>
<simpara>
These functions have been added in PHP 4.0.6.
</simpara>
<note>
<para>
These functions only provide a link to CyberMUT SDK. Be sure to read the
CyberMUT Developers Guide for full details of the required parameters.
</para>
</note>
</partintro>
<refentry id="function.cybermut-creerformulairecm">
<refnamediv>
<refname>cybermut_creerformulairecm</refname>
<refpurpose>Generate HTML form of request for payment</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>cybermut_creerformulairecm</methodname>
<methodparam><type>string</type><parameter>url_CM</parameter></methodparam>
<methodparam><type>string</type><parameter>version</parameter></methodparam>
<methodparam><type>string</type><parameter>TPE</parameter></methodparam>
<methodparam><type>string</type><parameter>montant</parameter></methodparam>
<methodparam><type>string</type><parameter>ref_commande</parameter></methodparam>
<methodparam><type>string</type><parameter>texte_libre</parameter></methodparam>
<methodparam><type>string</type><parameter>url_retour</parameter></methodparam>
<methodparam><type>string</type><parameter>url_retour_ok</parameter></methodparam>
<methodparam><type>string</type><parameter>url_retour_err</parameter></methodparam>
<methodparam><type>string</type><parameter>langue</parameter></methodparam>
<methodparam><type>string</type><parameter>code_societe</parameter></methodparam>
<methodparam><type>string</type><parameter>texte_bouton</parameter></methodparam>
</methodsynopsis>
<para>
<function>cybermut_creerformulairecm</function> is used to generate the
HTML form of request for payment.
</para>
<example>
<title>First step of payment (equiv cgi1.c)</title>
<programlisting role="php">
<![CDATA[
<?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;
?>
]]>
</programlisting>
</example>
<para>
See also
<function>cybermut_testmac</function> and
<function>cybermut_creerreponsecm</function>.
</para>
</refsect1>
</refentry>
<refentry id="function.cybermut-testmac">
<refnamediv>
<refname>cybermut_testmac</refname>
<refpurpose>
Make sure that there no was data diddling contained
in the received message of confirmation
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>cybermut_testmac</methodname>
<methodparam><type>string</type><parameter>code_MAC</parameter></methodparam>
<methodparam><type>string</type><parameter>version</parameter></methodparam>
<methodparam><type>string</type><parameter>TPE</parameter></methodparam>
<methodparam><type>string</type><parameter>cdate</parameter></methodparam>
<methodparam><type>string</type><parameter>montant</parameter></methodparam>
<methodparam><type>string</type><parameter>ref_commande</parameter></methodparam>
<methodparam><type>string</type><parameter>texte_libre</parameter></methodparam>
<methodparam><type>string</type><parameter>code-retour</parameter></methodparam>
</methodsynopsis>
<para>
<function>cybermut_testmac</function> 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:
<programlisting role="php">
<![CDATA[
<?php
$code_retour=$HTTP_GET_VARS["code-retour"];
$texte_libre=$HTTP_GET_VARS["texte-libre"];
?>
]]>
</programlisting>
</para>
<example>
<title>Last step of payment (equiv cgi2.c)</title>
<programlisting role="php">
<![CDATA[
<?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");
}
?>
]]>
</programlisting>
</example>
<para>
See also
<function>cybermut_creerformulairecm</function> and
<function>cybermut_creerreponsecm</function>.
</para>
</refsect1>
</refentry>
<refentry id="function.cybermut-creerreponsecm">
<refnamediv>
<refname>cybermut_creerreponsecm</refname>
<refpurpose>
Generate the acknowledgement of delivery of the confirmation
of payment
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>cybermut_creerreponsecm</methodname>
<methodparam><type>string</type><parameter>phrase</parameter></methodparam>
</methodsynopsis>
<para>
<function>cybermut_creerreponsecm</function> returns a string containing
delivery aknowledgement message.
</para>
<para>
The parameter is "OK" if the message of confirmation of the payment
were correctly auhentified by <function>cybermut_testmac</function>.
Any other chain is regarded as an error message.
</para>
<para>
See also
<function>cybermut_creerformulairecm</function> and
<function>cybermut_testmac</function>.
</para>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
|