我试图用paypal使用ci-merchant。
这是我的测试控制器
class Test extends CI_Controller {
function paypal_express(){
$this->load->library('merchant');
$this->merchant->load('paypal_express');
$settings = array(
'username' => '***',
'password' => '***',
'signature' => '***',
'test_mode' => true);
$this->merchant->initialize($settings);
$params = array(
'amount' => 100.00,
'currency' => 'TRY',
'return_url' => site_url('test/paypal_express'),
'cancel_url' => site_url('test/paypal_express'));
$response = $this->merchant->purchase_return($params);
if ($response->success()){
echo 'ok';
}else{
$message = $response->message();
echo('Error processing payment: ' . $message);
exit;
}
}
}
当我运行site.dev/test/paypal_express时,我明白了,
致命错误:在第192行的/var/www/ci/application/libraries/merchant.php中的非对象上调用成员函数set_params()
php版本:PHP 5.5.9-1ubuntu4.3 ci版本:2.2