【发布时间】:2013-01-10 22:43:56
【问题描述】:
我正在尝试使用 CI-Merchant 库来集成 Paypal Pro(直接付款),但我迷路了..
我已经设置了一个英国沙盒(一个预先配置了 paypal pro 的卖家账户和一个包含以下信息的买家账户($params 数组)
这是我得到的响应(状态失败,没有消息)以及我正在使用的 $params 数组:
Merchant_response Object
(
[_status:protected] => failed
[_message:protected] =>
[_reference:protected] =>
[_data:protected] =>
[_redirect_url:protected] =>
[_redirect_method:protected] => GET
[_redirect_message:protected] =>
[_redirect_data:protected] =>
)
Array
(
[card_type] => Visa
[card_no] => 4269072658337891
[first_name] => Buyer
[last_name] => One
[address1] => 1 Main Terrace
[city] => Wolverhampton
[region] => West Midlands
[postcode] => W12 4LQ
[amount] => 10
[currency] => GBP
[country] => UK
)
这里是代码:
$this->load->library('merchant');
$this->merchant->load('paypal_pro');
$settings = array(
'username' => '***',
'password' => '***',
'signature' => '***',
'test_mode' => true);
$this->merchant->initialize($settings);
//params array is set through a form submit.
$response = $this->merchant->purchase($params);
echo '<pre>';
print_r($response);
print_r($params);
exit;
请告诉我如何调试它!
谢谢, 乔治
【问题讨论】:
-
如果您自己解决了这个问题,请记得写下解决方案作为答案。是否与您的付款页面上未使用 SSL 有关?
-
我还没有解决这个问题。我怀疑这可能是由于当时没有可用的 SSL 证书,但我不得不先使用 Paypal 的示例代码在没有证书的情况下进行测试。我可以建议在商家响应中添加更多详细信息,而不是在那种情况下将状态设置为“失败”,并且将来还可以选择进行不安全测试(至少在沙盒模式下)!看起来像一个很棒的图书馆,但当时不适合我的目的
-
@GeorgesSabbagh 我们应该为
$settings数组的signature属性赋予什么值?
标签: codeigniter paypal-sandbox ci-merchant