Problem with PayPal Sandbox test (UK) - BAD_INPUT_ERROR
INVALID_BUSINES
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Aug-24-2024
11:07 AM
I'm new to PayPal and am trying to integrate a very simple checkout into my website. Sadly, the Sandbox keeps throwing up error after error. The following is the code I'm sending but it's based on a 2020 guide. Any idea what I'm doing wrong?
<?php
// For testing purposes set this to true, if set to true it will use paypal sandbox
$testmode = true;
$paypalurl = $testmode ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr';
// If the user clicks the PayPal checkout button...
if (isset($_POST['paypal'])) {
// Variables we need to pass to paypal
// Make sure you have a business account and set the "business" variable to your paypal business account email
$data = array(
'cmd' => '_cart',
'upload' => '1',
'lc' => 'EN',
'business' => 'xxxxxxxxxxxxxxxxxxxxxxx',
'cancel_return' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.php?mode=cancelled',
'notify_url' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.php?page=cart&ipn_listener=paypal',
'currency_code' => 'GBP',
'return' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.php?mode=confirmed',
'item_number_1' => '$id',
'item_name_1' => '$name',
'quantity_1' => '1',
'amount_1' => '$price'
);
// Send the user to the paypal checkout screen
header('location:' . $paypalurl . '?' . http_build_query($data));
// End the script don't need to execute anything else
exit;
?>
Thank you so, so much in advance.
Labels:
- Labels:
-
Receiving Money
0 REPLIES 0

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.