更轻松的方式来整合PayPal快速结帐? [英] Easier way to integrate PayPal express checkout?

查看:212
本文介绍了更轻松的方式来整合PayPal快速结帐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为Wordpress CMS构建了一个产品生成和显示插件,我现在正试图集成某种形式的PayPal集成用于结帐过程。

I have built a product generation and display plugin for the Wordpress CMS and I am now trying to integrate some form of PayPal integration for the checkout process.

我有购物车,产品,运输,总计,我的结论,我希望有人能指向我最简单的方向发送信息到PayPal。我明白这样做的一些方法不是安全的,其他人让你跳过像一些显示狗的篮球。我一直在努力学习如何使用cURL,然后如何让它使用PHP - 它真的似乎有点乱。我现在有cURL在我的WAMP服务器上工作...但是...

I have the cart, the products, the shipping, totals, all that figured out on my end and I was hoping someone could point me in the simplest direction of sending this information to PayPal. I understand some methods of doing this are not that secure and others make you jump through hoops like some sort of show dog. I've been trying to learn how to use cURL and then how to get it to work with PHP - it really seems like a bit of a mess. I do now have cURL working on my WAMP server ... but..

有没有更好的方法,还是应该继续学习cURL?

Is there a better way or should I continue to learn cURL?

我可以格式化数据,但它需要发送到PayPal,不介意使用JavaScript - 这不是一个薪水墙,每个订单是检查一个人的准确性 - 所以有人搞砸客户端脚本不会打扰我。我也肯定想把它们发送到PayPal,我不想要存储/处理他们的信用卡信息的任何部分。然而,拥有IPN将是很好的。有人可能指向我正确的方向,或向我保证我已经这样走了?

I can format the data however it needs to be to send off to PayPal and would not mind doing this with JavaScript - this is not a pay-wall and every order is checked for accuracy by a human - so someone messing with the client-side script will not bother me. I also definitely want to send them to PayPal, I want no part of storing/processing their credit card information. It would, however, be nice to have IPN. Can someone point me in the right direction or assure me that I already am headed that way?

非常感谢。

推荐答案

这是我自动重定向到PayPal的所有表单详细信息;

This is how i automatically redirect to PayPal with all the form details;

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="paypal">

 <input type="hidden" name="cmd" value="_xclick" />
  <input type="hidden" name="cbt" value="Return to example" />
 <input type="hidden" name="business" value="email" />
 <input type="hidden" name="item_name" value="example Purchase" />
 <input type="hidden" name="amount" value="9.99">
 <input type="hidden" name="button_subtype" value="services" />
 <input type="hidden" name="no_shipping" value="1">
 <input type="hidden" name="return" value="URL" />
 <input type="hidden" name="notify_url" value="URL"/>
 <input type="hidden" name="cancel_return" value="URL" />
<input type="hidden" name="currency_code" value="USD"/>
<input type="hidden" name="image_url" value="" />
<input type="hidden" id="custom" name="custom" value="invoice_id to track"/>
 <input type="hidden" class="btn btn-primary" style="width:100%" alt="PayPal - The safer, easier way to pay online!"/>

</form>

对于多个产品,您只需向表单中添加更多产品,example;

For multiple products, you can simply add more products to the form, example;

<input type="hidden" name="item_name_1" value="Item #1">
<input type="hidden" name="amount_1" value="1.00">
<input type="hidden" name="item_name_2" value="Item #2">
<input type="hidden" name="amount_2" value="2.00">

但是,使用这种方法并不好用。

However, using this method is not all great

所有数据都需要使用PHP生成并输入到页面中,您还需要在IPN回拨时检查事务以确保已支付。

All the data would need to be generated with PHP and input into the page, you would also need to check the transaction when the IPN calls back to ensure its been paid.

<script type="text/javascript">
  function myfunc () {
     var frm = document.getElementById("paypal");
     frm.submit();
  }
  window.onload = myfunc;
</script>

这篇关于更轻松的方式来整合PayPal快速结帐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