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 (Moderator: Donald Lobo) »
  • Configuring Moneris Payment Processor
Pages: [1]

Author Topic: Configuring Moneris Payment Processor  (Read 2882 times)

farmrchrys

  • I post occasionally
  • **
  • Posts: 92
  • Karma: 2
    • Spokane Moves to Amend the Constitution (under development)
  • CiviCRM version: CiviCRM 4.4.6
  • CMS version: Drupal 7.31
  • MySQL version: MySQL 5.5.37
  • PHP version: PHP 5.3.28
Configuring Moneris Payment Processor
July 20, 2009, 05:02:59 pm
First off, thanks go to Eileen for posting some information on comparing payment processors on the wiki:
http://wiki.civicrm.org/confluence/display/CRMDOC/CiviContribute+Payment+Processor+Configuration.

From the little information I've been able to gather, Moneris seems like it's worth considering as a payment processor, but I have still questions:

1) Is the information about configuring Moneris on the wiki current? Is it really true for CiviCRM 2.2.7 that to use Moneris I must edit the configuration file? I'm talking about what's here:
http://wiki.civicrm.org/confluence/display/CRMDOC/Moneris+Configuration+Guide

[Modification 07-21-2009: the info referenced above was, apparently, obsolete and has since been removed. Just thought I'd say to save anyone being confused. ~farmrchrys]

It seems like Moneris is in the list of built-in (core?) payment processors and looks to be ready to configure right from Global Settings / Settings - Payment Processor. Not a word there about editing the configuration file, or, if it's the case, that it's a community-contributed feature. Maybe that would be helpful.

2) I spoke to a salesperson at Moneris US. He said what I needed was what Moneris calls a "hosted pay page". Users would be re-directed away from my site to a secure Moneris website to complete the transaction. He didn't seem to know about any other option. However, when I look at their US website, I see two options:

Quote
1) eSELECTplus Application Program Interface Interface (API) option provides you with control over the entire shopping process as it integrates easily into your web store. Moneris transaction APIs are available in a variety of different web programming languages and enable you to process transactions directly from your website.

2) eSELECTplus Secure Payment Page option is hosted by Moneris and seamlessly re-directs your customer to a secure payment page that allows them to pay for goods. There is no need to purchase an SSL certificate, and all cardholder information is captured and protected by Moneris.

I guess CiviCRM is set up to use the API (option 1). Anyone know how CiviCRM could be set up to use option 2, the hosted pay page? Anyone using Moneris with any degree of success?

So I tried a test conference registration from my development site, jumped through all the hoops (except hacking the core as described in the wiki) and ended up with this error

Quote
Payment Processor Error message
: 9002:Invalid currency selection, must be $CAD
9002:Invalid configuration:USD, you must use currency $CAD with Moneris

which seems to indicate that I should have hacked the core as suggested but then, it makes me think I can't use Moneris at all since we're a US non-profit -- we can't have all our pricing in Canadian dollars. Or, is that just the starting point and you override that in Settings/Localization by setting your local currency and CiviCRM/Moneris handle the conversion, etc?

Then again, I have no idea how the test would have gone if I'd done the hack since it looks like you can't test with any amount higher than $11 and to test my price sets, etc. the amounts are higher.

Oh well, any responses would be appreciated. I guess I'll just stick with PayPal Pro unless someone can tell me, other than recurring transactions, what benefits Moneris has if, in fact, I could use it with USD. Then I would take the time to play with the config file.

I know my questions border on the stupid. I'm the first to admit I am that. My hope is that documentation is written so that even someone like me can make some progress.

Chrys
« Last Edit: July 21, 2009, 02:05:14 pm by farmrchrys »

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Configuring Moneris Payment Processor
July 20, 2009, 06:19:29 pm
I think first up the answer is that the primary advantage of Moneris is that it appears to do recurring contributions. There may or may not be a pricing advantage too.

It does look like it was coded to do only Canadian currency - I can update the wiki.

It looks from the code that the currency is set in your Moneris account so removing lines

      if ($params['currencyID'] != 'CAD') {
         return self::error('Invalid currency selection, must be $CAD');
      }

MAY be enough
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: Configuring Moneris Payment Processor
July 20, 2009, 06:23:42 pm
Actually I note from the documentation that you set the currency in your settings

define( 'CIVICONTRIBUTE_DEFAULT_CURRENCY' , 'CAD' ); // you must change this from default USD

so that change is likely to work if you set your default currency to USD
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

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Configuring Moneris Payment Processor
July 20, 2009, 08:11:39 pm

