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) »
  • Can CCV code be optional w Authorize.net for admin processed transactions
Pages: [1]

Author Topic: Can CCV code be optional w Authorize.net for admin processed transactions  (Read 1972 times)

GregoryHeller

  • I post occasionally
  • **
  • Posts: 73
  • Karma: 3
Can CCV code be optional w Authorize.net for admin processed transactions
July 01, 2010, 08:56:37 am
I have a client who needs to be able to have administrators process transactions that users submit to them via paper donation cards.  THey do not collect CCV codes on these paper forms as you really are not supposed to collect a ccv code on paper (the point is that only someone with the card has the ccv code from what i understand about them).

They have set CCV to be an optional field with authorize.net, so if they go to authorize.net they can process transactions directly there without a ccv code. However with civicontribute the CCV code is required both for users and when administrators are attempting to run a transaction.

Is there a way to make CCV code OPTIONAL/NOT REQUIRED when an administrator uses civicontribute to process a credit card transaction?

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: Can CCV code be optional w Authorize.net for admin processed transactions
July 01, 2010, 09:30:18 pm

for 3.2.x and prior, your best bet would be to use the buildForm hook to remove the rule on CCV for an admin user on the new contribution form

if CivicActions would like to contribute code that makes this a UI driven admin functionality that would be awesome

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

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Can CCV code be optional w Authorize.net for admin processed transactions
August 05, 2010, 11:31:11 pm
I just ran into this as well. Here's some code for the buildForm hook that is working for me:

Code: [Select]
//unset cvv2 rule for backend forms
$config = CRM_Core_Config::singleton();
$frontend = $config->userFrameworkFrontend;
if ( $frontend != 1 ) {
unset($form->_required[7]);
unset($form->_rules['cvv2']);
}

the _required array just controls the insertion of the asterisk for visual clues (as far as I can see). not sure if the array key is fixed or if it could shuffle, so you may need to tweak that. the _rules array is what actually controls the requirement

also -- i'm Joomla user. the only thing that might be different on Drupal is I'm unsure how it handles (or if it handles) the userFrameworkFrontend value, since Drupal has less of a distinction between the two. if you can't isolate "backend" forms, you could still isolate based on the form name, e.g.

Code: [Select]
if ( $formName == 'CRM_Contribute_Form_Contribution' ) {...}
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Can CCV code be optional w Authorize.net for admin processed transactions

This forum was archived on 2017-11-26.