Ping sagepay 查看是否已关闭
我开发自己的电子商务框架已经有一段时间了,现在正在编写结帐代码。我想使用 sagepay 来处理付款,因为我已经使用了一段时间了。但我过去曾接到过一个电话,说客户由于 sagepay 停机而无法处理付款。它没有关闭很长时间,但我想克服这个问题,我将添加一个备用付款方式,例如贝宝。由于 paypal 的佣金很高,我真的不想将这两个选项添加在一起,只有在 sagepay 宕机时才提供它。所以我的问题是,有没有办法 ping sagepay 来判断它是否已关闭?
PHP 中的 ps
i have been developing my own e-commerce framework for a while now and am now coding up the checkout. I want to use sagepay to process the payments as it is what I have used for a while. But I have haad one or to phone calls in the past saying customers where not able to process there payments due to sagepay being down. It was not down for very long but I thought to overcome this i'll add a backup payment method such as paypal. Due to paypal's high commission, I dont really want to add both options together, and only offer it when sagepay is down. So my question being, is there a way of pinging sagepay to tell whether it is down or not?
p.s. in PHP
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您有 unix/linux 底层和足够的权限,您可以简单地评估
exec('ping sagepayserver');
或者尝试通过 fsockopen() 访问服务器。
http://de.php.net/manual/en/function.fsockopen.php
If you have a unix/linux underlying and enough rights you can simply evaluate
exec('ping sagepayserver');
or you try to reach the server via
fsockopen()
.http://de.php.net/manual/en/function.fsockopen.php