CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute »
  • Community Contributed Payment Processors »
  • Moneris - API token mismatch - USA?
Pages: [1] 2

Author Topic: Moneris - API token mismatch - USA?  (Read 13110 times)

alextronic

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 2
  • I do what I do
Moneris - API token mismatch - USA?
January 08, 2010, 02:28:54 pm
Hi folks,

Sorry if this has been posted before, I searched but no joy.

I am trying to implement Moneris' payment processor. I am getting an "API token mismatch" and the API token is correct (I am using $USD as default currency in Localization settings)

I called Moneris, they looked into the error transaction, and they told me that the code (the contributed plug in) that I'm using in the site is for the Canadian moneris, and they told me that the variable names etc, are not the same as for USA, so I should look for a USA plug in, and he sent me to usintegrations(at)moneris.com to ask for a php-US-api and implementing in the plugin... something I don't have the skill to do I'm afraid.

Is this right? Do I need to do this? I think NOT, but well, I'he heard there are some issues with using US dollars instead of canadian dollars... i don't know. Please I need some illustration on what the error might come from.

Thanks
Alejandro

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Moneris - API token mismatch - USA?
January 08, 2010, 05:57:11 pm
Hi,

It is probably a case of renaming fields that are sent through to Moneris - for example the Canadian version might use POST CODE and the US one might use ZIP CODE.

Unfortunately it is always hard to know how much work is involved before you have thoroughly reviewed the documentation - and even then the 'gotcha's might not become clear until you get started.

So, the first question is why are you using Moneris & how important is it to you to use Moneris. There may be a better option.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

alextronic

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 2
  • I do what I do
Re: Moneris - API token mismatch - USA?
January 09, 2010, 10:39:27 am
Hmmm... so I guess I can take a look at the documentation and just rename the fields... and fixing the errors on the way I might get a working version. Good. Can you please illustrate me which is the file I must modify? to start with. Thank you!!!!

The reason why we use Moneris is because Authorize.net does not support recurring transactions well, and the client does not like PayPal solution.

Note:  We tried the Test moneris and it worked. But when we used the Live, with the Api token of the merchant account, then the errors came. ... Odd, isn't it?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Moneris - API token mismatch - USA?
January 09, 2010, 10:56:16 am
Give it a go then - the file will be in civicrm/Core/Payment.

If you feel that it is going to be a lot of work considering putting in with others to get recurring going on either Authorize.net or PayflowPro as there are a few groups interested in that route & it might work out well. PayflowPro is probably about $USD 500 away from completion - excluding ARB because I'm not sure where that is at with any
 of the recurring ones.

When you used the Test account maybe the credentials were linked with the Canadian version?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Moneris - API token mismatch - USA?
January 11, 2010, 12:55:38 pm
Hi,

I think the ones in bold are the ones that are sent as variable names through to Moneris
Code: [Select]
     $billing = array(
         [b]first_name[/b] => $params['first_name'],
         [b]last_name[/b] => $params['last_name'],
         [b]address [/b]=> $params['street_address'],
         [b]city [/b]=> $params['city'],
         [b]province[/b] => $params['state_province'],
         [b]postal_code[/b] => $params['postal_code'],
         [b]country [/b]=> $params['country']
      );

So they should match these field names

                          billing => array('first_name', 'last_name', 'company_name', 'street_address',
                                              'city', 'state_province', 'postal_code', 'country',
                                              'phone_number', 'fax','tax1', 'tax2','tax3',
                                              'shipping_cost'),

I don't think you should have to change these (in Bold) in the php file as they can be configured through CiviCRM but the API version I expect does need to be set in the code.:

   var $Globals=array(
                   MONERIS_PROTOCOL => 'https',
                   MONERIS_HOST => 'esplusqa.moneris.com',
                   MONERIS_PORT =>'443',
                       MONERIS_FILE => '/gateway_us/servlet/MpgRequest',

                     API_VERSION  =>'US PHP Api v.1.1.2',
                     CLIENT_TIMEOUT => '60'
                    );
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

alextronic

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 2
  • I do what I do
Re: Moneris - API token mismatch - USA?
February 03, 2010, 12:06:37 pm
Hi Eileen, I've been working on this a lot, and couldn't make it work... I ended up calling Moneris Integration Support and they told me that it's not only variables names but also functions names and "more things" that differ from one version to the other. We can't, on the other hand, get a Moneris Canadian Account for legal reasons since the company is based in the US, therefore we are kind of caught in between...

