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 »
  • Community Contributed Payment Processors »
  • PayPal Transaction Fees not being recorded
Pages: [1]

Author Topic: PayPal Transaction Fees not being recorded  (Read 2992 times)

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
PayPal Transaction Fees not being recorded
October 26, 2010, 03:46:58 pm
Hey all,
I asked this question at the end of a thread on a related issue and never heard anything so I figured I was asking in the wrong area. At any rate here goes:

We've got a pretty fantastic civiCRM/Drupal website put together which provides an organization's members the ability to apply/renew memberships and sign up for events. We're using a Canadian PayPal (Standard) account which is working correctly as far as we can see however, PayPal transaction fee's are not being recorded.

We modded civi so that we can pull a report that shows transaction fees (details in this thread). I've also looked in my transaction database table and the results are NULL for that column.  

Any ideas?

EDIT: We'rre using civiCRM 3.2.1 with Drupal 6.19.

Thanks,
Andrew
My CiviCRM Extension Workshop: https://github.com/awasson

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: PayPal Transaction Fees not being recorded
October 26, 2010, 04:06:36 pm
i just checked a recent transaction (2 days back) on civicrm.org and it has the total / transaction / net fees accurately recorded

this info is sent by paypal in its IPN. So most likely, there is some discrepancy between paypal's canadian IPN and US IPN code. In the US, this amount is passed in the POST as payment_fee

your best bet would be to debug the IPN call (u can resend it from paypal) and see what happening. The CiviCRM code is at:

CRM/Core/Payment/PayPalIPN.php

you will need pretty good civicrm/php skills to track this down

check:

https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables

seems like we should change the code to use the non-deprecated values, i.e. mc_fee instead of payment_fee

is your net_amount right?

lobo
« Last Edit: October 26, 2010, 04:13:39 pm by Donald 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

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: PayPal Transaction Fees not being recorded
October 26, 2010, 04:40:34 pm
Thanks Lobo,

Is there anything in particular we could have done to incorrectly set up the IPN in civiCRM or is it as simple as setting up the transaction method with the correct email address and being done with it?

Thanks again,
Andrew
My CiviCRM Extension Workshop: https://github.com/awasson

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: PayPal Transaction Fees not being recorded
October 26, 2010, 05:23:31 pm

u'll set it up right, its a bug with the civicrm integration code with paypal. so if u can investigate and submit a patch that would be great

a bit hard for us to ensure it works in all countries :)

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

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: PayPal Transaction Fees not being recorded
October 26, 2010, 05:41:22 pm
Alright... I'll have a look and report my findings.

Cheers,
Andrew
My CiviCRM Extension Workshop: https://github.com/awasson

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: PayPal Transaction Fees not being recorded
October 28, 2010, 01:52:34 pm
Hey Lobo,
I found several references to a variable called 'payment_fee' in Core/Payment/PayPalIPN.php and Core/Payment/PayPalProIPN.php. According to PayPal's API these have been depreciated in favour of mc_fee.

I've just changed the code on those pages (line 320 PayPalIPN.php and Line 345 PayPalProIPN.php) as follows and will run some tests.

Code: [Select]
        $input['fee_amount'] = self::retrieve( 'mc_fee'  , 'Money'  , 'POST', false );
My CiviCRM Extension Workshop: https://github.com/awasson

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: PayPal Transaction Fees not being recorded
October 28, 2010, 02:45:16 pm
Yup, that did the trick

There's the patch   ;D

Where can I submit it?
My CiviCRM Extension Workshop: https://github.com/awasson

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: PayPal Transaction Fees not being recorded
October 28, 2010, 04:33:40 pm

http://issues.civicrm.org/

please attach the patch and link to this forum topic

thanx

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

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: PayPal Transaction Fees not being recorded
October 28, 2010, 05:25:26 pm
Great. I did a search to see if it was an issue first and then created the issue with a description and resolution. Hopefully I did that correctly.

Cheers,
Andrew
My CiviCRM Extension Workshop: https://github.com/awasson

alanski

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 5
  • Cup of tea? Yes please
    • Joomkit
  • CiviCRM version: Version in post
  • CMS version: Joomla
  • MySQL version: 5.0
Re: PayPal Transaction Fees not being recorded
November 29, 2010, 10:46:03 am
Additional notes from UK:
https://cms.paypal.com/cms_content/GB/en_GB/files/developer/IPN_PHP_41.txt
mc_fee
is mc_gross

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: PayPal Transaction Fees not being recorded
November 29, 2010, 10:54:23 am
alanski,

mc_fee != mc_gross

  • mc_gross is the total amount that the consumer is charged
  • mc_fee is the transaction fee only

Andrew
My CiviCRM Extension Workshop: https://github.com/awasson

alanski

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 5
  • Cup of tea? Yes please
    • Joomkit
  • CiviCRM version: Version in post
  • CMS version: Joomla
  • MySQL version: 5.0
Re: PayPal Transaction Fees not being recorded
November 29, 2010, 10:56:28 am
Was looking here:https://cms.paypal.com/cms_content/GB/en_GB/files/developer/IPN_PHP_41.txt
Thanks

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: PayPal Transaction Fees not being recorded
November 29, 2010, 10:58:12 am
No problem.
Have a look here... There's a lot of info.

Andrew
My CiviCRM Extension Workshop: https://github.com/awasson

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute »
  • Community Contributed Payment Processors »
  • PayPal Transaction Fees not being recorded

This forum was archived on 2017-11-26.