vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Tracking payment amounts (https://vborg.vbsupport.ru/showthread.php?t=108643)

MPDev 02-21-2006 10:00 PM

Tracking payment amounts
 
By default, vBulletin has an amount and currency column in it's paymenttransaction table, but these fields are not used (reported as a "bug", was told these would be removed in future version).

However, a couple simple lines and with PayPal you can record both of these fields. This is critical for me as it allows me to track who paid how much.

In includes/paymentapi/class_paypal.php, find:

Code:

                $this->transaction_id = $this->registry->GPC['txn_id'];
and after add:

Code:

                // MDP
                $this->transaction_amt = $this->registry->GPC['mc_gross'];
                $this->transaction_cur = $this->registry->GPC['mc_currency'];

then in ./payment_gateway.php find:

Code:

                                $trans['state'] = $apiobj->type;
and after add:

Code:

                                // MDP
                                $trans['amount'] = $apiobj->transaction_amt;
                                $trans['currency'] = $apiobj->transaction_cur;

That's it! Now your paymenttransaction table will include the amount the user paid and the currency used.

This works with both 3.53 and the new 3.54 releases.

MPDev 02-22-2006 06:26 PM

Reserved.

amykhar 02-22-2006 06:57 PM

This, I think I shall like. Now, we just need to write up reports against the table and stick them in the admincp stats section.

MPDev 02-22-2006 07:02 PM

Exactly! I sent these small code changes into vB, but they responded that they would rather remove the columns in an update. Personally, this is a big deal for my site - we get tens of thousands of dollars in "donations" a year and knowing who gave how much is how we rate our members. It's also how I can track how much we've taken in versus how much we've spent.

Tracking amounts opens up a whole new area of reporting, tracking and promotions.

amykhar 02-22-2006 08:43 PM

I think they're making a big mistake dropping those columns. Also, it might be better if we rename them and rename them in your code to prevent legacy data from being dropped in an upgrade.

MorrisMcD 02-22-2006 10:07 PM

Quote:

Originally Posted by amykhar
I think they're making a big mistake dropping those columns. Also, it might be better if we rename them and rename them in your code to prevent legacy data from being dropped in an upgrade.


I agree with this

Reeve of shinra 02-23-2006 12:57 AM

I agree with all points in this thread

MPDev 02-23-2006 04:48 PM

Good idea, Amy; I'll extend my instructions in the near future to do just that.


All times are GMT. The time now is 07:19 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01123 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete