// BUYER (optional) $array['buyer']['lastName'] = $_POST['buyerLastName']; $array['buyer']['firstName'] = $_POST['buyerFirstName']; $array['buyer']['walletId'] = $_POST['buyerWalletId']; $array['buyer']['email'] = $_POST['buyerEmail']; $array['buyer']['accountCreateDate'] = $_POST['buyerAccountCreateDate']; $array['buyer']['accountAverageAmount'] = $_POST['buyerAverageAmount']; $array['buyer']['accountOrderCount'] = $_POST['buyerOrderCount']; // ADDRESS (optional) $array['address']['name'] = $_POST['addressName']; $array['address']['street1'] = $_POST['addressStreet1']; $array['address']['street2'] = $_POST['addressStreet2']; $array['address']['cityName'] = $_POST['addressCity']; $array['address']['zipCode'] = $_POST['addressZipCode']; $array['address']['country'] = $_POST['addressCountry']; $array['address']['phone'] = $_POST['addressPhone']; // TRANSACTION OPTIONS $array['notificationURL'] = $_POST['notificationURL']; $array['returnURL'] = $_POST['returnURL']; $array['cancelURL'] = $_POST['cancelURL']; $array['customPaymentPageCode'] = $_POST['customPaymentPageCode']; $array['securityMode'] = $_POST['securityMode']; $array['languageCode'] = $_POST['languageCode']; // EXECUTE $response = $payline->create_WebWallet($array); require '../demos/result/header.html'; echo '<H3>REQUEST</H3>'; print_a($array); echo '<H3>RESPONSE</H3>'; print_a($response, 0, true); require '../demos/result/footer.html';
public function createWebWalletFromSession() { /* * Créer un portefeuille pour un utilisateur en allant * chercher dans les tables toutes les valeur correspondante, * l'utilisateur n'a plus cas tapé les informations de sa carte * qui sont associé à màªme token chez payline et dans nos table */ $oPaylineSDK = new paylineSDK(); // Sécurité contre wallet sans UID if (!isset($_SESSION['iUID'])) { return false; } /* * Paramà¨tre Payline */ $aParam['contractNumber'] = CONTRACT_NUMBER; $aParam['contracts'] = CONTRACT_NUMBER_LIST; $aParam['updatePersonalDetails'] = 0; // Information sur le client $aParam['buyer']['lastName'] = $_SESSION['aUserInfo']['nom']; $aParam['buyer']['firstName'] = $_SESSION['aUserInfo']['prenom']; $aParam['buyer']['walletId'] = $_SESSION['iUID']; $aParam['buyer']['email'] = $_SESSION['aUser']['mail']; $aParam['buyer']['accountCreateDate'] = date('d/m/y'); /* * Option désactivé: * $aParam['buyer']['accountAverageAmount'] = '' ; * $aParam['buyer']['accountOrderCount'] = '' ; */ // Adresse du client $aParam['address']['name'] = 'Adresse de facturation'; $aParam['address']['street1'] = $_SESSION['aUserAdresse']['adresse']; $aParam['address']['street2'] = ''; $aParam['address']['cityName'] = $_SESSION['aUserAdresse']['ville']; $aParam['address']['zipCode'] = $_SESSION['aUserAdresse']['zipcode']; $aParam['address']['country'] = 'France'; $aParam['address']['phone'] = $_SESSION['aUser']['portable']; // Définission des URL de retour et du mode SSL $aParam['notificationURL'] = NOTIFICATION_URL; $aParam['returnURL'] = RETURN_URL; $aParam['cancelURL'] = CANCEL_URL; $aParam['customPaymentPageCode'] = CUSTOM_PAYMENT_PAGE_CODE; $aParam['securityMode'] = SECURITY_MODE; $aParam['languageCode'] = LANGUAGE_CODE; // Exécution de l'appelle $aResult = $oPaylineSDK->create_WebWallet($aParam); // Si aucun retour Payline, on stop la fonction if (!isset($aResult)) { return false; } return $aResult; }