Skip to main content

PayPal Community

  • Dashboard
  • Send and Request
  • Wallet
  • Business
  • Help
Log in
  • Welcome
    • Guidelines
    • News and Events
    • Suggestions for PayPal
    • General Discussions
  • PayPal Help Community
    • Managing Account
    • Transactions
    • Wallet
    • Security and Fraud
    • Products & Services
    • Reporting
  • MTS Community
    • PayPal Upgrade Community
    • PayPal Payments Standard
    • REST APIs
    • NVP/SOAP APIs
    • SDKs
    • Sandbox Environment
    • PayPal Reporting
    • Payflow
    • Ideas for MTS
    • Client-side Integration
    • Server-side Integration
  • The Archives
    • PayPal Help Community Archives
      • Managing Account Archives
      • Transactions Archives
      • Wallet Archives
      • Security and Fraud Archives
      • Products & Services Archives
      • Reporting Archives
    • Help Community
      • PayPal Basics Archives
      • Payments Archives
      • My Money Archives
      • My Account Archives
      • Disputes and Limitations Archives
      • Products and Services Archives
      • PayPal Credit Archives
    • Merchant Community
      • Merchant Products
      • Business Tools Archives
      • Reporting Archives
      • Managing Risk and Fraud Archives
    • Help Archives
      • About Business (Archive)
      • About Payments (Archive)
      • About Settings (Archive)
      • About eBay (Archive)
      • About Protections (Archive)
      • About Products (Archive)
    • Social and Your Voice Archives
      • Off Topic (Archive)
      • My Feedback for PayPal (Archive)
    • About PayPal Archives
      • Watercooler (Archive)
      • Tax Information (Archive)
      • Fees (Archive)
      • eBay and PayPal (Archive)
      • Coupons and promotions (Archive)
    • My Account Archives
      • My account settings (Archive)
      • Account limits and verification (Archive)
      • Account balance (Archive)
      • Bank accounts and credit cards (Archive)
    • Payments Archives
      • Sending money (Archive)
      • Receiving money (Archive)
      • Refunds (Archive)
      • Donations and Fundraising (Archive)
    • Disputes and Security Archives
      • Disputes and claims (Archive)
      • Fraud, phishing and spoof (Archive)
    • My Business Archives
      • Merchant services (Archive)
      • Reporting and tracking (Archive)
      • Shipping (Archive)
    • PayPal Products Archives
      • PayPal Debit Mastercard (Archive)
      • PayPal Extras MasterCard (Archive)
      • PayPal Mobile & Other Services (Archive)
      • Student Accounts (Archive)
      • Bill Me Later (Archive)
    • Getting to know PayPal
      • My PayPal account
      • Security and protection
    • Receiving and sending money
      • Buying with PayPal
      • Selling with PayPal
    • PayPal Here UK
      • PayPal Here News and Events
      • PayPal Here Community
      • Chip and Pin Card Reader
      • PayPal Here App

The Community Forum will no longer be available starting June 30, 2025. Please note that the forum is now closed for new posts and responses, but previous posts will remain accessible for review until June, 30 2025. For comprehensive support options, please visit PayPal.com/HelpCenter
Merchant Technical Support: For technical support and related questions, please visit our Technical Support Help Center or Developer Central

If you want to report illegal content under the EU Digital Services Act, please do so here

since ‎Sep-14-2019
Country: Cameroon
Type: Personal
evrard1313
evrard1313 Contributor
Contributor
3
Posts
0
Kudos
0
Solutions
Your PayPal Anniversary
Active
The Return
View all
Latest Contributions by evrard1313
  • Topics evrard1313 has Participated In
  • Latest Contributions by evrard1313

probleme de passage de sandbox au mode live

