问题
Can anyone please tell me how to change a PayPal buy button to a text link? Thanks. Here is the code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  <input type="hidden" name="cmd" value="_s-xclick">
  <input type="hidden" name="hosted_button_id" value="XXX">
  <input type="image" src="https://www.paypalobjects.com/en_US/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/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
回答1:
Paypal has a builder for doing this. Login to your paypal account. Click on 'Merchant Services'. Choose the button type you want (payment, subscription, etc). Run through the rest of the options. It will generate the button as a form but there is a tab at the top to have it generated as a link. The tab is titled "Email".
回答2:
Did you try this? https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XXX
You need to replace XXX of course.
The HTML-Code would look like this: Your Text
For example one with working button id: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7865
回答3:
After you have created a button, there will be an email link. You can use this as an href="https://www.paypal.com/examplecode/ExampleButtonID".
回答4:
Check out this Paypal Link Generator. http://www.blogbyben.com/2009/04/paypal-link-generator-build-your-own-1.html
It does appear that PayPal basically forces you to use an image as the link because it allows them to encrypt some of the data that is sent. Check out "Protecting HTML Code for Payment Buttons" on page 90 of https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/pp_websitepaymentsstandard_integrationguide.pdf
回答5:
One solution that has not been posted is for the donate link. Hopefully someone finds this helpful. In addition to what @1' OR 1 -- provided, you can use the below for a text link for donations:
https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=INFO@EMAIL.COM&lc=US&item_name=Donation+to+YOUR+BUSINESS+NAME&no_note=0&cn=&curency_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted
You'll want to replace INFO@EMAIL.com and Donation+to+YOUR+BUSINESS+NAME with your own information, as well as possibly change currency code.
回答6:
The code you need is:
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XXX">Text goes here</a>
Replace XXX with whatever your button code is and replace Text goes here with whatever text you wish to show. 
The XXX is the hosted button ID, which is usually a 13 character value such as H6C28LJRV72J2.
回答7:
What about this:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  <input type="hidden" name="cmd" value="_s-xclick">
  <input type="hidden" name="hosted_button_id" value="XXX">
  <input type="submit" value="submit" 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>
This will give you a button with text.
来源:https://stackoverflow.com/questions/6879666/paypal-button-as-text-link