So, what I am asking here is, would anyone be able to take a look at the US PHP API code and the Moneris (canadian) Plugin, so that those changes be made? I have tried to do that, for the life of me, but I am not that good. Maybe there is someone out there able to do this, I don't think it's a lot of work but I do think that it requires certain knowledge.

So thank you and let's see if there's a solution.

P.S.: I really don't know why it worked in test mode. I will try again and report what happens.

alextronic

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 2
  • I do what I do
Re: Moneris - API token mismatch - USA?
February 03, 2010, 12:30:24 pm
Well, I don't know. I have tried with Test server (canadian plugin, US account), using ignoreme, yesguy, and https://esqa.moneris.com/ as details for payments (just as the guides say), and when it gets to the confirmation page I get a WSOD.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Moneris - API token mismatch - USA?
February 03, 2010, 12:34:42 pm
HI - if you get a WSOD then you should check your apache log & see what the error is
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

alextronic

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 2
  • I do what I do
Re: Moneris - API token mismatch - USA?
February 03, 2010, 12:49:02 pm
You're right. This is the associated error.

[Wed Feb 03 20:27:39 2010] [error] [client 75.xxx.57.xxx] PHP Fatal error:  Call to undefined method mpgRequest::getTransactionType() in /var/www/html/sites/all/modules/civicrm/packages/Services/mpgClasses.php on line 55, referer: https://www.domain.org/civicrm/contribute/transact?_qf_Confirm_display=true&qfKey=bd3fb3682149741f5dd62c6b3cefea0b

alextronic

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 2
  • I do what I do
Re: Moneris - API token mismatch - USA?
February 03, 2010, 12:58:59 pm
In civicrm/packages/Services/mpgClasses.php (the one I got from US Integrations), getTransactionType() is used in function mpgHttpsPost($storeid,$apitoken,$mpgRequestOBJ):

Code: [Select]
function mpgHttpsPost($storeid,$apitoken,$mpgRequestOBJ) {
  $this->store_id=$storeid;
  $this->api_token= $apitoken;
  $this->mpgRequest=$mpgRequestOBJ;

  $dataToSend=$this->toXML();
  //print ($dataToSend);
  //do post
   $g=new mpgGlobals();
   $gArray=$g->getGlobals();
   $transactionType=$mpgRequestOBJ->getTransactionType();
  $url=$gArray[MONERIS_PROTOCOL]."://".
       $gArray[MONERIS_HOST].":".
       $gArray[MONERIS_PORT].
       $gArray[MONERIS_FILE];

...and so on...

(BTW the other day I deleted a message by mistake; I don't know if I attached the U.S. mpgClasses.php in it; anyway, I attach it here)
« Last Edit: February 03, 2010, 01:04:04 pm by alextronic »

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: Moneris - API token mismatch - USA?
February 03, 2010, 05:12:40 pm
hey:

i'm the original implementor of the Moneris plugin [in Canada]. That's great that it might work in the US.

For reference - I did make a few small changes to the mgpClasses.php file before adding it into the repository, so you may need to mirror those changes [see my note at the top ..]. But in theory, it should be straightforward, since the interface is a simple POST with named fields.

Also - it'd be best if you didn't just remove the copious testing for C$ since that was a requirement of the original code .., but if you can get it to work, send me a copy of what you've done and I may be able to extend the existing official plug-in to work for US$ as well.

If it's really not making sense, send me a copy of what the US Moneris gave you and I'll see if I can do it.

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: Moneris - API token mismatch - USA?
February 16, 2010, 08:26:01 am
Okay, i took a look at the 'api' document and I think this needs to be a separate plugin. I can work on this, though it might take a week or two.

  - Alan

alextronic

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 2
  • I do what I do
Re: Moneris - API token mismatch - USA?
February 17, 2010, 07:59:37 am
Thank you very much Alan, if you need any help in the process let us know.
Alex.

nicolef

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.0.51a
  • PHP version: 5.3.5
Re: Moneris - API token mismatch - USA?
May 30, 2012, 07:35:16 pm
Hey Alan!

I know it's been some time since the last response to this ticket, but I wanted to see if you were able to develop the US version of the Moneris Gateway?

Thanks!
Nicole

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: Moneris - API token mismatch - USA?
June 15, 2012, 11:47:10 am
No, I've officially abandoned Moneris.

1. They didn't reply to any of my requests about GPL, etc.
2. I use IATS instead for all my clients, who are less expensive, more appropriate, etc.

Sorry, on your own ...

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute »
  • Community Contributed Payment Processors »
  • Moneris - API token mismatch - USA?

This forum was archived on 2017-11-26.