• France
état des services
démonstrations
assistance
FAQContacter le support
Video tutorials
Rechercher
Catégories
Tags
France
France
Espagne
Europe (Anglais)
Inde
Accueil
Cas d'usage
Créer un paiement
Créer un paiement en plusieurs fois
Proposer un paiement complémentaire
Créer un paiement par alias (token)
Créer un lien de paiement
Créer un abonnement
Gérer vos abonnements
Gérer vos transactions (rembourser,...)
Analyser vos journaux
Docs API
Formulaire embarqué
API REST
Formulaire en redirection
SDK Mobile
Échange de fichiers
Mandats SEPA par API REST
Exemples de code
Moyens de paiement
Modules de paiement
Marketplace
Guides
Back Office Marchand
Back Office Expert
Guides fonctionnels

Exemple d'implémentation en PHP

Exemple de calcul de signature utilisant l'algorithme HMAC-SHA-256 :

function getSignature ($params,$key)
{
    /**
     *Function that computes the signature.
     * $params : table containing the fields to send in the payment form.
     * $key : TEST or PRODUCTION key
     */
    //Initialization of the variable that will contain the string to encrypt
    $signature_content = "";
    //sorting fields alphabetically
    ksort($params);
    foreach($params as $name=>$value){
        //Recovery of vads_ fields 
        if (substr($name,0,5)=='vads_'){
            //Concatenation with "+"
            $signature_content .= $value."+";
         }
    }
    //Adding the key at the end
    $signature_content .= $key;
    //Encoding base64 encoded chain with SHA-256 algorithm
    $signature = base64_encode(hash_hmac('sha256',$signature_content, $key, true));
    return $signature;
 }

Exemple de calcul de signature utilisant l'algorithme SHA-1 :

function getSignature($params, $key)
{
    /**
     * Function that computes the signature.
     * $params : table containing the fields to send in the payment form.
     * $key : TEST or  PRODUCTION key
     */
    //Initialization of the variable that will contain the string to encrypt
    $signature_content = "" ;
    // Sorting fields alphabetically
    ksort($params);
        foreach ($params as $name =>$value)
    { 
    // Recovery of vads_ fields 
        if (substr($name,0,5)=='vads_') { 
            // Concatenation with "+"
            $signature_content .= $value."+";
        }
    }
    // Adding the key at the end
    $signature_content .= $key;
    // Applying SHA-1 algorithm
    $signature = sha1($signature_content);
    return $signature ;
}
Nous recrutons
Mentions légales
Charte de Protection des Données Personnelles
25.18-1.11