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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Tracking PayPal Transaction Fees
Pages: [1]

Author Topic: Tracking PayPal Transaction Fees  (Read 4161 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
Tracking PayPal Transaction Fees
September 17, 2010, 04:06:21 pm
I'm not sure if this has been covered in another topic and if so, please direct me but I wasn't able to find a record of it through several searches so here goes...

We are pretty much ready to launch a Drupal/civiCRM website that will manage membership and event fees using PayPal as the transaction processor. Before we go live, the accounts department would like to be able to track the transaction fee or service charge that PayPal takes from each transaction.

After quite a bit of sleuthing, I found some information on the PayPal API but I'm not sure this is relevant to the transaction time or after the fact. Link (1), Link (2)  

Does anyone have any information or insight on this?

Thanks,
Andrew
« Last Edit: September 17, 2010, 04:34:04 pm by awasson »
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: Tracking PayPal Transaction Fees
September 17, 2010, 04:40:28 pm
A little more looking around and I found a link to a civi file here called ContributionProcessor.php.

The transaction array has an entry for fee amount:
Code: [Select]
'transaction' => array(
                                     'amt'              => 'total_amount',
                                     'feeamt'          => 'fee_amount',
                                     'transactionid'    => 'trxn_id',
                                     'currencycode'     => 'currency',
                                     'l_name0'          => 'source',
                                     'ordertime'        => 'receive_date',
                                     'note'             => 'note',
                                     'is_test'          => 'is_test',
                                     'transactiontype'  => 'trxn_type',
                                     'recurrences'      => 'installments',
                                     'l_amt2'           => 'amount',
                                     'l_period2'        => 'lol',
                                     'invnum'           => 'invoice_id',
                                     'subscriptiondate' => 'start_date',
                                     'subscriptionid'   => 'processor_id',
                                     'timestamp'        => 'modified_date',
                                     ),


I'll keep looking around  ;D
My CiviCRM Extension Workshop: https://github.com/awasson

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Tracking PayPal Transaction Fees
September 17, 2010, 05:45:47 pm
CiviCRM does capture the PayPal fee amount (at least for US transactions) and stores it in the Fee Amount field (civicrm_contribution.fee_amount in the database). This field is visible when viewing contributions AND is included when you export contribution records (from Find Contributions search).
Protect your investment in CiviCRM by  becoming a Member!

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: Tracking PayPal Transaction Fees
September 17, 2010, 11:00:50 pm
Thanks Dave,

i Suppose the reason we're not seeing any options to report on that data is because all of our testing has been with the Dummy Processor (test drive). Is there any way that we can add that to the criteria of the Donor Report (Detailed), once we're actually tracking it? That's what the accounting folks will be using.

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

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Tracking PayPal Transaction Fees
September 18, 2010, 08:07:16 am
Andrew - Makes a lot of sense to include Fee Amount and Net Amount as optional display columns in that report (which also means they're available in the report export). It was a trivial change so I implemented for upcoming 3.2.4 release:

http://issues.civicrm.org/jira/browse/CRM-6836

If you want to patch your version, add these two lines after line 132 in CRM/Report/Form/Contribute/Detail.php
Code: [Select]
          'fee_amount'           => null,
          'net_amount'           => null,
Protect your investment in CiviCRM by  becoming a Member!

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: Tracking PayPal Transaction Fees
September 18, 2010, 11:27:27 am
Fantastic... Thanks Dave!

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: Tracking PayPal Transaction Fees
October 22, 2010, 11:42:50 am
Back on the topic of PayPal fees...
Is there any reason we wouldn't be able to track out PayPal fees? Do we need PayFlow Pro or is there something additional we need to do?

We are using a PayPal Standard account and everything apparently is working correctly but we aren't able to view the fee itself.

Any thoughts?

Thanks,
Andrew

[EDIT]: I just checked the table and the fields for the transaction fee are NULL so it's definitely not being recorded. 
« Last Edit: October 22, 2010, 11:47:50 am by awasson »
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: Tracking PayPal Transaction Fees
October 25, 2010, 09:52:35 am
Further (again) on the topic, I was looking through the civiCRM documention and found this page that discusses setting up IPN on the sandbox... Is it possible that the reason we aren't recording the transaction fee is because IPN isn't hooked up correctly?

I'm grasping at straws here as everything else appears to be working right.

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Tracking PayPal Transaction Fees

This forum was archived on 2017-11-26.