【发布时间】:2014-07-21 15:47:30
【问题描述】:
对于在线支付,我正在尝试使用 ci_merchant。根据http://ci-merchant.org/ ,我做了一个CodeIgniter项目。但该功能只显示空白页。
我的功能如下:
function transaction(){
$this->load->library('merchant');
$this->merchant->load('paypal_express');
$settings = $this->merchant->default_settings();
$settings = array(
'username' => 'AAAAAAAAAAA',
'password' => '111111',
'signature' => 'AAAAAAAAAAAARCpSSRl31AoJ0SIOUHEnDbhhEgANdZeAmMTkU',
'test_mode' => true
);
$this->merchant->initialize($settings);
$params = array(
'amount' => 1.00,
'currency' => 'USD',
'return_url' => 'http://localhost/tcm/account/transaction_return',
'cancel_url' => 'http://localhost/tcm/account/transaction_cancel'
);
//'return_url' => 'https://www.example.com/checkout/payment_return/123',
//'cancel_url' => 'https://www.example.com/checkout');
$response = $this->merchant->purchase($params);
if ($response->success()){
echo "Successfully complete transaction.";
}
else{
$message = $response->message();
echo('Error processing payment: ' . $message);
exit;
}
}
我的代码或程序的问题在哪里?等待肯定的答复。
【问题讨论】:
-
尝试在顶部添加类似
echo "this point achieved";的内容,以确保执行此功能 -
我检查了,该功能正在运行。
-
在 if 语句之前尝试
echo $this->merchant->purchase($params)->success();和echo $this->merchant->purchase($params)->message();
标签: codeigniter paypal ci-merchant