XFCoder :: On-Site Wallet

XFCoder :: On-Site Wallet [Paid] 1.0.3

No permission to buy ($30.00)
Wallet credit can be topped up with any payment profile you have set up (ACP => Setup => Payment profiles). XenForo ships with Stripe, PayPal, Braintree and 2Checkout, and additional payment providers are available through add-ons.

If any of these support paying by bank transfer, then that can be used to top up the wallet.
 
Implementing withdrawal functionality requires a significant amount of work and is currently not on the to-do list.

The primary use of the wallet is to allow you to receive money upfront from your users, which in turn provides them with a more convenient way to pay on the site.

Let's say a user regularly buys a lot of ads on your site. Instead of going through the payment process with a debit card each and every time, they can preload a larger amount and then conveniently make instant purchases whenever they need to.

You benefit since:
  • Convenient method of payment equals more sales.
  • You receive funds in advance.
  • You encourage loyalty, since users with prepaid credit are more likely to return and utilize it.
  • You can run statistics detailing filtered totals of sales or top ups right there in ACP.
 
Last edited:
I understand your point and I don't dispute the goodness of your add-on. But if you don't allow the user to withdraw their funds, the user isn't even encouraged to sell products or services in your space, especially if, as it appears, you want to allow people to exchange money on the community, which makes sense if, precisely, the user can then withdraw it. What sense does it make, for me, to sell for example a cell phone on the marketplace of your site if then I can only reuse that money to buy other stuff inside the site? At least at the beginning, the user must have the possibility to withdraw. Then when the community becomes much larger, then you can make it inconvenient to withdraw, for example by putting a higher tax on withdrawals. I don't know if I can explain myself well.
In any case, mine is just a suggestion and nothing more.
 
Yes your explanation is clear and makes sense :) I just wanted to take the opportunity to explain the purpose of the wallet. The wallet is intended for users who are buying on the site, rather than selling.

If you have a sellers community, you may want to look into add-ons like RM Marketplace which brings in a marketplace functionality and also offers the sellers withdrawal options.

Within that marketplace, you can enhance the buying experience by offering the on-site wallet (this add-on) for buyers to pay with.
 
Last edited:
gigipmc updated XFCoder :: On-Site Wallet with a new update entry:

1.0.2

Improvements:
  • Added credit display in the post user info block (postbit). To enable this feature:
    1. Check the "Show the wallet link on post user info block" option in the add-on options.
    2. Add "Credit balance" to the "Message user info elements" style property in ACP => Appearance => Style properties => Messages => User.
    3. Allow the relevant user groups to "View wallet credit amount of all users" in user group permissions. Note that setting this...

Read the rest of this update entry...
 
Holiday Sale! Buy On-Site Wallet and get another add-on for free: when you top up your wallet with a minimum of $35 you will receive a 50% bonus, which you can use to grab the 2 add-ons.
 
For developers wishing to interact with the wallet in their add-on:

Assume you want to create a new transaction type, for example "Sale proceeds", which credits the wallet when a user makes a sale.

Extend XFCoder\Wallet\Repository\Transaction:
PHP:
public function getTransactionTypes(): array
{
    return array_merge(parent::getTransactionTypes(), [
        'sale_proceeds'
    ]);
}

Create phrases describing your new transaction type:
xfcoder_wallet_transaction_type.sale_proceeds: "Sale proceeds"
xfcoder_wallet_transaction_type_x.sale_proceeds: "Sale proceeds"
The latter phrase can be used to provide a more detailed description of the transaction but that will require additional template modifications. You can provide a transaction note instead (see below).

Creating a transaction and crediting or debiting the user:
PHP:
$db = \XF::db();
$db->beginTransaction();

$transaction = \XF::em()->create(\XFCoder\Wallet\Entity\Transaction::class);

$transaction->bulkSet([
    'user_id' => $user->user_id,
    'type' => 'sale_proceeds',
    'amount' => $txAmount, // decimal(10,2)
    'note' => 'Optional note here'
]);

$transaction->save();

$user->fastUpdate(
    'xfcoder_wallet_credit',
    $user->xfcoder_wallet_credit + $txAmount
);

// optional user alert here

$db->commit();

Feel free to contact me for further clarifications.
 
Last edited:
Back
Top Bottom