=== Wallet & Store Credit for WooCommerce – Cashback, Top-Up, Refund to Wallet ===
Contributors: devdiggers
Plugin URI: https://devdiggers.com/product/woocommerce-wallet-management/
Author: DevDiggers
Author URI: https://devdiggers.com/
Tags: store credit, woocommerce wallet, cashback, digital wallet, wallet
Requires at least: 6.2
Tested up to: 7.0.3
Requires PHP: 7.4
WC requires at least: 9.0
WC tested up to: 11.0.0
Stable tag: 1.0.1
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html

WooCommerce wallet and store credit plugin. Customers top up, earn cashback, pay at checkout with their balance, and get refunds as credit.

== Description ==

Give every WooCommerce customer a wallet they can top up, spend at checkout, and check from My Account. The wallet works as a normal WooCommerce payment gateway, so a customer with a balance pays for an order in one click, with no card details to type again.

You control the money side from the WordPress admin. Credit or debit any customer, import store credit in bulk from a CSV file, run cart cashback rules, and watch every balance and transaction from one dashboard. When you refund an order, the amount goes back to the customer wallet, so a return turns into store credit instead of a manual payout and another gateway fee.

**[Wallet & Store Credit for WooCommerce](https://devdiggers.com/product/woocommerce-wallet-management/)** suits stores that want store credit instead of refunds, a cashback program that keeps money in the shop, prepaid balances for repeat buyers, or a faster checkout for regulars. No monthly SaaS fee and no cut of your sales. Everything runs on your own site and your own database.

= Quick Links =

* [View Free Demo](https://demo.devdiggers.com/woocommerce-wallet-free/)
* [View Pro Demo](https://demo.devdiggers.com/woocommerce-wallet/)
* [Full Documentation](https://docs.devdiggers.com/woocommerce-wallet-management/)
* [Free vs Pro Comparison](https://devdiggers.com/product/woocommerce-wallet-management/#free-vs-pro/)
* [Upgrade to Pro](https://devdiggers.com/product/woocommerce-wallet-management/)
* [Contact Support](https://devdiggers.com/contact/)

= What you get in the free plugin =

* Wallet payment gateway for the classic checkout and the block based Cart and Checkout
* Wallet top-up through a hidden top-up product, paid with the payment gateways you already accept
* Cart cashback rules that reward wallet money based on the order amount
* Store credit page inside WooCommerce My Account with balance and transaction history
* Customer to customer money transfer by email address
* Registration credit for new customers
* Manual credit and debit for any customer, plus bulk credit and debit by CSV import
* Order refunds credited back to the wallet automatically
* Wallet credit and debit emails with editable templates
* Setup wizard, admin dashboard with charts, and a full transaction log
* Works with WooCommerce High-Performance Order Storage (HPOS)

= How the WooCommerce wallet works =

A hidden "Wallet Topup" product is created when you activate the plugin. The customer opens the wallet page in My Account, types an amount, and checks out with any payment gateway you allow. Once that top-up order reaches the status you picked, the balance lands in the wallet.

From then on the wallet shows up as a payment method at checkout and the balance pays for the order. Every credit and debit is written to a transaction record the customer can read, so nobody has to email you asking where their store credit went.

= Wallet top-up and checkout payments =

Customers fund the wallet first, then spend it at checkout like any other payment method.

* Turn the wallet on or off for the whole store from one setting
* Wallet payment gateway so customers pay for orders with their balance
* Choose the order status that confirms a top-up, with Completed recommended
* Restrict top-ups to specific payment gateways, so wallet money is only funded the way you want
* Send the customer straight to checkout after a top-up is added to the cart
* Give new customers a signup credit the moment they register

= Cashback rewards =

Cashback pays customers in wallet money instead of a coupon code, so the reward comes back to your store as a second order.

* Cart cashback rules with amount ranges, so a bigger order can earn a bigger reward
* Fixed or percentage cashback per rule, and every rule can be switched on or off
* Maximum cashback per order and a minimum order value before cashback applies
* Option to leave sale products out of the cashback calculation
* Cashback messages on the cart, checkout, view order and order received pages
* Message color, border and font size are configurable, so the notice fits your theme

Cashback is recorded as pending when the order is placed and credited when the order completes. If the order is later cancelled or refunded, the cashback is taken back.

= Customer wallet page in My Account =

Customers handle everything from a wallet tab inside WooCommerce My Account. The endpoint slug and the menu title are yours to set, and the default is `my-wallet`.

* Balance card with available balance and today's credit and debit totals
* Add money form where the customer enters the top-up amount
* Send money to another customer by email, with an optional note
* Transaction history with AJAX pagination, so a long history still loads fast
* Theme color, icons, card colors and table colors are set from the Layout tab

Shortcodes are included, so the wallet can live on any page instead of only in My Account:

`[ddwcwm_wallet_balance_shortcode]` - the wallet balance value on its own
`[ddwcwm_wallet_balance_layout_shortcode]` - the styled balance card
`[ddwcwm_wallet_operations_shortcode]` - the add money and send money actions
`[ddwcwm_wallet_balance_operations_shortcode]` - balance card and actions together
`[ddwcwm_wallet_transactions_shortcode]` - the transaction history table

Every shortcode tag can be renamed under **Wallet > Configuration > Shortcodes** if you prefer your own naming.

= Store credit management for admins =

Everything sits under the **Wallet** menu in WordPress admin.

* Dashboard with available balance, wallet spent, total transactions, total users and cashback awarded
* Transaction trend and transaction type charts, recent activity, and a top customers list
* Users screen listing every customer with their current wallet balance
* Manual Adjustment screen to credit or debit one customer with a note
* CSV import to credit or debit many customers at once, with a sample file included
* Transactions screen with the full ledger, filters and search
* Cashback Rules screen for building cart amount ranges
* Setup wizard that walks through the wallet, cashback and reward settings after activation

= Wallet emails =

Wallet emails run through WooCommerce, so they use your store template and your existing email settings.

* Wallet credited and wallet debited notifications sent to the customer
* Editable heading, subject and message for each notification
* Editable reason labels for registration credit, cart cashback, refund, top-up and received transfers, so the customer reads plain language instead of internal codes
* Templates can be overridden from your theme like any other WooCommerce email

= Compatibility and developer notes =

* Declared compatible with WooCommerce High-Performance Order Storage (HPOS)
* Declared compatible with the block based Cart and Checkout, with a registered wallet payment method
* Transactions and cashback rules live in their own database tables, so wallet history does not bloat post meta
* Action and filter hooks through the wallet layout, the cashback calculation and the transaction flow
* Translation ready with the included `.pot` file, and works with WPML, Polylang and Loco Translate
* Object oriented code with prefixed functions, and no customer or store data sent anywhere (see External services below)

= Free vs Pro =

The free plugin runs a complete wallet and store credit program: top-up, wallet checkout, cart cashback, send money, manual and bulk adjustments, transaction history, refunds to wallet, wallet emails and the customer wallet page. Most stores can launch on the free version and never pay anything.

[WooCommerce Wallet Pro](https://devdiggers.com/product/woocommerce-wallet-management/) is for stores that need spending controls, withdrawals, money requests and a wider rewards program.

=== Flexible payments and limits (Pro) ===

* Partial payment, so the wallet covers part of an order and another gateway covers the rest
* Minimum and maximum top-up limits
* Fixed or percentage debit limits, with minimum and maximum amounts per order
* Minimum and maximum transfer limits for sending money
* Quick top-up preset buttons, for example 10, 20, 50 and 100

=== Withdrawals and security (Pro) ===

* Wallet withdrawal requests that customers raise from their dashboard
* Admin approval screen to mark a withdrawal paid or cancel it
* Fixed or percentage withdrawal charges, with minimum and maximum limits
* OTP email verification for sensitive wallet operations, with configurable length and expiry

=== Rewards and growth (Pro) ===

* Request money from another customer, with the other side approving or declining
* Referral program that rewards both the referrer and the new customer
* Cashback rules by product, category, user role, payment method and top-up amount
* First order cashback for new customers
* Cashback expiry with automated reminder emails before the balance expires

=== Data and reporting (Pro) ===

* Export customer wallet data to CSV
* Custom dashboard icons for each wallet operation
* Priority support from the DevDiggers team

[View Pro Demo](https://demo.devdiggers.com/woocommerce-wallet/) | [Upgrade to Pro](https://devdiggers.com/product/woocommerce-wallet-management/)

== Installation ==

**Automatic (recommended)**

1. Go to **Plugins > Add New** in your WordPress admin.
2. Search for **DevDiggers Wallet for WooCommerce**.
3. Click **Install Now**, then **Activate**.

**Manual**

1. Download the plugin zip file from WordPress.org.
2. Go to **Plugins > Add New > Upload Plugin**.
3. Upload the zip, click **Install Now**, then **Activate**.

You can also unzip and upload the `devdiggers-wallet-for-woocommerce` folder to `/wp-content/plugins/` over FTP, then activate it from the Plugins menu.

**After activation**

1. The setup wizard opens on its own. Enable the wallet, set a registration credit if you want one, and pick the order status that confirms a top-up.
2. Add your cart cashback rules under **Wallet > Cashback Rules**.
3. Check **Wallet > Configuration > Endpoints** if you want to rename the My Account wallet slug, then save your permalinks.
4. Place a test order to try the top-up flow, then pay for a second order with the wallet balance.

WooCommerce must be installed and active.

== Frequently Asked Questions ==

= Does this wallet plugin require WooCommerce? =

Yes. The wallet registers as a WooCommerce payment gateway and stores balances against WooCommerce customers, so WooCommerce has to be installed and active.

= How do customers add money to their WooCommerce wallet? =

A hidden "Wallet Topup" product is created on activation. The customer opens the wallet page in My Account, enters an amount, and checks out with one of your normal payment gateways. When that top-up order reaches the status you selected in the settings, the balance is added.

= Can I control which payment gateways can be used for a top-up? =

Yes. Under **Wallet > Configuration > General** you choose which payment gateways are available for wallet top-up orders. The wallet gateway itself is never offered for top-ups, so nobody can fund a wallet with wallet money.

= How do I give a customer store credit manually? =

Go to **Wallet > Manual Adjustment**, choose the customer, pick credit or debit, enter the amount and add a note. The change appears in the transaction log and the customer gets a wallet email.

= Can I add store credit to many customers at once? =

Yes. The Users screen includes a CSV import that credits or debits many customers in one run, and a sample file is included so you can see the expected columns.

= Are WooCommerce refunds returned to the wallet? =

Yes. When you refund an order that was paid with the wallet, the refunded amount is credited back to the customer wallet automatically, and any cashback awarded for that order is reversed.

= How does the cashback program work? =

You create cart cashback rules with amount ranges. When the order subtotal falls inside a range, the customer earns the fixed or percentage reward set on that rule. The cashback is held as pending on the order and credited to the wallet when the order completes. A maximum per order, a minimum order value and an option to skip sale products are all in the free version.

= Can I set cashback per product or per category? =

Cashback by product, category, user role, payment method and top-up amount is a Pro feature. The free version covers cart total cashback.

= Can customers pay for part of an order with the wallet? =

Not in the free version. Free covers full payment from the wallet balance through the wallet payment gateway. Partial payment, where the wallet pays part of the total and another gateway pays the rest, is a Pro feature.

= Can customers send wallet money to each other? =

Yes, and it is free. The customer enters the receiver's email address, the amount and an optional note on the wallet page, and the transfer is recorded on both wallets. Requesting money from another customer is a Pro feature.

= Can I give new customers a signup credit? =

Yes. Set a registration credit amount in the setup wizard or under **Wallet > Configuration**, and the balance is added when the account is created.

= Which shortcodes are included? =

Five: balance only, balance card, wallet operations, balance with operations, and transaction history. The default tags are listed in the description, and each tag can be renamed under **Wallet > Configuration > Shortcodes**.

= Does it work with HPOS and the block checkout? =

Yes. The plugin declares compatibility with WooCommerce High-Performance Order Storage and registers a payment method for the block based Cart and Checkout, so the wallet shows up in both the classic and the block checkout.

= Can I change the wallet page URL in My Account? =

Yes. Set the endpoint slug and the menu title under **Wallet > Configuration > Endpoints**, then save your permalinks once so WordPress picks up the new URL.

= Can I match the wallet design to my theme? =

Yes. The Layout tab sets the theme color, icon visibility and size, card background, border and text colors, and the transaction table header colors. Cashback message colors and font size are set on the Cashbacks tab.

= Where are wallet balances and transactions stored? =

In their own database tables on your site. Nothing about your customers or your store is sent to us, and there is no external service holding the money.

= Do I need to know how to code? =

No. Everything is set from labeled admin fields and the setup wizard. Developers who want to go further will find hooks and filters through the wallet layout, the cashback calculation and the transaction flow.

= Is my data safe if I upgrade to Pro later? =

Yes. The free plugin never deletes wallet data, and it stops loading when the Pro plugin is active, so the two never run at the same time. Balances, transactions and cashback rules are carried over.

= Where can I get help? =

Free version questions go to the plugin support forum here on WordPress.org. Documentation is at [docs.devdiggers.com/woocommerce-wallet-management](https://docs.devdiggers.com/woocommerce-wallet-management/), and you can reach the team through the [DevDiggers contact page](https://devdiggers.com/contact/).

== Screenshots ==

1. Admin wallet dashboard with balance, wallet spent, transactions, users and cashback awarded, plus transaction trend and type charts
2. Customer wallet page in WooCommerce My Account showing available balance, today's credit and debit, and the add money action
3. Send money form where a customer transfers wallet balance to another customer
4. Wallet payment gateway selected at checkout, paying the order from the balance
5. Cashback message shown on the cart page for the current order
6. Admin cashback rules screen with cart amount ranges, fixed or percentage rewards and rule status
7. Admin users list showing every customer with their current wallet balance
8. Manual adjustment screen for crediting or debiting a single customer with a note
9. CSV import wizard for bulk crediting or debiting customer wallets
10. Admin transactions log with filters across every wallet credit and debit
11. General configuration screen with wallet enable, registration credit and top-up settings
12. Shortcodes configuration screen listing the five wallet shortcodes
13. Layout configuration screen for theme color, icons and card styling
14. Setup wizard that configures the wallet right after activation

== External services ==

This plugin relies on the following third-party services provided by DevDiggers (https://devdiggers.com). These connections only happen inside the WordPress admin area and are described below so you know exactly what is sent, why, and when.

**1. DevDiggers extensions directory**

* What it is: A read-only API on devdiggers.com that returns the public list of DevDiggers WooCommerce extensions.
* What it is used for: To display available DevDiggers extensions on the plugin's "Extensions" admin page.
* When data is sent: Only when a logged-in administrator opens the "Extensions" admin page. The response is cached for 24 hours, so the request is not repeated on every page load.
* What data is sent: A standard outbound HTTP request only (your server's IP address and a plugin user-agent string, as with any web request). No personal data and no store data are sent.
* Endpoint: https://devdiggers.com/wp-json/ddwcs/v1/plugins

**2. Newsletter subscription (optional)**

* What it is: A contact/newsletter endpoint on devdiggers.com.
* What it is used for: To add your email address to the DevDiggers newsletter, only if you explicitly choose to subscribe.
* When data is sent: Only when an administrator submits the optional newsletter form in the plugin dashboard. Nothing is sent automatically.
* What data is sent: The email address you enter and your site URL.
* Endpoint: https://devdiggers.com/

These services are provided by DevDiggers. By using them you agree to the DevDiggers Terms and Conditions (https://devdiggers.com/terms-and-conditions/) and Privacy Policy (https://devdiggers.com/privacy-policy/).

== Source code and build tools ==

The admin and frontend JavaScript and CSS are compiled from the `src/` folder with webpack and Babel. The complete, human-readable source code (admin, frontend, and all build configuration) is published in our public GitHub repository:

https://github.com/DevDiggers-Technologies/wallet-for-woocommerce

To build the assets from source:

1. Run `npm install` to install the build dependencies listed in `package.json`.
2. Run `npm run build` to compile the production assets into `assets/js` and `assets/css`.

The build configuration is in `webpack.config.js` and `babel.config.js`.

== Changelog ==

= 1.0.1 =
* Tested compatibility with WordPress 7.0.3 and WooCommerce 11.0.0.
* Fixed security issues.
* Fixed wallet top-up accepting non-numeric or zero and negative amounts.
* Fixed a fatal error that could occur when the Pro plugin was active alongside the free plugin.
* Fixed the admin review link so it points to the WordPress.org reviews page.

= 1.0.0 =
* Initial free release.
