gpt4 book ai didi

paypal - Sandbox Payflow Gateway API 调用超时

转载 作者:太空宇宙 更新时间:2023-11-03 15:57:49 25 4
gpt4 key购买 nike

我已遵循指南 for Payflow hosted pages并尝试了 demo (.zip file)一切都在处理前几个 cURL 请求。现在,端点 https://pilot-payflowpro.paypal.com总是返回超时:

Failed to connect to port 80: Connection timed out

这是抛出此错误的代码:

// run_payflow_call: Runs a Payflow API call.  $params is an associative array of
// Payflow API parameters. Returns FALSE on failure, or an associative array of response
// parameters on success.
function run_payflow_call($params) {
global $environment;

$paramList = array();
foreach($params as $index => $value) {
$paramList[] = $index . "[" . strlen($value) . "]=" . $value;
}

$apiStr = implode("&", $paramList);

// Which endpoint will we be using?
if($environment == "pilot" || $environment == "sandbox")
$endpoint = "https://pilot-payflowpro.paypal.com/";
else $endpoint = "https://payflowpro.paypal.com";

// Initialize our cURL handle.
$curl = curl_init($endpoint);

curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);

// If you get connection errors, it may be necessary to uncomment
// the following two lines:
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);

curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, $apiStr);

$result = curl_exec($curl);
if($result === FALSE) {
echo curl_error($curl);
return FALSE;
}
else return parse_payflow_string($result);
}

有人遇到过吗?

最佳答案

由于您使用的主机端口 80 很可能是连接超时的原因。确保端口 443 已打开。
以下是Payflow的基本连接参数信息:

https://developer.paypal.com/docs/classic/payflow/integration-guide/#payflow-connection-parameters

HOSTPORT(必需)使用端口 443。

谢谢,
詹妮弗

关于paypal - Sandbox Payflow Gateway API 调用超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48092743/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com