by evrard1313 Contributor in Sandbox Environment
‎Sep-28-2019 09:52 AM
‎Sep-28-2019 09:52 AM
Bonjour a tous, Voila je rencontre un petit problème avec mon code lors du passage de sandbox en mode live. En effet ayant change mon Client ID et mon Secret il ne marche toujours pas et ma page https://thelockedfile.com/payment.php est tout toute blanche comme si le code se refuse d'etre execute. Par contre ces memes codes fonctionnent sans aucun probleme en mode Sandbox. Voici mes differents codes : subscribe.php   <?php require 'inc/secret_header.php'; require 'inc/function.php'; require_once 'inc/db.php'; require 'inc/Offer.php'; logged_only(); if (isset($_POST['offer'])){ $_SESSION['offer_key'] = $_POST['offer']; header('location: payment.php'); } ?> <h3>S'abonner</h3> <form action="" method="post" class="user"> <ul> <?php foreach (Offer::getoffers() as $k => $offer😞 ?> <li><input type="radio" name="offer" value="<?= $k; ?>"><?= $offer['name']; ?> = <?= $offer['price_text']; ?></li> <?php endforeach; ?> </ul> <button class="btn btn-success" type="submit">S'Abonner</button> pay.php   <?php require_once 'inc/db.php'; require 'inc/function.php'; require 'inc/Offer.php'; require 'vendor/autoload.php'; logged_only(); $ids = require 'paypal.php'; //on cree un ApiContext ki contient nos identifiants $apiContext = new \PayPal\Rest\ApiContext( new \PayPal\Auth\OAuthTokenCredential( $ids['id'], $ids['secret'] ) ); //on recupere la liste des offres choisie par l'utilisateur $key_offer = $_SESSION['offer_key']; $offer = Offer::getoffers()[$key_offer]; //var_dump($offer); //on recupere le paiement $pay = $payemet = \PayPal\Api\Payment::get($_GET['paymentId'], $apiContext); //on recupere les infos sur l'acheteur $payer_infos = $payemet->getPayer()->getPayerInfo(); //on recupere les dates de debut et de fin d'inscription au forfait de l'acheteur et quelques donnees sur la transaction $period_start = (new DateTime($_SESSION['payment']->create_time))->getTimestamp(); $_SESSION['subscription_start'] = $subscription_start = gmdate("Y-m-d H:i:s", $period_start); $period = $offer['period'] === 'Month' ? new DateInterval($offer['interval']) : new DateInterval('P1Y'); $period_end = (new DateTime())->add($period)->getTimestamp(); $_SESSION['subscription_end'] = $subscription_end = gmdate("Y-m-d H:i:s", $period_end); $payer_id = $payer_infos->payer_id; $payer_email = $payer_infos->email; $payer_first_name = $payer_infos->first_name; $payer_last_name = $payer_infos->last_name; $payer_country_code = $payer_infos->country_code; $price_text = $offer['price_text']; $username = $_SESSION['auth']->username; $pdo->prepare("UPDATE users SET subscription_start = ?, subscription_end = ?, payer_id = ?, payer_email = ?, payer_first_name = ?, payer_last_name = ?, payer_country_code = ?, price_text = ? where username = ?")->execute([$_SESSION['subscription_start'], $_SESSION['subscription_end'], $payer_id, $payer_email, $payer_first_name, $payer_last_name, $payer_country_code, $price_text, $username]); $execution = (new \PayPal\Api\PaymentExecution()) ->setPayerId($_GET['PayerID']) ->setTransactions($payemet->getTransactions()); try { $pay->execute($execution, $apiContext); $_SESSION['flash']['success']="Votre paiement s'est deroulé avec succès et prendra effet lors de votre prochaine reconnection 😊"; header('location: logoutpaypal.php'); } catch (\Paypal\Exception\PayPalConnectionException $e) { header('HTTP 500 Internal Server Error', true, 500); var_dump(json_decode($e->getData())); }   payment.php   <?php require_once 'inc/db.php'; require 'inc/function.php'; require 'inc/Offer.php'; require 'vendor/autoload.php'; logged_only(); $ids = require 'paypal.php'; //on cree un ApiContext ki contient nos identifiants $apiContext = new \PayPal\Rest\ApiContext( new \PayPal\Auth\OAuthTokenCredential( $ids['id'], $ids['secret'] ) ); //on recupere le pannier selectionne par l'utilisateur $key_offer = $_SESSION['offer_key']; $offer = Offer::getoffers()[$key_offer]; //on cree une liste d'item $list = new \PayPal\Api\ItemList(); if (isset($offer)) { $item = (new \PayPal\Api\Item()) ->setName($offer['name']) ->setPrice($offer['price']) ->setCurrency('EUR') ->setQuantity(1); $list->addItem($item); //on cree une partie amount ki contient le paiement et les details sur le paiement $details = (new \PayPal\Api\Details()) ->setSubtotal($offer['price']) ->setTax($offer['tax']); $amount = (new \PayPal\Api\Amount()) ->setTotal($offer['total_price']) ->setCurrency('EUR') ->setDetails($details); //A la fin on envoie la transaction au paiement $transaction = (new \PayPal\Api\Transaction()) ->setItemList($list) ->setDescription($offer['description']) ->setAmount($amount) ->setCustom('id_utilisateur'); $payment = new \PayPal\Api\Payment(); $payment->setTransactions([$transaction]); $payment->setIntent('sale'); $redirectUrls = (new \PayPal\Api\RedirectUrls()) //A modifier ->setReturnUrl('https://thelockedfile.com/pay.php') ->setCancelUrl('https://thelockedfile.com/subscribe.php'); //End modif $payment->setRedirectUrls($redirectUrls); $payment->setPayer((new \PayPal\Api\Payer())->setPaymentMethod('paypal')); try { $payment->create($apiContext); //on sauvegarde le tout dans une variable globale $_SESSION['payment'] = $payment; header('location: ' . $payment->getApprovalLink()); } catch (\Paypal\Exception\PayPalConnectionException $e) { json_decode($e->getData()); } } ... View more
Labels:
  • Labels:
  • API
  • Express Checkout
  • Payouts
  • REST
  • SDK
Paypal Logo
  • Help
  • Contact Us
  • Security
  • Fees
  • © 1999-2025 PayPal, Inc. All rights reserved.
  • Privacy
  • Legal
  • Cookies
  • Policy Updates

The money in your balance is eligible for pass-through FDIC insurance.

The PayPal Cash Mastercard is issued by The Bancorp Bank pursuant to a license by Mastercard International Incorporated. The Bancorp Bank; Member FDIC.

Powered by Khoros
Welcome to the PayPal Community!