Go to response interface examples

Basic payment request

This example shows a basic payment request using the most usual options.

HTML Form used to reach the payment page

The HTML form must only contain fields that are expected by the Monetico payment system.
Please keep in mind the following points :

<form method="post" action="https://p.monetico-services.com/test/paiement.cgi">
<input type="hidden" name="TPE" value="0229001" />
<input type="hidden" name="societe" value="entreprisev3" />
<input type="hidden" name="lgue" value="FR" />
<input type="hidden" name="version" value="3.0" />
<input type="hidden" name="reference" value="ref66a4e9a1cc18a" />
<input type="hidden" name="date" value="27/07/2024:12:35:45" />
<input type="hidden" name="montant" value="123.45EUR" />
<input type="hidden" name="contexte_commande" value="eyJiaWxsaW5nIjp7ImNpdmlsaXR5IjoiTXIiLCJmaXJzdE5hbWUiOiJKb2huIiwibGFzdE5hbWUiOiJEb2UiLCJhZGRyZXNzTGluZTEiOiIxOCBydWUgZGUgbCdhZHJlc3NlIiwiY2l0eSI6IlBhcmlzIiwicG9zdGFsQ29kZSI6Ijc1MDAwIiwiY291bnRyeSI6IkZSIiwiZW1haWwiOiJqb2huLmRvZUB1bmtub3duLmNvbSIsInBob25lIjoiKzMzLTEyMzQ1Njc4OSJ9LCJjbGllbnQiOnsiY2l2aWxpdHkiOiJNciIsImZpcnN0TmFtZSI6IkpvaG4iLCJsYXN0TmFtZSI6IkRvZSIsImVtYWlsIjoiam9obi5kb2VAdW5rbm93bi5jb20iLCJwaG9uZSI6IiszMy0xMjM0NTY3ODkiLCJhdXRoZW50aWNhdGlvblRpbWVzdGFtcCI6IjIwMjQtMDctMjdUMTI6MzA6NDVaIiwibGFzdEFjY291bnRNb2RpZmljYXRpb24iOiIyMDIwLTA5LTAyIn19" />
<input type="hidden" name="texte-libre" value="Do not forget to HTML-encode every field value otherwise characters like " or ' might cause issues" />
<input type="hidden" name="MAC" value="0d5d894e637d65528b3d18b733d3fcad90a8a559" />
<input type="submit" value="Try it !" />
</form>

"contexte_commande" field

The "contexte_commande" field is a base 64 UTF-8 encoded value of the following JSON data :

{"billing":{"civility":"Mr","firstName":"John","lastName":"Doe","addressLine1":"18 rue de l'adresse","city":"Paris","postalCode":"75000","country":"FR","email":"john.doe@unknown.com","phone":"+33-123456789"},"client":{"civility":"Mr","firstName":"John","lastName":"Doe","email":"john.doe@unknown.com","phone":"+33-123456789","authenticationTimestamp":"2024-07-27T12:30:45Z","lastAccountModification":"2020-09-02"}}
Toggle pretty printed version

Please refer to technical documentation in order to respect the format of each different field

"MAC" field

MAC field value is an hexadecimal encoding of the result of sealing the following string with HMAC SHA-1 algorithm and you secret key :

TPE=0229001*contexte_commande=eyJiaWxsaW5nIjp7ImNpdmlsaXR5IjoiTXIiLCJmaXJzdE5hbWUiOiJKb2huIiwibGFzdE5hbWUiOiJEb2UiLCJhZGRyZXNzTGluZTEiOiIxOCBydWUgZGUgbCdhZHJlc3NlIiwiY2l0eSI6IlBhcmlzIiwicG9zdGFsQ29kZSI6Ijc1MDAwIiwiY291bnRyeSI6IkZSIiwiZW1haWwiOiJqb2huLmRvZUB1bmtub3duLmNvbSIsInBob25lIjoiKzMzLTEyMzQ1Njc4OSJ9LCJjbGllbnQiOnsiY2l2aWxpdHkiOiJNciIsImZpcnN0TmFtZSI6IkpvaG4iLCJsYXN0TmFtZSI6IkRvZSIsImVtYWlsIjoiam9obi5kb2VAdW5rbm93bi5jb20iLCJwaG9uZSI6IiszMy0xMjM0NTY3ODkiLCJhdXRoZW50aWNhdGlvblRpbWVzdGFtcCI6IjIwMjQtMDctMjdUMTI6MzA6NDVaIiwibGFzdEFjY291bnRNb2RpZmljYXRpb24iOiIyMDIwLTA5LTAyIn19*date=27/07/2024:12:35:45*lgue=FR*montant=123.45EUR*reference=ref66a4e9a1cc18a*societe=entreprisev3*texte-libre=Do not forget to HTML-encode every field value otherwise characters like " or ' might cause issues*version=3.0

The string is composed of all the fields sent by the form (except the "MAC" field itself).
If you do not send optional parameters, they must not be included inside the sealing string.
To generate the string used for sealing, you have to :