Bonjour, je possède un script ExpressPayment de Paypal API permettant à mes utilisateurs de déposer de l'argent sur le site web, de ce coté la, tout fonctionne parfaitement

Et ensuite, un script MassPay permettant de retirer cette argent vers leurs compte Paypal, et depuis ce matin, cela ne fonctionne plus, et je ne vois pas le problème ><

Il n'y a strictement aucune erreur, Paypal me lance la notification "Success", donc ça retire les fonds du site et tout, mais rien n'est envoyé du compte Paypal admin vers le compte Paypal client ( Sandbox )

Si quelqu'un pouvait jeter un oeil :S :

refund.php :

<?php
session_start();
 if (!isset($_SESSION['pseudo'])){
  header("Location:profil.php");
}
include 'config.php';
$bdd = new PDO('mysql:host='.$host.';dbname='.$db, $db_user, $db_password);
$req = $bdd->prepare("SELECT * FROM users WHERE username = :username");
$req->execute(array('username' => $_SESSION['pseudo']));
$user = $req->fetch(PDO::FETCH_OBJ);
$taxe = $taxe = $user->solde / 100;
$amountmoinstaxe = $user->solde - $taxe;

// Paypal
    require "refund_test.php";
    $paypal = new Paypal("contact-buyer@perdredupoids-facile.com", $user->solde, "abc");

    $send_payment = $paypal->pay("contact-buyer@perdredupoids-facile.com", $user->solde, "#");

    if("SUCCESS" == strtoupper($send_payment["ACK"]) || "SUCCESSWITHWARNING" == strtoupper($send_payment["ACK"])) {
      if ($user->solde > 0){
        $bdd = new PDO('mysql:host='.$host.';dbname='.$db, $db_user, $db_password);
 // On retire les fonds du site       
  $retirer = $bdd->prepare("UPDATE users SET solde = :solde WHERE username = :username");
  $retirer->execute(array(
    'solde' => 0,
    'username' => $_SESSION['pseudo']));

// On inscrit la transaction dans la BDD
$transac_list = $bdd->prepare("INSERT INTO transactions(sender,receiver,amounteneuros, taxe) VALUES(:sender,:receiver,:amounteneuros, :taxe)");
$transac_list->execute(array(
  'sender' => $_SESSION['pseudo'],
  'receiver' => "Compte Paypal",
  'amounteneuros' => $amountmoinstaxe,
  'taxe' => $taxe));

  $prendretaxe = $bdd->prepare("UPDATE users SET solde = solde + :solde WHERE username = :username");
  $prendretaxe->execute(array(
    'solde' => $taxe,
    'username' => 'YesMoney'));
        echo "Success";

        $_SESSION['status_payment'] = "ok";
        echo '<meta http-equiv="refresh" content="0;url=profil.php"/>';
 }       else {
  echo "Vous n'avez pas assez d'argent";
 }
    } else {
        exit('Erreur: ' . print_r($send_payment, true));
    }
?>

refund_test.php :

<?php

  class Paypal {

        public function __construct($username, $password, $signature) {
            $this->username = urlencode('contact-facilitator_api1.perdredupoids-facile.com');
            $this->password = urlencode('GT8M5######6XLTN');
            $this->signature = urlencode('AFcWxV21C7fd0v3##############A9Pki1Cc3lKSdGocH9TaawQzW7ld');
            $this->version = urlencode("51.0");
            $this->api = "https://api-3t.sandbox.paypal.com/nvp";

            //The functions can be modified but need to be urlencoded
            $this->type = urlencode("contact-facilitator_api1.perdredupoids-facile.com");
            $this->currency = urlencode("EUR");
            $this->subject = urlencode("Instant Paypal Payment");
        }

        public function pay($email, $amount, $note="Instant Payment") {
            $string = "&EMAILSUBJECT=".$this->subject."&RECEIVERTYPE=".$this->type."&CURRENCYCODE=".$this->currency;
            $string .= "&L_EMAIL0=".urlencode($email)."&L_Amt0=".urlencode($amount)."&L_NOTE0=".urlencode($note);

            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, $this->api);
            curl_setopt($ch, CURLOPT_VERBOSE, 1);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_POST, 1);

            $request = "METHOD=MassPay&VERSION=".$this->version."&PWD=".$this->password."&USER=".$this->username."&SIGNATURE=".$this->signature."$string";

            curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
            $httpResponse = curl_exec($ch);
            if(!$httpResponse) {
                exit("MassPay failed: ".curl_error($ch).'('.curl_errno($ch).')');
            }

            $httpResponseArray = explode("&", $httpResponse);
            $httpParsedResponse = array();
            foreach ($httpResponseArray as $i => $value) {
                $tempArray = explode("=", $value);
                if(sizeof($tempArray) > 1) {
                    $httpParsedResponse[$tempArray[0]] = $tempArray[1];
                }
            }

            if((0 == sizeof($httpParsedResponse)) || !array_key_exists('ACK', $httpParsedResponse)) {
                exit("Invalid HTTP Response for POST request($request) to ".$this->api);
            }

            return $httpParsedResponse;
        }

    }
?>

Aucune réponse