Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
Tracking payment amounts
MPDev's Avatar
MPDev
Join Date: Oct 2003
Posts: 885

 

Virginia
Show Printable Version Email this Page Subscription
MPDev MPDev is offline 02-21-2006, 10:00 PM

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.
Reply With Quote
  #2  
Old 02-22-2006, 06:26 PM
MPDev's Avatar
MPDev MPDev is offline
 
Join Date: Oct 2003
Location: Virginia
Posts: 885
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Reserved.
Reply With Quote
  #3  
Old 02-22-2006, 06:57 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 02-22-2006, 07:02 PM
MPDev's Avatar
MPDev MPDev is offline
 
Join Date: Oct 2003
Location: Virginia
Posts: 885
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 02-22-2006, 08:43 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 02-22-2006, 10:07 PM
MorrisMcD's Avatar
MorrisMcD MorrisMcD is offline
 
Join Date: Nov 2003
Location: Cincinnati, Ohio
Posts: 415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 02-23-2006, 12:57 AM
Reeve of shinra's Avatar
Reeve of shinra Reeve of shinra is offline
 
Join Date: Oct 2001
Location: NYC
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I agree with all points in this thread
Reply With Quote
  #8  
Old 02-23-2006, 04:48 PM
MPDev's Avatar
MPDev MPDev is offline
 
Join Date: Oct 2003
Location: Virginia
Posts: 885
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:16 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04409 seconds
  • Memory Usage 2,260KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete