Back to vBulletin 3 Articles

Tracking payment amounts
by MPDev 22 Feb 2006

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.

vblts.ru supports vBulletin®, 2022-2024