actually the currency and most other settings have been moved out of the settings files and into the database. You can set it in the Localization settings

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Configuring Moneris Payment Processor
July 20, 2009, 08:20:43 pm
Lobo - does that mean # 2 should be removed entirely from this wiki page?

http://wiki.civicrm.org/confluence/display/CRMDOC/Moneris+Configuration+Guide
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

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Configuring Moneris Payment Processor
July 20, 2009, 09:04:24 pm

yes, all that info is now stored in the DB (for moneris and also other payment processors)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Configuring Moneris Payment Processor
July 20, 2009, 09:38:42 pm
OK - I think I edited it to be correct. (It says less now). If anyone can take a quick look...

I suspect that the code above (restricting the currency) should be removed.

farmrchrys  - if you do test it and it works for US currency without those lines please confirm back as I suspect that they should be patched out.
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

farmrchrys

  • I post occasionally
  • **
  • Posts: 92
  • Karma: 2
    • Spokane Moves to Amend the Constitution (under development)
  • CiviCRM version: CiviCRM 4.4.6
  • CMS version: Drupal 7.31
  • MySQL version: MySQL 5.5.37
  • PHP version: PHP 5.3.28
Re: Configuring Moneris Payment Processor
July 21, 2009, 12:25:41 am
Okay, I set up a simple donation contribution page with a $5 or $10 (USD) donation using Moneris as the payment processor. USD is set as the default currency in global settings. I found the lines:

Quote
$currencyID = $config->defaultCurrency;
        if ('CAD' != $currencyID) {
          return self::error('Invalid configuration:'.$currencyID.', you must use currency $CAD with Moneris'); //  Configuration error: default currency must be CAD
        }

in /sites/all/modules/civicrm/CRM/Core/Payment/Moneris.php and commented them out

Then I made a test transaction but ended up with this message:

Quote
Payment Processor Error message
: 9002:Invalid currency selection, must be $CAD

Different from before, but still indicating a no go situation when using USD. I looked all over their website, at the users' guide, the PHP API manual, etc. and found no reference to currency or USD. I'm going to call them in the morning and ask if moneris is strictly CAD.


Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Configuring Moneris Payment Processor
July 21, 2009, 01:03:45 am
Hmm - those weren't the lines I found - you've commented 60-62 on my install. The lines I spotted were 70-72

Note - you shouldn't comment out this line:

$currencyID = $config->defaultCurrency;
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

farmrchrys

  • I post occasionally
  • **
  • Posts: 92
  • Karma: 2
    • Spokane Moves to Amend the Constitution (under development)
  • CiviCRM version: CiviCRM 4.4.6
  • CMS version: Drupal 7.31
  • MySQL version: MySQL 5.5.37
  • PHP version: PHP 5.3.28
Re: Configuring Moneris Payment Processor
July 21, 2009, 05:44:28 am
Sorry Eileen,

It was late. Now that I've tested it without the lines you identified, it breaks at line 81 with the following error:
Quote
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /var/www/sites/all/modules/civicrm/CRM/Core/Payment/Moneris.php on line 81

Actually, I had left the final page of the contribution steps open as I edited the file. When I clicked "continue" (so button changed to "processing"), that's when I got the error. later, I started again from "test drive this contribution page" and immediately got the above error message -- didn't even progress to the form.

One step forward....
« Last Edit: July 21, 2009, 06:16:44 am by farmrchrys »

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Configuring Moneris Payment Processor
July 21, 2009, 12:14:09 pm
I'm guessing you didn't comment out the closing } for the first if statement: (
 
       $currencyID = $config->defaultCurrency;
//     if ('CAD' != $currencyID) {
//      return self::error('Invalid configuration:'.$currencyID.', you must use currency $CAD with Moneris');
//  Configuration error: // //      default currency must be CAD
//        }
    }

    function doDirectPayment( &$params ) {
      # make sure i've been called correctly ...
      if ( ! $this->_profile ) {
          return self::error('Unexpected error, missing profile');
      }
//      if ($params['currencyID'] != 'CAD') {
//        return self::error('Invalid currency selection, must be $CAD');
//      }
      /* unused params: cvv not yet implemented, payment action ingored (should test for 'Sale' value?)
      [cvv2] => 000
      [ip_address] => 192.168.0.103
      [payment_action] => Sale
      [contact_type] => Individual
      [geo_coord_id] => 1 */
      # this code based on Moneris example code #
      ## create an mpgCustInfo object
      $mpgCustInfo = new mpgCustInfo();

(NB I've added an extra line break before Configuration Error so it wouldn't wrap)
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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Configuring Moneris Payment Processor

This forum was archived on 2017-11-26.