在 PHP 站点中集成托管 Web 服务

发布于 2024-09-11 22:42:08 字数 155 浏览 4 评论 0原文

我想在我的 PHP 网站中集成 escrow.com 的服务。

您将如何开始实现这个目标?提供的 API 是基本功能?您有任何针对 PHP 的建议或陷阱吗?您会推荐其他服务提供商吗?

I want to integrate the services of escrow.com in my PHP site.

How would you get started with this goal, and what APIs provided would be the basic functionality? Do you have any PHP specific advice or gotchas? Would you recommend another service provider?

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

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

发布评论

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

评论(3

随心而道 2024-09-18 22:42:08

我目前正在与这家公司合作开发一个 API 项目。我知道查看文档,这一切看起来有点令人畏惧,但是,您可以让它像一个小的 cURL 请求一样简单。

我建议从提供的“新托管交易”示例开始,并使用他们提供的 XML 构建您的请求,并根据您的详细信息进行修改。

将 XML 分配给一个变量,并通过类似于下面的curl 请求传递它;

        // Initialise your cUrl object
    $ch = curl_init('https://xml.Escrow.com/Invoke/Partners/ProcessrequestXML.asp');

    //set your cURL options
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "\$xmldata=".urlencode($xml));

    //Start your cURL Transaction
    ob_start();

    //execute your cURL object with your parameters
    $result = curl_exec($ch);

    //set the returned info to a variable
    $info = curl_getinfo($ch);

    // close the transaction
    curl_close ($ch);

    //get the contents of the transaction
    $data = ob_get_contents();
    ob_end_clean();

    //optional; Redirect to a specific place
    header("Location:".$url);

我能提供的唯一建议是仔细阅读文档,并始终检查您传入的值。

在可能的情况下,将 API 函数分离到它们自己的类中也是一个好主意,这将有助于维护和故障排除,以及测试功能变得更加容易。

I'm working on an API project with this Company at the moment. I know looking at the documentation it all looks a little daunting, however, you can get away with making it as simple as a small cURL request.

I'd suggest starting with the "New escrow transaction" example provided, and build your request using the provided XML they offer, amended with your details.

Assign the XML to a variable, and pass it through a curl request similar to the below;

        // Initialise your cUrl object
    $ch = curl_init('https://xml.Escrow.com/Invoke/Partners/ProcessrequestXML.asp');

    //set your cURL options
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "\$xmldata=".urlencode($xml));

    //Start your cURL Transaction
    ob_start();

    //execute your cURL object with your parameters
    $result = curl_exec($ch);

    //set the returned info to a variable
    $info = curl_getinfo($ch);

    // close the transaction
    curl_close ($ch);

    //get the contents of the transaction
    $data = ob_get_contents();
    ob_end_clean();

    //optional; Redirect to a specific place
    header("Location:".$url);

The only advise I can offer is to read through the documentation carefully, and always check the values you are passing in.

Where possible, it is also a good idea to segregate the API functions into their own class, this will make maintenance and troubleshooting, as well as testing the functionality that much easier.

南风几经秋 2024-09-18 22:42:08

这是我第一次听说托管,但快速浏览一下该网站后,我发现:

此联系表可获取更多信息:

https://escrow.com/contact/sales.asp

常见问题解答:
https://www.escrow.com/support/faq/index.html asp?sid=8

This is the first time I hear about escrow, but a quick scan of the site gives me:

this contact form to get more info:

https://escrow.com/contact/sales.asp

A FAQ:
https://www.escrow.com/support/faq/index.asp?sid=8

我不咬妳我踢妳 2024-09-18 22:42:08

www.Transpact.com 提供类似但成本较低的服务。
它也是英国政府(FSA 和 HMRC)注册的。

它提供了一个简单的 SOAP API,可以轻松集成到您的网站中。

www.Transpact.com offers a similar but lower cost service.
It is also UK Government (FSA and HMRC) registered.

It offers a simple SOAP API for easy integration into your website.

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