首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用码点火器进行instamojo签出

用码点火器进行instamojo签出
EN

Stack Overflow用户
提问于 2017-02-02 05:45:18
回答 1查看 1.4K关注 0票数 3

我已经用CodeIgniter创建了一个项目,现在我想集成instamojo支付网关。但是,当我尝试结账时,我面临着以下问题。

  1. 页面正在加载
  2. 过了一段时间,它给了我以下的错误。

“错误:出了问题。cURL以号码:7引发错误,消息:未能连接到test.instamojo.com端口443:连接超时。”

我使用的代码是由instamojo文档提供的

代码语言:javascript
复制
    $ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.instamojo.com/api/1.1/payment-requests/');
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER,
            array("X-Api-Key:API_KEY",
                  "X-Auth-Token:AUTH"));
$payload = Array(
    'purpose' => 'FIFA 16',
    'amount' => '2500',
    'phone' => '9999999999',
    'buyer_name' => 'John Doe',
    'redirect_url' => 'http://www.example.com/redirect/',
    'send_email' => true,
    'webhook' => 'http://www.example.com/webhook/',
    'send_sms' => true,
    'email' => 'foo@example.com',
    'allow_repeated_payments' => false
);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($payload));
$response = curl_exec($ch);
curl_close($ch); 

echo $response;
EN

回答 1

Stack Overflow用户

发布于 2018-11-11 18:37:31

更改此行1

代码语言:javascript
复制
curl_setopt($ch, CURLOPT_URL, 'https://www.instamojo.com/api/1.1/');

工作很好。欲知更多详情,请访问请参阅insatamojo-php源树。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41995005

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档