Pro/Wallet Credit
Wallet prize credit
Automatically credit the winner's store wallet with the prize amount when a store-credit raffle completes, instead of generating a WooCommerce coupon. Supports TeraWallet and WooWallet.
Requires: TeraWallet or WooWallet installed and active. The module shows an admin notice when enabled without a supported wallet plugin.
Enabling
- Install and activate TeraWallet or WooWallet.
- Go to WooCommerce → Settings → Raffle → Pro Modules and enable Wallet Prize Credit.
- Edit a raffle product, set the prize type to Store Credit.
- The wallet credit fields appear in the PRO Features section automatically.
How it works
- A raffle draw completes and the winner is selected.
- The wallet module hooks into
rfwc_winner_selected(before the standard prize fulfillment) and checks if the prize type is store credit. - The prize amount is credited directly to the winner's wallet balance.
- A transaction note is recorded in the wallet ("Raffle prize for [Product Name] — Ticket #123").
- An entry is added to the raffle log table for audit purposes.
- The winner record is updated with a
WALLET-TERAWALLET(orWALLET-WOOWALLET) marker to prevent double-crediting.
Per-product settings
These fields appear on the raffle product edit screen under PRO Features when the prize type is "Store Credit".
| Setting | Description |
|---|---|
| Credit to wallet | Per-product toggle. Defaults to enabled when the module is active. Uncheck to fall back to coupon-based credit for this specific raffle. |
Supported wallet plugins
| Plugin | Detection method |
|---|---|
| TeraWallet | Checks for the woo_wallet() function. Credits via woo_wallet()->wallet->credit(). |
| WooWallet | Checks for the WooWallet class. Credits via WooWallet::instance()->wallet->credit(). |
Safety mechanisms
| Scenario | Handling |
|---|---|
| No wallet plugin active | Admin notice displayed. No product fields registered. Falls back to coupon. |
| Winner is a guest | Falls back to coupon-based store credit. |
| Wallet credit fails | Returns false from the filter, letting the free plugin create a coupon as fallback. |
| Module disabled after prizes awarded | Previously awarded wallet credits are unaffected. Future prizes use coupons. |
Interaction with other systems
| System | Behaviour |
|---|---|
| Reward Points (WooRewards) | Independent. Points are virtual loyalty currency; wallet credit is real store balance. |
| Recurring Raffle | Each recurring copy inherits the wallet credit setting from its source product. |
| Refunds | Wallet credits are final. Refunding the original ticket order does not reverse the wallet credit. Handle wallet reversals through the wallet plugin's admin interface. |
Developer hooks
The module hooks into rfwc_winner_selected at priority 10 (before prize fulfillment at 20) and also filters rfwc_award_store_credit as a secondary path.
An action fires after a successful wallet credit:
do_action(
'rfwc_pro_wallet_credited',
$user_id, // int — winner's user ID.
$credit_amount, // float — amount credited.
$ticket, // RFWC_Ticket — winning ticket.
$raffle, // RFWC_Product_Raffle — the raffle product.
$wallet // string — 'terawallet' or 'woowallet'.
);
To prevent wallet crediting for a specific raffle programmatically, set the _rfwc_pro_wallet_credit_enabled post meta to no on that product.