标签归档:paypal
ecshop 的paypal 支付,在fsockopen 关闭情况下使用curl 获取支付结果
ecshop的paypal sandbox 测试支付,需要修改的部分
下面是代码,方便复制
get_code函数里面 $def_url = '<br /><form style="text-align:center;" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_blank">' . // 不能省略 respond 函数里面 // post back to PayPal system to validate $header = "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "HOST: www.sandbox.paypal.com\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) ."\r\n\r\n"; $fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);
同一paypal 在多个ecshop站点使用代码修改
症状: 同一个paypal账号在多个ecshop 站点使用,出现paypal订单已经支付从而无法支付的状况
includes\modules\payment\paypal.php 修改 function get_code($order, $payment) 函数内 $data_order_id = $order['log_id']; 改为 $data_order_id = 'site2'. $order['log_id']; 修改 function respond() 函数内 $order_sn = substr($_POST['invoice'],5); // 5 是 'site2' 这5个字符的长度,要根据这个修改
再次中文解释paypal IPN
参见地址
http://paypal.ebay.cn/integrationcenter/list__resource_2.html
启用IPN有两种方法:
一种是在您的PayPal账户里进行全局设置
另一种是在每笔交易的付款按钮中通过定义变量notify_url来进行设定
ecshop系列:通过固定paypal.php 来防止后台paypal收款账号被修改
有条件的用户可以通过修改include/modules/payment/paypal.php 文件 后 “固定”此文件方式连防止后台paypal的账号被修改
至于固定的方式则各种系统不同
1)windows 可以通过ntfs的权限系统设置文件只读
2)linux 系统可以通过 chattr +i 的方式 强制固定文件
ecshop 的paypal免掉单接口,解决paypal返回fail出错
问题描述:
ecshop 2.7.2 在 启用 paypal 支付方式后,使用paypal支付返回网站发生支付失败,实际已经支付的错误
解决方案:
本ecshop paypal 插件,采用 paypal IPN 服务器自动对单,免除掉单烦恼, 适用于ecshop 2.7.X 系列版本
联系方式:
QQ 733905
paypal ipn的精髓 关于ecshop 的paypal 贝宝支付模块错误的问题
With IPN the code will run regardless of whether or not the buyer reaches your final checkout page or not. Again, it is server-to-server communication and is entirely separate from the user’s interaction with your application.
翻译来的意思就是
ipn 代码不管客户端(浏览器) 购买者是否到达最终的反馈页面,IPN是服务器到服务器端的通信,IPN完全独立于用户浏览器和网站应用程序之间的交互(指购买者浏览器和商品网站)
如下文章可以解释的很清晰 IPN 和 PDT 的区别了
一句话解释就是 PDT 是依靠客户浏览器返回到商品网站来确认付款成功,而IPN则可独立于浏览器和服务器之间,IPN 是端到端(Paypal 到 网站) 的沟通,他可防止所谓的掉单现象的发生,对于一些需要自动化的任务有较好的效果,(比如游戏币的自动发卡,自动充值)。
详细的上下文如下https://www.x.com/docs/DOC-2502
中文说明在
http://paypal.ebay.cn/integrationcenter/list__resource_2.html
How is IPN Different from PDT?
I’d like to backup just a little bit now and discuss some of the differences between Instant Payment Notification (IPN) and Payment Data Transfer (PDT). They are very similar in the way they work so if you’re already familiar with PDT you may feel right at home with IPN. There is really one major difference that is very important to understand.
PDT was designed with one simple goal in mind: provide transaction data to checkout systems using Payments Standard so that it can be displayed on the merchant’s “thank you” or “completed” page. When utilizing PDT you have the option of data being returned as form data (POST) or as URL parameters (GET). You can then build your thank you page in a dynamic fashion so that users can print the page as a receipt, simply save it for their records, etc. It is a very useful tool when this is necessary, however, you cannot rely on PDT for automating tasks because there is no guarantee that the user will ever make it to your “thank you” page when working with PayPal Standard Payments. Even with Auto-Return enabled in your PayPal profile the user could close the browser before being redirected and the code on your thank you page will never run.
With IPN the code will run regardless of whether or not the buyer reaches your final checkout page or not. Again, it is server-to-server communication and is entirely separate from the user’s interaction with your application. Once that transaction is complete the data will be sent to your IPN listener and will be handled accordingly. This is why it is highly recommended you utilize Instant Payment Notification instead of Payment Data Transfer when automating tasks on the back-end.