Sagepay cURL数据发布 [英] Sagepay cURL data posting
本文介绍了Sagepay cURL数据发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以让我知道我在下面的代码中在哪里出错了。
can any one please let me know where i did the mistake on the below code.
我刚刚将交易信息发布到了sagepay中,作为sagepay建议的格式。因此,我已经使用cURL发布了这些信息。在这里我的疑问出现在第10行上。请告知我将使用此语句进行全新的连接创建吗?
I have just post the transaction information to sagepay as the format suggested by sagepay. so i have used cURL to post those information. here my doubt is appears on the line number 10. please advise will i use this statement for fresh connection creation?
它将开始无限循环吗?
will it start infinite loop?
<?
1 $curlSession = curl_init();
2 curl_setopt ($curlSession, CURLOPT_URL, $url);
3 curl_setopt ($curlSession, CURLOPT_HEADER, 0);
4 curl_setopt ($curlSession, CURLOPT_POST, 1);
5 curl_setopt ($curlSession, CURLOPT_POSTFIELDS, $data);
6 curl_setopt($curlSession, CURLOPT_RETURNTRANSFER,1);
7 curl_setopt($curlSession, CURLOPT_TIMEOUT,180);
8 curl_setopt($curlSession, CURLOPT_SSL_VERIFYPEER, FALSE);
9 curl_setopt($curlSession, CURLOPT_SSL_VERIFYHOST, 1);
10 curl_setopt($curlSession, CURLOPT_FRESH_CONNECT, 1);
11 $rawresponse = curl_exec($curlSession);
?>
推荐答案
这对我有用:
<?php
$curlSession = curl_init();
curl_setopt($curlSession, CURLOPT_URL, $url);
curl_setopt($curlSession, CURLOPT_HEADER, 0);
curl_setopt($curlSession, CURLOPT_POST, 1);
curl_setopt($curlSession, CURLOPT_POSTFIELDS, $data);
curl_setopt($curlSession, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlSession, CURLOPT_TIMEOUT, 30);
$response = split(chr(10), curl_exec($curlSession));
curl_close ($curlSession);
?>
这篇关于Sagepay cURL数据发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文