php - PayPal API Error - Error Processing Payment -


i know pretty specific question managed great before. have posted on paypal's developer site (www.x.com) have not yet had responce.

i have been attempting create paynow button using bmcreatebutton api via nvp. receive success message , button code, whenever clicks button instantly displaying message:

"error processing payment
payment can't processed. please contact merchant directly code."

the code using generate button 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 ipn]",     "l_buttonvar8" => "cancel_return=[full url cancel]",     "l_buttonvar9" => "return=[full url 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 want able create button on fly each of our users invoices can vary in amount (i.e. late fees, adddons etc).

just wondering if paypal nvp api experience can spot issue.

thanks :)

i found answer messing values hours until 1 worked. confirmed paypal on www.x.com.

the following changes made:

"buttontype" => "payment", "buttontype" => "buynow",

and

"l_buttonvar3" => "subtotal=$invoicetotal", "l_buttonvar3" => "amount=$invoicetotal",

apparently options had used hosted payment / cart payment methods (not these mentioned anywhere in documentation).

never mind, got there in end.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -