CRM-5343 Fix bin/ContributionProcessor.php to consider fee amounts for Google Checkout transactions

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.1.4
    • Component/s: None
    • Labels:
      None

      Description

      Note transaction fee information is now available in the Google Checkout API - http://googlecheckout.blogspot.com/2009/09/transaction-fee-information-now.html.

        Attachments

          Activity

          [CRM-5343] Fix bin/ContributionProcessor.php to consider fee amounts for Google Checkout transactions
          Yashodha Chaku added a comment -

          assigning for 3.1 verification

          Karl Fogel added a comment -

          I think this fixes CRM-3046 as well...

          Karl Fogel added a comment -

          In our CiviCRM 3.1.3 installation (at QuestionCopyright.org) this issue is not fixed. For example, we pulled in a transaction for $5.00 from Google Checkout, and the Edit Contribution page for that contribution shows a blank for Fee Amount (as before).

          Are you sure this is fixed/verified?

          Happy to provide more reproduction data if you need, though confidentally (since we have to protect the identities of our donors, of course).

          Karl Fogel added a comment -

          See also CRM-3531 (which probably can be closed when this issue is really fixed, since Google Checkout is AFAIK the only payment processor whose fees are/were not taken into account... or are there others?)

          David Greenberg added a comment -

          Deepak - pls followup w/ Karl on this.

          Deepak Srivastava added a comment -

          Karl, i remember fixing and verifying it for 3.0 -
          http://fisheye2.atlassian.com/changelog/CiviCRM?cs=24842
          http://fisheye2.atlassian.com/changelog/CiviCRM?cs=24843

          Above code is also present in 3.1 and my quick test shows that it does work for bin/ContributionProcessor.php script.

          CRM-3531 talks about online/offline transactions ( and not ContributionProcessor.php script ) which still uses the old code and therefore has no support adding "fee amount" or "net amount".

          Karl Fogel added a comment -

          Deepak, I did some more testing on this today.

          First, I found a way to test it without having to make repeated $5 contributions via Google Checkout . I just go into CiviCRM and delete the contribution from "Verena-bt7d5btavr5@checkout.google.com". Then I re-pull from Google Checkout – the same transaction is fetched because CiviCRM doesn't know about it anymore.

          But it's still not finding the fee. I've kept your debugging lines in the code, and I put the results up at the same URL we were using before (I can send you an IRC transcript if you need).

          Based on the Google Checkout API documentation (http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Tag_Reference.html) it seems to me that "latest-charge-amount" is probably not what we want: that's just the total amount charged for the whole transaction, right? It looks like "latest-charge-fee" (or some subtag thereof) is correct... I don't know why the old code wasn't working, and I'm not expert in the CiviCRM code, I'm just basing this on reading Google's documentation.

          I'll attach the patch I'm currently running with.

          Karl Fogel added a comment -

          Patch to bin/ContributionProcessor.php and CRM/Contribute/BAO/Contribution/Utils.php that kfogel is currently running with, as per IRC conversation with Deepak today.

          Deepak Srivastava added a comment -

          Karl, do you have "Notifications must include information about transaction fees" option checked in "Google Checkout" >> Settings >> Integration tab ? Thats a required option to make xml response include 'latest-charge-fee' tag in the response.

          In case you don't, test it with old code (without the patch) after you have set the option.

          Karl Fogel added a comment -

          I turned on "Notifications must include information about transaction fees" and now it works perfectly, thank you.

          I noticed these other options are also off by default, though:

          Provide the first name, last name and full name of the buyer and order recipient in separate fields in the new order notification.
          Notifications must include any amounts involving a Google promotion.
          Return the buyer's ship-to phone number in the new order notification.
          Return the buyer's billing phone number in the new order notification.
          Require notification acknowledgments to specify the serial number of the notification.
          Merchant calculations (tax and shipping) callback messages must include information about co-funded promotions.

          Are any of them useful to turn on for CiviCRM?

          Deepak Srivastava added a comment -

          For first_name and last_name there is a issue in the queue - http://issues.civicrm.org/jira/browse/CRM-6039.
          And other options are not supported yet.

            People

            • Assignee:
              Deepak Srivastava
              Reporter:
              Deepak Srivastava

              Dates

              • Created:
                Updated:
                Resolved: