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
| <?php
$key = "000000000000000";
$ctx_mode = "TEST";
$amount = 100;
$capture_delay = "";
$currency = "978";
$payment_cards = "";
$payment_config = "SINGLE";
$site_id = "00000000";
// Exemple de génération de trans_id basé sur l'horodatage
$ts = time();
$trans_date = date("YmdHis", $ts);
$trans_id = date("His", $ts);
$validation_mode = "";
$version = "V1";
$url_return = "http://url.de.retour/retour.php";
$signature_contents = $version . "+" . $site_id . "+" . $ctx_mode . "+"
. $trans_id . "+" . $trans_date . "+" . $validation_mode . "+"
. $capture_delay . "+" . $payment_config . "+" . $payment_cards . "+"
. $amount . "+" . $currency . "+" . $key;
$signature = sha1($signature_contents);
?>
<html>
<head>
</head>
<body>
<form method="POST" action="https://systempay.cyberpluspaiement.com/vads-payment/">
<input type="hidden" name="ctx_mode" value="<?php echo($ctx_mode); ?>" />
<input type="hidden" name="amount" value="<?php echo($amount); ?>" />
<input type="hidden" name="capture_delay" value="<?php echo($capture_delay); ?>" />
<input type="hidden" name="currency" value="<?php echo($currency); ?>" />
<input type="hidden" name="payment_cards" value="<?php echo($payment_cards); ?>" />
<input type="hidden" name="payment_config" value="<?php echo($payment_config); ?>" />
<input type="hidden" name="site_id" value="<?php echo($site_id); ?>" />
<input type="hidden" name="trans_date" value="<?php echo($trans_date); ?>" />
<input type="hidden" name="trans_id" value="<?php echo($trans_id); ?>" />
<input type="hidden" name="validation_mode" value="<?php echo($validation_mode); ?>" />
<input type="hidden" name="version" value="<?php echo($version); ?>" />
<input type="hidden" name="url_return" value="<?php echo($url_return); ?>" />
<input type="hidden" name="signature" value="<?php echo($signature); ?>" />
<input type="submit" name="payer" value="Payer" />
</form>
</body>
</html> |
Partager