Mobile app version of vmapp.org
Login or Join
Goswami781

: Codeigniter ci-merchant library - authorize.net payment gateway integration issue I tried to integrate codeigniter authorize.net payment gateway by using the docs http://ci-merchant.org , I can successfully

@Goswami781

Posted in: #Codeigniter #PaymentGateway

I tried to integrate codeigniter authorize.net payment gateway by using the docs ci-merchant.org , I can successfully integrate the paypal but unfortunately i couldn't do authorize.net. The below code i have tried,but not working, how to do it ?

$this->load->library('merchant');
$this->merchant->load('authorize_net_sim');
$settings = array(
'api_login_id' => 'xxxx',
'transaction_key' => 'xxxx',
'test_mode' => true);

$this->merchant->initialize($settings);

$params = array(
'amount' => 10,
'currency' => 'USD',
'card_no' => '4111111111111111',
'exp_month' => '12',
'exp_year' => '14',
'csc' => 123,
'first_name' => 'Ashok',
'last_name' => 'KS',
'return_url' => 'http://www.ioss.in/success',
'cancel_url' => 'http://www.ioss.in/cancel'
);
$response = $this->merchant->purchase($params);


print_r($response) returns:

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] =>
)


UPDATE 1
after change the code, its working fine...

$params = array(
'amount' => 10.00,
'currency' => 'USD',
'return_url' => 'http://www.ioss.in',
'cancel_url' => 'http://www.google.in');

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Goswami781

1 Comments

Sorted by latest first Latest Oldest Best

 

@Si4351233

Per the comments, if the $response is failing with no error message it's generally because you are trying to submit credit card details unencrypted (not using HTTPS), which isn't supported by CI Merchant (for obvious security reasons).

In this case, the credit card details wern't necessary anyway because the Auth.net SIM gateway is an off-site gateway (card details are not entered on your site). Changing the $request to this fixed the problem:

$params = array(
'amount' => 10.00,
'currency' => 'USD',
'return_url' => 'http://www.ioss.in',
'cancel_url' => 'http://www.google.in',
);


In addition, to use the Authorize.net developer endpoint, developer_mode must be set to true in the gateway settings. This is different from test_mode (Auth.net specific feature):

$settings = array(
'api_login_id' => 'xxxx',
'transaction_key' => 'xxxx',
'developer_mode' => true,
);
$this->merchant->initialize($settings);

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme