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) »
  • Payment Processor Error message dumps user to Event Info page
Pages: [1]

Author Topic: Payment Processor Error message dumps user to Event Info page  (Read 2952 times)

jrosen

  • Guest
Payment Processor Error message dumps user to Event Info page
July 25, 2009, 01:51:30 pm
When registering for an Event via Online Registration, if there is a Payment Processor Error, the user is dropped off at the Event Information page with the Payment Processor Error at the top of the page:

Code: [Select]
status
    Payment Processor Error message
    : 1:2 This transaction has been declined.


It looks like an information message and is not treated by the CiviCRM system as an Error.  The little "i" icon is to the left of the message.

The behavior I would expect is to show the message and put the user back at the Registration page where they can fix their credit card info and resubmit.

The payment processor used is Authorize.Net

If anyone has any insights as to why this behavior occurs and how I can fix it, please let me know.

Thanks.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Payment Processor Error message dumps user to Event Info page
July 26, 2009, 02:05:06 pm
The error is probably to do with the cancel_url being incorrect. I can't tell at the moment whether that is an Authorize.net setting or one that is coded in (as I'm not at my normal PC)
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

jrosen

  • Guest
Re: Payment Processor Error message dumps user to Event Info page
July 26, 2009, 03:29:02 pm
I took a deeper look into the code and found this in 'CRM\Event\Form\Registration\Confirm.php':


Lines 514-517:
Code: [Select]
                if ( is_a( $result, 'CRM_Core_Error' ) ) {
                    CRM_Core_Error::displaySessionError( $result );
                    CRM_Utils_System::redirect( CRM_Utils_System::url( 'civicrm/event/info', "id={$this->_eventId}&reset=1" ) );
                }

I have changed Lines 514-517 to:
Code: [Select]
                if ( is_a( $result, 'CRM_Core_Error' ) ) {
                    CRM_Core_Error::displaySessionError( $result );
                    CRM_Utils_System::redirect( CRM_Utils_System::url( 'civicrm/event/register', "id={$this->_eventId}" ) );
                }

And it seems to work as I expect... The user gets redirected to the Event Registration page and the form fields still retain the previously submitted values, so they can be changed. 

The error message at the top is not very descriptive and currently just says: "This transaction has been declined.", but that is set inside the Authorize.Net processing code.  I am going to take a closer look and see if I can inspect the Authorize.Net response stream to extract and set a better error message.

Once I have all these changes completed and tested, I will submit as a patch in JIRA.

Eileen, if you see any flaws in my plan or reasons why I shouldn't make the above changes, please let me know.  I think you are much more familiar with the CiviCRM Core codebase than I am.

Thanks,
Jason

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Payment Processor Error message dumps user to Event Info page
July 26, 2009, 03:44:20 pm
I have to agree with you that returning to the register page is more logical than the info page.

Re the message. Some messages come from the processor & others come from Civi code and some are returned from the processor in a field while others are interpreted from the return values of the processor. Mostly you don't want to put too much effort into them but something that you expect an end user to see on a properly configured site (like a declined transaction) might be worth improving.

Authorize.net will probably have a raft of response codes depending on the type of failure and will also return a message of some sort - like the one that is being displayed
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

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Payment Processor Error message dumps user to Event Info page
July 27, 2009, 01:45:59 pm
Jason - regarding the redirect URL - I agree as well - should return to registration form. I've filed an issue to fix this for 2.2.8:

http://issues.civicrm.org/jira/browse/CRM-4794
Protect your investment in CiviCRM by  becoming a Member!

abelcreative

  • Guest
Re: Payment Processor Error message dumps user to Event Info page
September 02, 2009, 01:05:27 pm
I'm getting a very similar error after upgrading - any donation from the basic donation form gives this error:

Payment Processor Error message
1:250 This transaction has been declined.

Client is using Authorize.net, worked before upgrade (except on recurring transactions)

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: Payment Processor Error message dumps user to Event Info page
September 02, 2009, 01:59:29 pm

that is a processor (auth.net) errror. you might want to get more details for that error code which might give you a clue as to why its failing

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: Payment Processor Error message dumps user to Event Info page
September 02, 2009, 03:07:13 pm
Hi,.

I would note that this thread is about the CiviCRM behaviour when a transaction is declined. The reason for the transaction being declined is a separate issue and searching for that error code (250) on the Authorize.net site might tell you why it was declined.

Eileen
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) »
  • Payment Processor Error message dumps user to Event Info page

This forum was archived on 2017-11-26.