bencagri
bencagri

Reputation: 183

Codeigniter Ci-Merchant Paypal Error

I'm trying to use ci-merchant with paypal.

here is my test controller

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;
    }

}
}

When I run site.dev/test/paypal_express, I get,

Fatal error: Call to a member function set_params() on a non-object in /var/www/ci/application/libraries/merchant.php on line 192

php version: PHP 5.5.9-1ubuntu4.3 ci version : 2.2

Upvotes: 0

Views: 356

Answers (0)

Related Questions