PayPal Payments Standard custom HTML form; How does PayPal know who is submitting?

久未见 提交于 2019-12-22 05:03:11

问题


I'm trying to get this form to initiate a donation using PayPal Payments Standard...

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  <input type="hidden" name="cmd" value="_donations">
  <input type="text" name="amount"></input>
  <input type="hidden" name="item_name" value="OrganizationXYZ Donation">
  <input type="hidden" name="image_url" value="http://www.OrganizationXYZ.org/images/logo.gif">
  <input type="image" name="submit" border="0"  src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online">  
</form>

This seems like it should work according to PayPal's documentation, but it doesn't. Instead I get this error:

"We cannot process this transaction because there is a problem with the PayPal email address supplied by the seller. Please contact the seller to resolve the problem. If this payment is for an eBay listing, you can contact the seller via the "Ask Seller a Question" link on the listing page. When you have the correct email address, payment can be made at www.paypal.com."

This error doesn't make any sense because you do not supply an email address in these forms. Yet it seems to me that my form needs to post some kind of identification- otherwise how would PayPal know which account is receiving the donation? Unless I register a domain vai my PayPal account settings, but there is no place to do that either.

Does anybody have experience with setting this up?


回答1:


Yes, as you mentioned, it need some sort of identifier of the recipient.
What you need to add is the 'business' parameter. That's all.

<input type="hidden" name="business" value="your secure merchant account ID / email here">



回答2:


You must to have a merchant account.

You can see a tutorial here:
http://kb.worldsecuresystems.com/833/cpsid_83331.html


try this code:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

    <select name="amount">
    <option value="3.99">6 Months ($3.99)</option>
    <option value="5.99">12 Months ($5.99)</option>

    </select>
    <br>
    <input name="currency_code" type="hidden" value="USD">
    <input name="shipping" type="hidden" value="0.00">
    <input name="tax" type="hidden" value="0.00">
    <input name="return" type="hidden" value="urlOnValidPayment">
    <input name="cancel_return" type="hidden" value="UrlOnCancelPayment">
    <input name="notify_url" type="hidden" value="URLForValidationPayement">
    <input name="cmd" type="hidden" value="_xclick">
    <input name="business" type="hidden" value="your e-mail">
    <input name="item_name" type="hidden" value="name of the object">
    <input name="no_note" type="hidden" value="1">
    <input type="hidden" name="no_shipping" value="1">
    <input name="lc" type="hidden" value="EN">
    <input name="bn" type="hidden" value="PP-BuyNowBF">
    <input name="custom" type="hidden" value="custom data">
    <input type="image" src="https://www.paypalobjects.com/en_US/CH/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
    <img alt="" border="0" src="https://www.paypalobjects.com/fr_FR/i/scr/pixel.gif" width="1" height="1">
    </form>

for me it's work




回答3:


¿Are you just generating the payment buton yourself?

I must recommend you to login to your PayPal account, go to this part of the menu:

Merchant Services -> Key Features -> Buy now Button

Then choose the button type I guess you want a Donate button.

Then configure the overall button settings, I must recommend to save the button in paypal servers.

Finally choose Create Button

This will give you the right HTML code. This is a sample donate button HTML.

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  <input type="hidden" name="cmd" value="_donations">
  <input type="hidden" name="business" value="YOUR_BUSINESS_ID">
  <input type="hidden" name="lc" value="US">
  <input type="hidden" name="item_name" value="myorgname">
  <input type="hidden" name="item_number" value="donateid">
  <input type="hidden" name="amount" value="20">
  <input type="hidden" name="currency_code" value="USD">
  <input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">
  <input type="hidden" name="custom_variable1" value="val1">
  <input type="hidden" name="custom_variable2" value="val2">
  <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
  <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>



回答4:


Here is your problem:

<input type="hidden" name="cmd" value="_donations">

Paypal's image value in Encrypted Payment System (WPS - EPS) for "cmd" is "_s-xclick" So use it as below:

<input type="hidden" name="cmd" value="_s-xclick">


来源:https://stackoverflow.com/questions/10835922/paypal-payments-standard-custom-html-form-how-does-paypal-know-who-is-submittin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!