| Current Path : /home/h/a/p/happyrenas/old/huissier-express.fr/old/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/h/a/p/happyrenas/old/huissier-express.fr/old/old/debit_carte_mangopay.php |
<?
session_start();
error_reporting(E_ALL);
$dev="non";
ini_set('display_errors','On');
$page="pre_paiement";
include("../../config.php");
require_once 'mangopay/vendor/autoload.php';
$MangopayApi = new \MangoPay\MangoPayApi();
if ($dev=="oui")
{
$MangopayApi->Config->ClientId = 'ofyc2017';
$MangopayApi->Config->ClientPassword = 'iqkhQK591cWzu3Ept5Z4niNiaCaw8Ctpa9ixa68ZvXrP9BEpbJ';
$MangopayApi->Config->TemporaryFolder = 'temp_sandbox';
$MangopayApi->Config->BaseUrl = 'https://api.sandbox.mangopay.com';
}
else
{
$MangopayApi->Config->ClientId = 'philippe2015';
$MangopayApi->Config->ClientPassword = 'hK15oQKQig9N2UFEXQpCoirptU4VTeU28p0CTyiprt0fQuwFPP';
$MangopayApi->Config->TemporaryFolder = 'temp';
$MangopayApi->Config->BaseUrl = 'https://api.mangopay.com';
}
$user_id = $_REQUEST['user_id'];
$WalletId = $_REQUEST['WalletId'];
$PreauthorizationId = $_REQUEST['PreauthorizationId'];
$montant = 100*$_REQUEST['montant'];
$_SESSION['montant'] = $montant;
$PayIn = new \MangoPay\PayIn();
$PayIn->CreditedWalletId = $WalletId;
$PayIn->AuthorId = $user_id;
$PayIn->PaymentType = "CARD";
$PayIn->PaymentDetails = new \MangoPay\PayInPaymentDetailsPreAuthorized();
$PayIn->PaymentDetails->PreauthorizationId = $PreauthorizationId;
$PayIn->DebitedFunds = new \MangoPay\Money();
$PayIn->DebitedFunds->Currency = "EUR";
$PayIn->DebitedFunds->Amount = $montant;
$PayIn->Fees = new \MangoPay\Money();
$PayIn->Fees->Currency = "EUR";
$PayIn->Fees->Amount = 0;
$PayIn->ExecutionType = "DIRECT";
$PayIn->ExecutionDetails = new \MangoPay\PayInExecutionDetailsDirect();
$result = $MangopayApi->PayIns->Create($PayIn);
echo "<pre>";print_r($result);echo "</pre>";
mail('philippe-jean@outlook.fr;resa@huissier-express.fr', 'Debit PayIn', '<pre>'.print_r($result, true).'</pre>');
?>