Announcement

Collapse
No announcement yet.

Authorize.net Problems - Subscription Works Exactly Once and Then Breaks. Weird!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Authorize.net Problems - Subscription Works Exactly Once and Then Breaks. Weird!

    I ran 3.03 (with backported security patches) and recently upgraded to 3.53 with no errors.

    However, authorize.net subscriptions now don't work properly. It used to work fine before.

    First, a possible bug (or perhaps a clue to the problem?): In subscription manager, forums accessible are all listed as Yes ... when I change them to Default (not doing so gives users access to all forums - a security risk!), the change is reflected properly in the subscription table, but not in the subscription manager where all remain checked as Yes. Is this a bug? ... or an indication of a table problem somewhere in the db?

    Ok, now to the Authorize.net problem...

    First off, communications is solid with no errors (trans key, referral url, etc are are all set ... if a person enters a bad credit card number, etc the error is echoed back to VBulletin just fine in all tests ... so again, communications is solid between Authorize.net and the board.

    Furthermore, when I enter in a correct credit card, etc and complete the transaction the first time, it works perfectly with the user being directed back to VB and their membership upgraded.

    However, when I try again with another test user (or have other users try) the user is sent off to the authorize.net page (all hidden fields appear correct; none are missing) and all goes smoothly, BUT when the transaction completes, the user just gets a blank screen even though the transaction completes with no errors (authorize.net even acknowledges the transaction as ok and complete) ... again, the user just gets a blank screen and they are not upgraded; no user status change.

    Some more details...

    After first test:

    table paymentinfo

    paymentinfoid hash subscriptionid subscriptionsubid userid completed
    1 e44fdcb1e7951b9c815767d715fea397 1 0 3 0

    table paymenttransaction

    paymenttransactionid paymentinfoid transactionid state amount currency
    1 1 0 1 0

    And table subscriptionlog updates properly reflecting the users subscription status with correct start and end dates, etc.

    After second test (which always fails)

    table paymentinfo

    paymentinfoid hash subscriptionid subscriptionsubid userid completed
    1 e44fdcb1e7951b9c815767d715fea397 1 0 3 0
    2 2ad62fca41282446e19423ba5d11385f 1 0 40853 0

    * table paymenttransaction (remains unchanged from first test, and subsequent tests)

    paymenttransactionid paymentinfoid transactionid state amount currency
    1 1 0 1 0

    * table subscriptionlog doesn't not update in any way that I see.

    I even deleted and truncated the subscription table and re-entered the subscription data, and did similar with the paymentinfo and paymenttransaction tables ... no difference; still exact same problem.

    Provided a lot of information ... welcome comments, and more importantly suggestions of things to check / modify.

    Thank you in advance for your help.

    Ron

  • #2
    I have no experience with this, I will see if someone else from our staff could take a look.

    Comment


    • #3
      Ok that would be greatly appreciated.

      For others out there, has anyone else experienced a similar problem? -and if so, what did you do to make it work?

      What tables does the subscription system read / update?

      Thanks again

      Ron

      Comment


      • #4
        Does anyone know what tables / data I should be looking at that are related to the subscription system?

        Everything works ok upto the part where the user is returned from Authorize.net back to VBulletin ... user just gets blank screen.

        Surely, some others here use Authorize.net and can clue me in to what could possibly be wrong...

        Thanks in advance for any assistance.

        Ron

        Comment


        • #5
          Do access masks need to be enabled? ... currently I don't use any and table "access" is empty.

          Ron

          Comment


          • #6
            Why is it that even though I have no access masks set and furthermore have access masks turned off, that I still see a listing of forums in the Subscription manager?

            ... and why is it that all are set to "Yes"?

            ... and why is it that when I set them to "Default", that those changes are not reflected in the Subscription screen? ... they only ever show up as "Yes" even though the table is updated ... something is not right somewhere.

            Very frustrating to have something that worked perfectly in 3.03 break in 3.53 with no documentation / reference docs to assist in narrow down the problem.

            Ron

            Comment


            • #7
              The default for forums is "Default" which means they'll respect the permission system already in use, we dont have "No" since it would defeat the point of banning someone from a forum when they subscribe.

              Access masks do not need to be enabled.

              Can you tell me if you have a hash set for the post back data within your authorize.net account?

              Users should not get a blank screen if its going to the correct script, its payment_gateway.php?method=authorizenet

              Can you check your server logs to see if the authorize.net system is posting data back.
              Scott MacVicar

              My Blog | Twitter

              Comment


              • #8
                I understand the "default" terminology ...

                What I don't understand is why "Yes" is checked to begin with, and why when I check "default", the selections that I changed to "default" still remains checked as "yes" when I go back into the subscription manager later; yes, I'm saving the changes.

                Is a table corrupt / not being read properly? I'm really thinking this may be a clue to the problem, but not exactly sure how...

                The communications works ... the first test (after I've emptied the paymentinfo and paymenttransaction tables) always works perfectly.

                But after that, any subsequent subscriptions by any user never completes - they get through the whole payment process and then blank screen; error messages, like wrong card number, etc always passback and display correctly in all tests. I really hope this makes sense to you...

                I'll take a look at the logs for the post back data and let you know what I find.

                Ron

                Comment


                • #9
                  The saga continues, but your suggestion to look at the post log is getting me closer to a solution, though I'm baffled ...

                  Test #1 WORKS (after clearing the paymentinfo and paymenttransaction tables) with the following

                  64.94.xxx.xxx - - [03/Feb/2006:02:10:28 -0500] "POST /payment_gateway.php?method=authorizenet HTTP/1.1" 200 8162 "-" "-"

                  Note the 8162 ... obviously much data is being returned, and all works as it should.

                  Test #2 FAILS

                  64.94.xxx.xxx - - [03/Feb/2006:02:14:46 -0500] "POST /payment_gateway.php?method=authorizenet HTTP/1.1" 200 13 "-" "-"

                  Note the 13 ... virtually no data is being returned.

                  Something is wrong in the form data and working to track down possibilities, but not exactly sure what I should be looking for ... any suggestions?

                  Ron

                  Comment


                  • #10
                    The form data on the authorize.net form is similar in both the failed and successful tests.

                    No fields are missing and all fields appear to be complete.

                    The transaction hash, sequence number, and time stamp all appear correct - they update in all tests and look as they should.

                    Ron

                    Comment


                    • #11
                      I guess everyone else using Authorize.net for subscriptions in 3.53 are having no problems based on the lack of response ... is that correct?

                      If so, then that suggests the problem is something specific to my site ...

                      However, if anyone else is experiencing similar problems, please post here.

                      Thanks

                      Ron

                      Comment


                      • #12
                        I've isolated the location of the problem, but still not sure the cause - hope someone here can shed some light as to what this code does in payment_gateway.php ...

                        All paid subscriptions tests get into this block below with no problems...

                        However, if the paymenttransaction table is empty, paid subscription works perfectly ... but if there's any data in paymenttransaction table it fails...

                        If I comment out the if (empty($transaction)) check, then paid subscriptions always work, but suspect that's likely not a good longterm solution ...

                        Specifically, what does that check do ... and what data should $transaction contain or not contain...?

                        Any help would be appreciated...

                        if ($apiobj->verify_payment())
                        {
                        // its a valid payment now lets check transactionid
                        $transaction = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "paymenttransaction WHERE transactionid = '" . $db->escape_string($apiobj->transaction_id) . "'");
                        if (empty($transaction))
                        {
                        /*insert query*/
                        $trans['transactionid'] = $apiobj->transaction_id;
                        $trans['paymentinfoid'] = $apiobj->paymentinfo['paymentinfoid'];
                        $trans['state'] = $apiobj->type;
                        $db->query_write(fetch_query_sql($trans, 'paymenttransaction'));
                        if ($apiobj->type == 1)
                        {
                        $subobj->build_user_subscription($apiobj->paymentinfo['subscriptionid'], $apiobj->paymentinfo['subscriptionsubid'], $apiobj->paymentinfo['userid']);
                        if ($apiobj->display_feedback)
                        {
                        $vbulletin->url = $vbulletin->options['bburl'] . '/payments.php';

                        eval(print_standard_redirect('payment_complete', true, true));
                        }
                        }
                        else if ($apiobj->type == 2)
                        {
                        $subobj->delete_user_subscription($apiobj->paymentinfo['subscriptionid'], $apiobj->paymentinfo['userid']);
                        }

                        }
                        if ($apiobj->type == 2)
                        {
                        $subobj->delete_user_subscription($apiobj->paymentinfo['subscriptionid'], $apiobj->paymentinfo['userid']);
                        }
                        }

                        Comment


                        • #13
                          Bump ... I've narrowed down the problem to a specific section of code that VB wrote ... all I'm asking is what does the if (empty($transaction)) check do? -and is commenting out (bypassing) the check a bad thing?

                          Any help would be greatly appreciated.

                          Ron

                          Comment

                          Loading...
                          Working...
                          X