invalid email address error when trying to integrate a donations button?

ぃ、小莉子 提交于 2019-12-24 16:10:14

问题


The paypal guide is very confusing. I want to add a donate button to my templates on my development machine for testing. The guides point to creating a donation button from their website, which I have done (modified a bit to accept a custom donation amount):

<form id="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="amount" value="33">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----xxxxxxx=-----END PKCS7-----
">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_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>

When I click on the donate button, it redirects to paypal but then I see 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.

But I have already confirmed my email. I also read about creating sandbox accounts, so I went to https://developer.paypal.com and created a test app. It gives me sandbox credentials, but I don't see what this has to do with integrating a donations button.

This SO post suggests providing my plaintext Merchant ID for the business value. But then what is my encrypted value for? Doesn't that contain my Merchant ID? Why do I have to provide my plaintext Merchant ID if I have my encrypted value? And why doesn't Paypal generate the correct HTML if I have to use my plaintext Merchant ID?

If I switch cmd to _s-xclick and leave out the plaintext Merchant ID in business, then it works fine, but my custom amount is empty on paypal's page. Somehow paypal loses this piece of info.

What am I doing wrong?


回答1:


After creating a non-hosted donation button, there should be "Remove code protection" link in the page where you get the code. Click the link and the button's code will be displayed fully in plain text. That will help you investigate more easily. Please have a try. And paste your code here if it still does not go thru.




回答2:


For the PayPal encrypted Donation button, it should not display below amount code.

  <input type="hidden" name="amount" value="33">

Please just use PayPal default encrypted code and do not change it. But if you want to edit the code by your own, when you create button on your PayPal account, please do not check the option of "Save button at PayPal" under the column of "Step 2: Track inventory (optional)" when you create the button. Click “Remove code protection” on the right corner of the code column after you click “Create button”.



来源:https://stackoverflow.com/questions/32672943/invalid-email-address-error-when-trying-to-integrate-a-donations-button

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