Script php pour les remboursements

marcsteph423
Contributeur
Contributeur

Bonjour, j'ai trouvé sur Paypal un script php pour les refunds mais il ne marche pas, est ce que vous pouvez m'aider à le mettre en place svp

use PayPal\Api\Amount;
use PayPal\Api\Refund;
use PayPal\Api\Sale;

$amt = new Amount();
$amt->setTotal(1.10)
  ->setCurrency('CHF');

$refund = new Refund();
$refund->setAmount($amt);

$sale = new Sale();
$sale->setId("57N78393R10602605");

try {
  $refundedSale = $sale->refund($refund, $apiContext);
} catch (PayPal\Exception\PayPalConnectionException $ex) {
  echo $ex->getCode();
  echo $ex->getData();
  die($ex);
} catch (Exception $ex) {
  die($ex);
}
Login to Me Too
0 RÉPONSES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.