| Current Path : /home/happyrenas/old/huissier-express.fr/old/ |
Linux webd005.cluster105.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 |
| Current File : /home/happyrenas/old/huissier-express.fr/old/test_saisie.php |
<?
session_start();
error_reporting(E_ALL);
ini_set('display_errors','On');
require_once 'administration/panel/mangopay/vendor/autoload.php';
$MangopayApi = new \MangoPay\MangoPayApi();
$MangopayApi->Config->ClientId = 'ofyc2017';
$MangopayApi->Config->ClientPassword = 'iqkhQK591cWzu3Ept5Z4niNiaCaw8Ctpa9ixa68ZvXrP9BEpbJ';
$MangopayApi->Config->TemporaryFolder = 'temp_sandbox';
$MangopayApi->Config->BaseUrl = 'https://api.sandbox.mangopay.com';
//ERROR CODE : https://docs.mangopay.com/guide/errors
//CB DE TEST : https://docs.mangopay.com/guide/testing-payments
//3569990000000157
//1018
//123
$_SESSION['secure']="";
$user_id = "22215702";
$user_id = "22214901";
$_SESSION['montant'] = 10000;
echo "<center>User Id : ".$user_id."</center>";
$stepId=1;
try {
$CardRegistration = new \MangoPay\CardRegistration();
$CardRegistration->Tag = "custom meta";
$CardRegistration->UserId = $user_id;
$CardRegistration->Currency = "EUR";
$CardRegistration->CardType = "";
$Result = $MangopayApi->CardRegistrations->Create($CardRegistration);
$_SESSION['cart_id'] = $Result->Id;
}
catch(MangoPay\Libraries\ResponseException $e)
{
echo $e->GetCode();
echo $e->GetMessage();
echo $e->GetErrorDetails();
}
catch(MangoPay\Libraries\Exception $e)
{
echo $e->GetMessage();
}
$returnUrl = 'http' . ( isset($_SERVER['HTTPS']) ? 's' : '' ) . '://' . $_SERVER['HTTP_HOST'];
$returnUrl .= substr($_SERVER['REQUEST_URI'], 0, strripos($_SERVER['REQUEST_URI'], '/') + 1);
$returnUrl .= 'test_saisie1.php';
?>
<form id="form-paiement" action="<?php print $Result->CardRegistrationURL; ?>" method="post">
<input type="hidden" name="data" value="<?php print $Result->PreregistrationData; ?>" />
<input type="hidden" name="accessKeyRef" value="<?php print $Result->AccessKey; ?>" />
<input type="hidden" name="returnURL" value="<?php print $returnUrl; ?>" />
<input type="hidden" name="cart_id" value="<?php print $_SESSION['cart_id']; ?>" />
<table width=100%>
<tr>
<td width="100%"><p class="a3_style" style="text-align:center;">Montant : <?echo 0.01*$_SESSION['montant'];?> EUR</p></td>
</tr>
<tr><td><hr></td></tr>
<tr>
<td width="100%"><p class="a3_style" style="text-align:center;">Numero de carte :</p></td>
</tr>
<tr>
<td style="text-align:center;"><input type="text" value="" name="cardNumber" /></td>
</tr>
<tr>
<td width="100%"><p class="a3_style" style="text-align:center;">Date d'expiration <small>(MMAA)</small> :</p></td>
</tr>
<tr>
<td style="width:100%; text-align:center;"><input type="text" placeholder="Ex : 0117" min="0" name="cardExpirationDate" /></td>
</tr>
<tr>
<td width="100%"><p class="a3_style" style="text-align:center;">Cryptogramme :</p></td>
</tr>
<tr>
<td style="text-align:center;"><input type="text" value="" name="cardCvx" /></td>
</tr>
<tr>
<td width="100%"><p class="a3_style" style="text-align:center;"></p></td>
</tr>
<tr>
<td style="text-align:center;">
<button name="insertion" type="submit" class="subscribe_btn pix_text" style="width:220px;">
<span class="editContent">Pre-enregistrement carte</span>
</button>
</td>
</tr>
</table>
</form>