0

I have setup a checkout using CI Merchant and the payment gateway provider is with CardSave. Everything works perfectly using my test account and test card details however when trying a live transaction on a production account I get the following error:

Fatal error: Call to undefined function lang() in xxx\application\libraries\merchant\merchant_cardsave.php on line 160

Line 160 looks like:

$this->post_redirect($acs_url, $data, lang('merchant_3dauth_redirect'));

I've successfully integrated other merchants using CI Merchant and haven't come across this error before and haven't been able to find anything in Google either.

Has anyone come across and resolved this before?

JoJo
  • 161
  • 1
  • 12
  • where is function `lang()` defined. is it the one from inbuilt language helper or form merchant_cardsave.php – dhpratik Jun 04 '14 at 11:55
  • Well it's not defined! I'm assuming it is trying to use CodeIgniter's built in language helper so I have added that to config/autoload.php to ensure it is loaded and have asked the client to do another test. – JoJo Jun 04 '14 at 12:21
  • secondly have you declared index `merchant_3dauth_redirect` in the application/language/ folder. and then initialized it by`$this->lang->load('', );` – dhpratik Jun 04 '14 at 12:41
  • No I haven't. CI Merchant is a third party plugin and should just work without additional language configuration. Not sure why it is having an issue here as have used it successfully in the past as is. The client is now reporting receiving a blank page rather than an error so will need to investigate further. – JoJo Jun 04 '14 at 12:47
  • instead of using `lang('merchant_3dauth_redirect')` directly use the value which it is going to display. for more info read localization using codeigniter – dhpratik Jun 04 '14 at 13:19
  • It's not my code so I'm not about to start changing it (especially as it's used throughout the CI Merchant library). It would appear that autoloading the language helper has fixed the problem. Thank you for your help – JoJo Jun 04 '14 at 14:43
  • Looks like the language helper isn't loaded automatically by CI Merchant. On an unrelated note, are you aware that CI Merchant is no longer supported and has been replaced by Omnipay? – Adrian Macneil Jun 15 '14 at 20:55
  • Thanks @AdrianMacneil, I have actually been looking at Omnipay and was planning to move to it with my move to Laravel. I didn't realise that CI Merchant was no longer supported! Time to move now then thank you :) – JoJo Jun 17 '14 at 07:03

0 Answers0