I know this is a pretty specific question but I managed to get some great help before. I have already posted this on PayPal's developer site (www.x.com) however have not yet had a responce.
I have been attempting to create a PayNow button using the BMCreateButton API via NVP. I receive the success message and the button code, however whenever anyone clicks the button they are instantly displaying the message:
"Error Processing Payment
Your payment can't be processed. Please contact the merchant directly with this code."
The code I am using to generate the button is as follows:
$sendData = array(
"METHOD" => "BMCreateButton",
"VERSION" => "65.2",
"USER" => "[username]",
"PWD" => "[password]",
"SIGNATURE" => "[signature]",
"BUTTONCODE" => "ENCRYPTED",
"BUTTONTYPE" => "PAYMENT",
"BUTTONSUBTYPE" => "SERVICES",
"BUTTONCOUNTRY" => "GB",
"BUTTONIMAGE" => "reg",
"L_BUTTONVAR1" => "item_number=$userID",
"L_BUTTONVAR2" => "item_name=$invoiceID",
"L_BUTTONVAR3" => "subtotal=$invoiceTotal",
"L_BUTTONVAR4" => "currency_code=GBP",
"L_BUTTONVAR5" => "no_shipping=1",
"L_BUTTONVAR6" => "no_note=1",
"L_BUTTONVAR7" => "notify_url=[full url to ipn]",
"L_BUTTONVAR8" => "cancel_return=[full url to cancel]",
"L_BUTTONVAR9" => "return=[full url to return]"
);
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_URL, 'https://api-3t.sandbox.paypal.com/nvp?'.http_build_query($sendData));
$nvpReturn = curl_exec($curl);
curl_close($curl);
The outcome I really want is so that I am able to create a button on the fly for each of our users invoices which can vary in amount (i.e. with late fees, adddons etc).
Just wondering if anyone with some PayPal NVP API experience can spot the issue.
Thanks :)