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) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Authorize.Net eCheck.Net
Pages: [1]

Author Topic: Authorize.Net eCheck.Net  (Read 550 times)

davidbarratt

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: Multiple
  • CMS version: Multiple
  • MySQL version: Multiple
  • PHP version: Multiple
Authorize.Net eCheck.Net
June 24, 2014, 02:26:50 pm
I'm working an extension that enables support for Authorize.Net eCheck.Net

https://github.com/donordepot/com.donordepot.authnetecheck

I noticed that whenever you processes a recurring payment, it appears that the payment_instrument_id is hard coded to 1 (Credit Card) in several places, where I need it to be set to 5 (EFT).

Is there any way to change this easily? or do you think it's safe to modify the last contribution added?

Thanks!

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: Authorize.Net eCheck.Net
June 24, 2014, 05:07:30 pm
Hi,

I'm not familiar with Authnet eCheck, how does the notification for recurrent payments happen? Does CiviCRM start the process, or Authtnet sends a notification/IPN?

Did you see the hardcoded payment_instrument_id in the CiviCRM core code? If yes, where?

Thanks for posting :)
Mathieu (bgm on IRC)
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

davidbarratt

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: Multiple
  • CMS version: Multiple
  • MySQL version: Multiple
  • PHP version: Multiple
Re: Authorize.Net eCheck.Net
June 25, 2014, 05:09:20 am
Mathieu,

eCheck.Net uses the same API as Authorize.Net API (AIM Method).

It also uses the same Recurring Payment API (ARB).

If you look at my code, you'll see that I just extended the existing AutheorizeNet Class:
https://github.com/donordepot/com.donordepot.authnetecheck/blob/develop/CRM/Core/Payment/AuthNetEcheck.php

Although, I did have to override/modify the payment form template (to add the Bank Account Type field):
https://github.com/donordepot/com.donordepot.authnetecheck/blob/develop/templates/CRM/Core/BillingBlock.tpl

I also had to override/modify the ARB Template (to add the Bank Account fields):
https://github.com/donordepot/com.donordepot.authnetecheck/blob/develop/templates/CRM/Contribute/Form/Contribution/AuthorizeNetARB.tpl

I found the hard coded values (as of version 4.2.16) here:
https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/Contribution/Confirm.php#L128
and here:
https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/Contribution/Confirm.php#L1486

I believe it's one of these values that is forcing the eCheck to be payment_instrument_id to be 1 rather than what I need it to be which is 5. I guess what I could do is just query for the last inserted one from my class (with the same values from the submitted form) and update it, but I feel like there should probably be a hook there, since right now it looks like the only kind of recuring contributions you can add are Credit Card ones. :/

davidbarratt

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: Multiple
  • CMS version: Multiple
  • MySQL version: Multiple
  • PHP version: Multiple
Re: Authorize.Net eCheck.Net
June 25, 2014, 05:37:27 am
or even better is if it would first look in the $params array before putting the hard value.

Thanks!

davidbarratt

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: Multiple
  • CMS version: Multiple
  • MySQL version: Multiple
  • PHP version: Multiple
Re: Authorize.Net eCheck.Net
June 25, 2014, 06:23:42 am
I discovered that the contribution id's come back in the params array, so I was able to update the database accordingly:
https://github.com/donordepot/com.donordepot.authnetecheck/blob/develop/CRM/Core/Payment/AuthNetEcheck.php#L53

Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Authorize.Net eCheck.Net

This forum was archived on 2017-11-26.