Problem with PayPal Sandbox test (UK) - BAD_INPUT_ERROR

INVALID_BUSINES
Contributor
Contributor

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;
// 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',
        '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.
Login to Me Too
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.