PayPal 结账按钮和自定义变量

发布于 2024-08-10 22:48:35 字数 254 浏览 2 评论 0原文

我创建了一个相当简单的照片库,我希望应用 PayPal Checkout 按钮。基础知识很简单,但我想要做的是至少预先填充命名字段作为按钮的一部分,或者将每个单独页面中包含的变量传递到购物车。

每个页面都包含图片 ID、日期和标题。我希望能够传递这些数据,以便当有人单击“添加到购物车”时,数据已经存在。现在,我看到按钮工作的唯一方法是创建自定义字段并让客户自己复制和粘贴数据,这有点痛苦。

如果我能弄清楚这一点,贝宝结帐可能值得花时间。这里有人做过这样的事吗?

I have created a rather simple photo gallery that I wish to apply PayPal Checkout buttons. The basics are simple enough, but what I want to do is to at least pre-populate the named fields as part of the button or pass variables contained in each individual page through to the cart.

Each page contains a picture ID, date, and title. I would like to be able to pass this data along so that when someone clicks "Add to Cart", the data is already there. Right now the only way I can see the buttons working is creating custom fields and having the customer copy and paste the data themselves, kind of a pain.

If I could figure this one thing out PayPal checkout might be worth while. Has anyone here ever done this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

你是年少的欢喜 2024-08-17 22:48:35

你需要这样的东西吗?我不久前从 PayPal 文档中得到了它。我现在正在生产应用程序中使用它。不过,请在使用前进行测试:)

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" style="margin:4px 0px 0px 4px;">
<input type="image" src="<ADD_TO_CART_BUTTON>.jpg" border="0" name="submit" alt="Add this item to your shopping cart">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">

<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="<YOUR_PAYPAL_EMAIL>">
<input type="hidden" name="item_name" value="<THE_ITEM_NAME>">
<input type="hidden" name="item_number" value="<THE_ITEM_NUMBER_SKU_OR_WHATEVER>">
<input type="hidden" name="amount" value="<HOW_MUCH_IT_COSTS>">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="cn" value="<CUSTOM_TEXT_FOR_THE_BUYER_TO_LEAVE_YOU_SPECIAL_INSTRUCTIONS>">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">

<input type="hidden" name="bn" value="PP-ShopCartBF">
<input type="hidden" name="address_override" value="1">
<input type="hidden" name="business_cs_email" value="<YOUR_PAYPAL_EMAIL>">
    <input type="hidden" name="return" value="<WHERE_TO_TAKE_THE_USER_AFTER_PURCHASE_LIKE_thankyou.html>">
    <input type="hidden" name="notify_url" value="<IF_YOU_PROCESS_ORDERS_THROUGH_YOUR_SITE_THE_CALLBACK_URL_GOES_HERE>">

</form>

对于您销售的每件商品,您都需要其中一个。

http://sandbox.paypal.com 注册并开始在他们的沙箱中进行尝试。

另请查看 http://www.x.comhttp://www.paypal-labs.com。他们在结账方面做了一些很酷的事情。

You need something like this? I got it out of the PayPal docs awhile back. I'm using it in a production app now. Please test before using though :)

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" style="margin:4px 0px 0px 4px;">
<input type="image" src="<ADD_TO_CART_BUTTON>.jpg" border="0" name="submit" alt="Add this item to your shopping cart">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">

<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="<YOUR_PAYPAL_EMAIL>">
<input type="hidden" name="item_name" value="<THE_ITEM_NAME>">
<input type="hidden" name="item_number" value="<THE_ITEM_NUMBER_SKU_OR_WHATEVER>">
<input type="hidden" name="amount" value="<HOW_MUCH_IT_COSTS>">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="cn" value="<CUSTOM_TEXT_FOR_THE_BUYER_TO_LEAVE_YOU_SPECIAL_INSTRUCTIONS>">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">

<input type="hidden" name="bn" value="PP-ShopCartBF">
<input type="hidden" name="address_override" value="1">
<input type="hidden" name="business_cs_email" value="<YOUR_PAYPAL_EMAIL>">
    <input type="hidden" name="return" value="<WHERE_TO_TAKE_THE_USER_AFTER_PURCHASE_LIKE_thankyou.html>">
    <input type="hidden" name="notify_url" value="<IF_YOU_PROCESS_ORDERS_THROUGH_YOUR_SITE_THE_CALLBACK_URL_GOES_HERE>">

</form>

You'll need one of these for each item you're selling.

Signup at http://sandbox.paypal.com and start working in their sandbox to try this out.

Also check out http://www.x.com and http://www.paypal-labs.com. They've been doing some cool stuff with checkouts.

葬花如无物 2024-08-17 22:48:35

还可以使用“自定义”PayPal 变量进行检查,您可以使用该变量将您想要的任何信息传递给 PayPal,并在交易完成时将其取回。

Also check out using the "custom" PayPal variable, which you can use to pass any information you want to PayPal and get it back when the transaction completes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文