paypal 的 php 基本立即付款按钮

标签 php html

我将尝试将 paypal 与我的 php 和 html 网站集成,似乎有大量关于该主题的文档,但其中一些令人困惑。

我基本上想做的是有一个我自己制作的购物车,显示用户想要购买的所有元素,并且只有一个 paynow 按钮用于这些元素,该按钮会将此信息发送到 paypal,并允许用户登录并在完成后返回我的网站。

我不需要购物车或添加到购物车按钮等,只需要一个按钮来支付商品,希望在 paypal 页面上显示价格和每件商品的所有相关数据。

如果有人知道任何教程,他们可以为我指出这类事情的方向,我将不胜感激。

最佳答案

这是一个非常简单的立即购买按钮示例:

<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="me@mybusiness.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="Teddy Bear">
<input type="hidden" name="amount" value="12.99">
<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>

您只需更改业务金额item_name

如果您需要多个项目,请像这样添加它们:

<input type="hidden" name="item_name_1" value="Toy">
<input type="hidden" name="amount_1" value="10">

<input type="hidden" name="item_name_2" value="Bike">
<input type="hidden" name="amount_2" value="20">

Straight from the Paypal Docs here

关于paypal 的 php 基本立即付款按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9704768/

相关文章:

php - 多行 php 上数字的正则表达式

php - Laravel 5.1 - 选择具有多对多关系的多个枢轴的所有模型

html - 如何在没有固定高度的情况下在 IE 11 中垂直居中文本?

html - Firefox 不水平扩展包含自动宽度图像的 DIV 容器

javascript - jQuery - 灯箱缩略图在 PHP 5.3 中不起作用

php - 当页面内容较少时如何将页脚粘贴到站点底部?

php - 错误 : Unknown column 'abc' in 'where clause'

html - 忽略 flex 容器的 child 而不是孙子

javascript - 使用 PHP 处理 html 表单中的多条记录

html - 100% 高度非 Canvas 粉底 5