Html PayPal 按钮作为文本链接

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6879666/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 09:49:18  来源:igfitidea点击:

PayPal Button As Text Link

htmlpaypal

提问by DearRicky

Can anyone please tell me how to change a PayPal buy button to a text link? Thanks. Here is the code:

谁能告诉我如何将 PayPal 购买按钮更改为文本链接?谢谢。这是代码:

<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>

回答by 1' OR 1 --

Did you try this? https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XXX

你试过这个吗? https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XXX

You need to replace XXX of course.

你当然需要更换XXX。

The HTML-Code would look like this: Your Text

HTML 代码如下所示: 您的文本

For example one with working button id: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7865

例如一个带有工作按钮 id 的:https: //www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7865

回答by Brad

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".

Paypal 有一个构建器可以执行此操作。登录到您的贝宝帐户。点击“商家服务”。选择您想要的按钮类型(付款、订阅等)。运行其余的选项。它会将按钮生成为表单,但顶部有一个选项卡可以将其生成为链接。该选项卡的标题为“电子邮件”。

回答by user3147424

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".

创建按钮后,将出现一个电子邮件链接。您可以将其用作 href="https://www.paypal.com/examplecode/ExampleButtonID"。

回答by Nick Saemenes

Check out this Paypal Link Generator. http://www.blogbyben.com/2009/04/paypal-link-generator-build-your-own-1.html

看看这个 Paypal 链接生成器。 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

PayPal 似乎确实强制您使用图像作为链接,因为它允许他们对发送的某些数据进行加密。查看https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/pp_websitepaymentsstandard_integrationguide.pdf第 90 页上的“保护付款按钮的 HTML 代码”

回答by Pegues

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:

尚未发布的一种解决方案是捐赠链接。希望有人觉得这有帮助。除了@1' OR 1 --提供的内容外,您还可以使用以下链接作为捐款的文本链接:

https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&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 [email protected]and Donation+to+YOUR+BUSINESS+NAMEwith your own information, as well as possibly change currency code.

您需要用您自己的信息替换[email protected]Donation+to+YOUR+BUSINESS+NAME,并可能更改货币代码。

回答by Dan Roberts

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 XXXwith whatever your button code is and replace Text goes herewith whatever text you wish to show.

替换XXX为您的按钮代码,并替换Text goes here为您希望显示的任何文本。

The XXXis the hosted button ID, which is usually a 13 character value such as H6C28LJRV72J2.

XXX是托管按钮ID,它通常是一个13个字符的值,例如H6C28LJRV72J2

回答by rcravens

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.

这将为您提供一个带有文本的按钮。