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) »
  • Create User and Duplicate Payment
Pages: [1]

Author Topic: Create User and Duplicate Payment  (Read 2415 times)

dandaman

  • Guest
Create User and Duplicate Payment
December 11, 2008, 07:47:51 am
I was having this problem in 2.1.1 of CiviCRM under Joomla 1.5.7 and after upgrading to 2.1.2 it seems to be a problem still.

When I create a contribution page that submits via Authorize.net, it works great.  However, if I try to add the ability for anonymous users to sign up for an account via that form, after they click "Make Contribution" to confirm it brings them back to the contribution form and includes an error at the top of the page.  The error says that it cannot submit a duplicate of the transaction.

When I look into Authorize.net and look up the transaction it references, that transaction was only created at the time I submitted the contribution.  In other words, what seems to be happening is that it submits the contribution twice, but Authorize.net's duplicate check catches it and therefore you never get the receipt page and the customer thinks it did not work.

On that same contribution page, if I do not check the box that says I want to create an account in my CMS, the contribution page works fine.  The contribution goes through, no errors are printed, and the visitor to the site gets a standard receipt page.

I tried looking into the code a bit and could not find any indication that it would try to process the payment twice, but I have to admit that my code reading for a huge codebase like this is a bit spotty (although I've been learning a lot looking through code).  Is there a better, working version of the code out there?

Thanks!

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: Create User and Duplicate Payment
December 11, 2008, 09:29:14 am

Can you change the following lines to CRM/Core/Payment/AuthorizeNet.php (line 67)

Code: [Select]
    function doDirectPayment ( &$params ) {

to

Code: [Select]
    function doDirectPayment ( &$params ) {
       require_once 'CRM/Core/Error.php;
       CRM_Core_Error::backtrace( 'backtrace', true );

It will write the stack trace to media/civicrm/upload/CiviCRM.log. If its making two submissions, we should see two backtraces. can you cut-n-paste the backtrace here

thnx

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

dandaman

  • Guest
Re: Create User and Duplicate Payment
December 11, 2008, 11:17:31 am
Yep, I've got a backtrace:

Code: [Select]
Dec 11 13:08:02  [info] $backtrace = /path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Payment/AuthorizeNet.php, backtrace, 69
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Contribute/BAO/Contribution/Utils.php, doDirectPayment, 156
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Member/BAO/Membership.php, processConfirm, 848
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php, postProcessMembership, 463
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Form.php, postProcess, 247
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/StateMachine.php, mainProcess, 166
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php, perform, 63
/path/to/web/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/path/to/web/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Controller.php, handle, 232
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php, run, 197
/path/to/web/components/com_civicrm/civicrm.php, invoke, 73
/path/to/web/components/com_civicrm/civicrm.php, civicrm_invoke, 24
/path/to/web/libraries/joomla/application/component/helper.php, require_once, 162
/path/to/web/includes/application.php, renderComponent, 124
/path/to/web/index.php, dispatch, 68

Dec 11 13:08:04  [info] $backtrace = /path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Payment/AuthorizeNet.php, backtrace, 69
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Contribute/BAO/Contribution/Utils.php, doDirectPayment, 156
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Member/BAO/Membership.php, processConfirm, 848
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php, postProcessMembership, 463
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Form.php, postProcess, 247
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/StateMachine.php, mainProcess, 166
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php, perform, 63
/path/to/web/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/path/to/web/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Controller.php, handle, 232
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php, run, 197
/path/to/web/components/com_civicrm/civicrm.php, invoke, 73
/path/to/web/components/com_civicrm/civicrm.php, civicrm_invoke, 24
/path/to/web/libraries/joomla/application/component/helper.php, require_once, 162
/path/to/web/includes/application.php, renderComponent, 124
/path/to/web/index.php, dispatch, 68

After hitting the "Make Contribution" button these two errors are generated and then it gives us back to the main form with this error:

Code: [Select]
Payment Processor Error message: 1:11 A duplicate transaction has been submitted.
I guess it could be that the first one was created when loading the page with confirmation information and then the second after I hit "Make Contribution" because I probably clicked through that page in a second or two.  Either way, that doesn't seem to be the way it should work and it only happens when the contribution page selects to Create a new Joomla account while contributing.

Thanks,

Dan

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: Create User and Duplicate Payment
December 11, 2008, 12:44:31 pm

can you also add below the backtrace

CRM_Core_Error::debug_var(  'Request Vars', $_REQUEST );

and cut-n-paste the output here. There will be credit card and personal information there, so please replace it with random strings.

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

dandaman

  • Guest
Re: Create User and Duplicate Payment
December 11, 2008, 03:22:33 pm
Here's the full output:

Code: [Select]
Dec 11 17:11:52  [info] $backtrace = /path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Payment/AuthorizeNet.php, backtrace, 69
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Contribute/BAO/Contribution/Utils.php, doDirectPayment, 156
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Member/BAO/Membership.php, processConfirm, 848
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php, postProcessMembership, 463
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Form.php, postProcess, 247
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/StateMachine.php, mainProcess, 166
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php, perform, 63
/path/to/web/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/path/to/web/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Controller.php, handle, 232
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php, run, 197
/path/to/web/components/com_civicrm/civicrm.php, invoke, 73
/path/to/web/components/com_civicrm/civicrm.php, civicrm_invoke, 24
/path/to/web/libraries/joomla/application/component/helper.php, require_once, 162
/path/to/web/includes/application.php, renderComponent, 124
/path/to/web/index.php, dispatch, 68

Dec 11 17:11:52  [info] $Request Vars = Array
(
    [option] => com_civicrm
    [task] => civicrm/contribute/transact
    [qfKey] => XXXXXXXXX
    [_qf_default] => Confirm:next
    [first_name] => XXX
    [last_name] => XXXXX
    [street_address-Primary] => XXXXXXXXX
    [city-Primary] => XXXXXXXXX
    [state_province-Primary] => XXXXXXXXX
    [postal_code-Primary] => XXXXXXXXX
    [phone-Primary-Phone] => XXXXXXXXX
    [country-Primary] => XXXXXXXXX
    [preferred_communication_method] => Array
        (
            [2] => 1
        )

    [custom_1] =>
    [birth_date] => Array
        (
            [M] =>
            [d] =>
            [Y] =>
        )

    [__utma] => XXXXXXXX.XXXXXXXXXX.XXXXXXXXXX.XXXXXXXXXX.XXXXXXXXX.XXX
    [__utmz] => XXXXXXXXX.XXXXXXXXXX.XX.X.utmccn=(referral)|utmcsr=fcci.org|utmcct=/|utmcmd=referral
    [jfcookie] => Array
        (
            [lang] => en
        )

    [088eccXXXXaf1b6a8ebfe1d477f045d] => 58e88faf065dd1XXXX49ba82c1431f3e
    [6a1d8331e2f1240c9c2XXXXea684d2fd] => 8c3feXXXXf12fc4e149b66cf94e27fc0
    [Itemid] =>
    [IDS_request_uri] => /index.php?option=com_civicrm&task=civicrm/contribute/transact&
    [IDS_user_agent] => Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4
)


Dec 11 17:11:54  [info] $backtrace = /path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Payment/AuthorizeNet.php, backtrace, 69
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Contribute/BAO/Contribution/Utils.php, doDirectPayment, 156
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Member/BAO/Membership.php, processConfirm, 848
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php, postProcessMembership, 463
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Form.php, postProcess, 247
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/StateMachine.php, mainProcess, 166
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php, perform, 63
/path/to/web/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/path/to/web/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Controller.php, handle, 232
/path/to/web/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php, run, 197
/path/to/web/components/com_civicrm/civicrm.php, invoke, 73
/path/to/web/components/com_civicrm/civicrm.php, civicrm_invoke, 24
/path/to/web/libraries/joomla/application/component/helper.php, require_once, 162
/path/to/web/includes/application.php, renderComponent, 124
/path/to/web/index.php, dispatch, 68

Dec 11 17:11:54  [info] $Request Vars = Array
(
    [option] => com_civicrm
    [task] => civicrm/contribute/transact
    [qfKey] => XXXXXXXXX
    [_qf_default] => Confirm:next
    [first_name] => XXXXXXXXX
    [last_name] => XXXXXXXXX
    [street_address-Primary] => XXXXXXXXX
    [city-Primary] => XXXXXXXXX
    [state_province-Primary] => XXXXXXXXX
    [postal_code-Primary] => XXXXXXXXX
    [phone-Primary-Phone] => XXXXXXXXX
    [country-Primary] => XXXXXXXXX
    [preferred_communication_method] => Array
        (
            [2] => 1
        )

    [custom_1] =>
    [birth_date] => Array
        (
            [M] =>
            [d] =>
            [Y] =>
        )

    [__utma] => XXXXXXXX.XXXXXXXXXX.XXXXXXXXXX.XXXXXXXXXX.XXXXXXXXX.XXX
    [__utmz] => XXXXXXXXX.XXXXXXXXXX.XX.X.utmccn=(referral)|utmcsr=fcci.org|utmcct=/|utmcmd=referral
    [jfcookie] => Array
        (
            [lang] => en
        )

    [088eccXXXXaf1b6a8ebfe1d477f045d] => 58e88faf065dd1XXXX49ba82c1431f3e
    [6a1d8331e2f1240c9c2XXXXea684d2fd] => 8c3feXXXXf12fc4e149b66cf94e27fc0
    [Itemid] =>
    [IDS_request_uri] => /index.php?option=com_civicrm&task=civicrm/contribute/transact&
    [IDS_user_agent] => Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4
)

You said there was credit card information in there, so I masked various things including the encrypted text with "X".  I hope this helps!

Thanks,

Dan

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: Create User and Duplicate Payment
December 11, 2008, 07:22:10 pm

unfortunately that does not seem to reveal any more clues :( Seems like there are two post requests made approx 2 seconds apart. Do you have any javascript / ajax widgets on that page? Are you using the standard joomla registration component? any registration plugins enabled?

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

dandaman

  • Guest
Re: Create User and Duplicate Payment
December 12, 2008, 06:18:38 am
Lobo,

No, it's the standard code, I'm pretty sure.  There's no AJAX either, I don't think.  I do have the code installed that looks for a valid CivCRM membership for users who login, but that's about it.  I mean, you can look at the page here:  http://www.fcci.org/index.php?option=com_civicrm&Itemid=60&lang=en

Thanks,

Dan

dandaman

  • Guest
Re: Create User and Duplicate Payment
December 17, 2008, 11:54:33 am
I'm still trying to figure out what the problem is.  I created a contribution page that does not take live payments via a contribution system.  However, I also include a profile that allows for visitors to create an account.  I was able to go through most of it, but again after the confirmation page, it does end up with an error.  After that screen, when in Internet Explorer, it redirects me to the page,
Code: [Select]
https://www.fcci.org/index.php?option=com_civicrm&task=civicrm/contribute/transact&, which only shows an "Internet Explorer cannot display this webpage" message.  You can view this contribution page here:
https://www.fcci.org/index.php?option=com_civicrm&task=civicrm/contribute/transact&reset=1&id=7

When I tried to complete the contribution process in FireFox, FireFox 3 asked me if I wanted to open the "index.php" file or save it, and when I do that, I get a blank file.

Is anyone else using this account creation feature?  I know it's new, is it possible this is some sort of bug?  Is there anything I can do to help?  I did have the CiviCRM plugin that makes it so that Joomla accounts can only be created/logged in if they're associated with a CiviCRM contact, but I disabled that plug-in for testing and it did not seem to change anything.

Thanks,

Dan


dandaman

  • Guest
Re: Create User and Duplicate Payment
December 19, 2008, 11:40:57 am
If anyone has any thoughts on this or have had any success using this Create Membership option under Joomla, I would like to hear about it.  In the meantime, I will keep looking into these issues and trying to formulate a workaround.

Thanks,

Dan

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Create User and Duplicate Payment

This forum was archived on 2017-11-26.