Files
ms1inscription-v5/pptest.php
2026-05-13 09:43:32 -04:00

86 lines
1.9 KiB
PHP

<?php
require_once('php/inc_start_time.php');
require_once('./superadm/php/inc_functions.php');
error_reporting(E_ALL);
ini_set('display_errors', '1');
//ini_set('log_errors', '1');
//ini_set('error_log', __DIR__ . '/php_errors.log');
global $vPaypal_devise,$objDatabase,$itemNumber ,$itemName,$itemPrice,$currency ,$vblnEnvironementDev,$vDomaine, $vClient, $strCode, $strLangue, $vRepertoireFichiers,$vPaypaladv_SANDBOX;
postRefundSuccess("wwwwww", 4.44, 'cad', 'test', [],123,'ms1_test');
exit;
require_once 'paypal_advanced/config.php';
// Include the database connection file
$dbpaypal = new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME);
// Display error if failed to connect
if ($dbpaypal->connect_errno) {
printf("sl Connect failed: %s\n", $dbpaypal->connect_error);
exit();
}
// Include the PayPal API library
require_once 'paypal_advanced/PaypalCheckout.class.php';
$paypal = new PayPalCheckout(); // adapte le constructeur si besoin
$errors = [];
$successMsg = null;
$CAPTURE_ID="6J9283436L868890M";
// Helpers
// Calcule le max remboursable pour afficher le champ
$currencyUI = 'CAD';
print_rsl($_SESSION);
echosl(PAYPAL_CLIENT_ID);
$sortie=$paypal->paypaldetails($CAPTURE_ID);
print_rsl($sortie);
exit;
$maxUI = getRefundablePayPal($paypal, $CAPTURE_ID,$currencyUI);
echosl($maxUI);
print_rsl(getRefundableRemainingSimple($paypal, $CAPTURE_ID,$currencyUI));
$refund = $paypal->refundCapture($capId , '10.00', 'CAD', 'Remboursement partiel');
$delails=$paypal->getCaptureDetails($capId); // doit renvoyer des infos
$Refunds=$paypal->getRefundsForCapture($delails);
echosl("getCaptureDetails");
print_rsl($delails);
echosl("getRefundsForCapture");
print_rsl($Refunds);
echosl("---------------------------------");
$result = $paypal->getRefundsByOrderId('7EX391896U5175218');
print_rsl($result);
//$cap = $paypal->getCaptureDetails($capId);
//$debug = $paypal->debugReportAroundCapture($cap);