Gift Credit

WalletPro gives customers two ways to gift wallet credit. A buyer can purchase a special "gift wallet credit" product that funds a recipient's wallet on payment, and a logged-in customer can send credit straight from their own balance using the Gift action on the My Account wallet dashboard. Both paths land the credit as a "Gift received" entry in the recipient's wallet.

Customer Facing Gift Product Wallet Balance Email Recipient Money-safe

Overview

WalletPro supports two distinct gifting paths, and both result in the recipient receiving wallet credit:

In both cases the recipient sees the credit as a Gift received entry in their wallet ledger, and the credit is part of their spendable wallet balance at checkout with no separate redemption step. Gifting is distinct from Redemption Codes (claimed with a code) and Milestone Rewards (granted automatically by spend thresholds).

ℹ️

Every credit and debit in both paths is written through WalletPro's single funds chokepoint and recorded in the wallet ledger. Balances are never written directly, which is what keeps the money moves auditable and safe to retry.

Path 1: Buying a Gift as a Product

This path turns a normal WooCommerce product into a "gift wallet credit" item. The buyer pays for it like any other product, and the value lands in the recipient's wallet once the order is paid.

Setting Up the Gift Product (Merchant)

Edit any product and, in the Product data > General panel, you will find three WalletPro fields:

Field Description
Gift wallet credit Checkbox that flags this product as a gift. When ticked, the gift fields appear on the product page for shoppers.
Gift minimum Lower bound for the gift amount. Leave at 0 (or blank) for no minimum.
Gift maximum (0 = no limit) Upper bound for the gift amount. 0 (or blank) means no maximum.

The buyer's chosen amount becomes the line price of the product, so the order total reflects exactly what the recipient will receive. If the buyer enters an amount outside the min/max band, WalletPro clamps it to the nearest bound rather than rejecting the order.

Buying a Gift (Shopper)

On a gift product page, the shopper sees these fields above the add-to-cart button:

The recipient email is shown in the cart and order so the buyer can confirm it before paying.

Fulfilment

When the order reaches a paid state (WalletPro listens on woocommerce_payment_complete and on the processing and completed order statuses), each gift line item is fulfilled:

Fulfilment is idempotent. Each gift line item is marked done before the credit is applied, so a duplicate payment hook or a cron retry can never fund the same gift twice.

Refunds

If a gift order is refunded (the order moves to the refunded status), WalletPro reverses what it delivered:

Developer Hook

After a gift line item is delivered, WalletPro fires an action so the email layer (or your own code) can notify the recipient:

add_action( 'walletpro_gift_fulfilled', function( $email, $amount, $order_id ) {
    // $email is the recipient address, $amount is a Balance, $order_id is the source order.
    // Send your own "you received a gift" message here.
}, 10, 3 );

Path 2: The Gift Action on the Wallet Dashboard

A logged-in customer can send credit straight from their own wallet balance to another customer. There is no purchase and no fee: the amount simply moves from the sender's wallet to the recipient's.

Where to Find It

On the My Account > Wallet page, an action bar sits at the top of the dashboard with four buttons: Add Funds, Gift, Transfer, and Statement. The Gift button jumps to the Send a gift form lower on the same page.

The Send a Gift Form

The form collects two fields:

The form is nonce-protected, and submission uses the Post/Redirect/Get pattern: after the gift is processed the page redirects back to the wallet dashboard, so refreshing the page cannot resend the gift. The outcome is shown as a notice on the dashboard.

Validation

Before any money moves, the request is gated by three pure rules, checked in this order:

Check Failure message
The recipient email resolves to an existing customer No customer was found with that email.
The recipient is not the sender You cannot send a gift to yourself.
The amount is greater than zero Please enter an amount greater than zero.

An unparseable amount is rejected up front with "Please enter a valid amount." If the sender's balance cannot cover the gift, the move is refused with "Your balance is not sufficient for this gift." and nothing is recorded.

How the Money Moves (Money-safe)

A wallet gift uses the same atomic, compensating pattern as a wallet transfer, but with no fee, no limit settings, and no extra confirmation step:

  1. The sender is debited first, through the single funds chokepoint. If the balance cannot cover the amount, the debit returns without recording or moving anything, and the customer sees the insufficient-balance message.
  2. The recipient is then credited with a Gift received ledger entry.
  3. If the credit leg fails (a rare database error after the debit already succeeded), the sender is compensated: the debited amount is credited back to them. The gift is all-or-nothing, so funds can never be lost or duplicated.
ℹ️

There is exactly one money path. The recipient is resolved to a user id at the WordPress boundary, and the debit/credit pair runs through the funds chokepoint. Balances are never written directly, which is what makes the compensation safe.

What Each Side Sees

The recipient's wallet ledger gains a Gift received entry described as "Gift from user #<sender>", increasing their spendable balance immediately. The sender's ledger shows the matching debit described as "Gift to user #<recipient>". The credited amount is ordinary wallet balance from then on and can be applied at checkout like any other funds.

Comparing the Two Paths

Gift product Wallet Gift action
Who initiates A buyer at checkout A logged-in customer from the wallet dashboard
Source of funds A paid WooCommerce order The sender's existing wallet balance
Recipient must have an account No (a held code is issued and auto-applies on registration) Yes (the email must resolve to an existing customer)
Future / scheduled delivery Yes, via optional delivery date and daily cron No, delivered immediately
Recipient ledger entry Gift received Gift received
Reversal Order refund claws back the credit or voids the held code Automatic compensation only if the credit leg fails