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="2990502" />
<input type="hidden" name="societe" value="abbayedele" />
<input type="hidden" name="lgue" value="FR" />
<input type="hidden" name="version" value="3.0" />
<input type="hidden" name="reference" value="ref638b4eb99e457" />
<input type="hidden" name="date" value="03/12/2022:14:27:21" />
<input type="hidden" name="montant" value="123.45EUR" />
<input type="hidden" name="contexte_commande" value="eyJiaWxsaW5nIjp7ImNpdmlsaXR5IjoiTXIiLCJmaXJzdE5hbWUiOiJKb2huIiwibGFzdE5hbWUiOiJEb2UiLCJhZGRyZXNzTGluZTEiOiIxOCBydWUgZGUgbCdhZHJlc3NlIiwiY2l0eSI6IlBhcmlzIiwicG9zdGFsQ29kZSI6Ijc1MDAwIiwiY291bnRyeSI6IkZSIiwiZW1haWwiOiJqb2huLmRvZUB1bmtub3duLmNvbSIsInBob25lIjoiKzMzLTEyMzQ1Njc4OSJ9LCJjbGllbnQiOnsiY2l2aWxpdHkiOiJNciIsImZpcnN0TmFtZSI6IkpvaG4iLCJsYXN0TmFtZSI6IkRvZSIsImVtYWlsIjoiam9obi5kb2VAdW5rbm93bi5jb20iLCJwaG9uZSI6IiszMy0xMjM0NTY3ODkiLCJhdXRoZW50aWNhdGlvblRpbWVzdGFtcCI6IjIwMjItMTItMDNUMTQ6MjI6MjFaIiwibGFzdEFjY291bnRNb2RpZmljYXRpb24iOiIyMDIwLTA5LTAyIn19" />
<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="a901e079fff7ce6e0238a27356d476bf2539c247" />
<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":"2022-12-03T14:22:21Z","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=2990502*contexte_commande=eyJiaWxsaW5nIjp7ImNpdmlsaXR5IjoiTXIiLCJmaXJzdE5hbWUiOiJKb2huIiwibGFzdE5hbWUiOiJEb2UiLCJhZGRyZXNzTGluZTEiOiIxOCBydWUgZGUgbCdhZHJlc3NlIiwiY2l0eSI6IlBhcmlzIiwicG9zdGFsQ29kZSI6Ijc1MDAwIiwiY291bnRyeSI6IkZSIiwiZW1haWwiOiJqb2huLmRvZUB1bmtub3duLmNvbSIsInBob25lIjoiKzMzLTEyMzQ1Njc4OSJ9LCJjbGllbnQiOnsiY2l2aWxpdHkiOiJNciIsImZpcnN0TmFtZSI6IkpvaG4iLCJsYXN0TmFtZSI6IkRvZSIsImVtYWlsIjoiam9obi5kb2VAdW5rbm93bi5jb20iLCJwaG9uZSI6IiszMy0xMjM0NTY3ODkiLCJhdXRoZW50aWNhdGlvblRpbWVzdGFtcCI6IjIwMjItMTItMDNUMTQ6MjI6MjFaIiwibGFzdEFjY291bnRNb2RpZmljYXRpb24iOiIyMDIwLTA5LTAyIn19*date=03/12/2022:14:27:21*lgue=FR*montant=123.45EUR*reference=ref638b4eb99e457*societe=abbayedele*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 :