The Gateway add-on allows you to setup stores where all products are sold using points instead of a real currency. Once enabled, all point types you have registered on your website will be inserted into the WooCommerce Currency dropdown for you to select from.
Once you have selected the point type we want to use in our store and saved, it is time for us to setup the payment gateway. Without doing this, your users will not be able to pay for orders.
When creating a point based store, the only usable payment gateway in WooCommerce is the myCRED Gateway. Using any other gateway that handles real money will not work as most gateway will not understand the selected store currency!
You can find the myCRED Gateways settings on the WooCommerce > Settings page under the “Checkout” tab.
First we will need to enable the gateway and set a title. This title will be shown on the checkout page describing the payment option and in the admin area when viewing an order and how it was paid.
The customer message is the message that is shown to the user as they select this gateway on the checkout page. This is optional.
Next we need to set the log template that will be used for each payment and refund. It is important that these fields are not left empty!
Finally, the gateway gives you the option to share the profits with the product owner by setting a percentage of the paid amount that they should receive. If the order is refunded, the points are taken from the product owner.
Just like with the previous log templates, the templates for profit sharing are mandatory. Remember to always save!
When a user pays for an order using points, the reward system, by default will not reward the buyer with points. It is assumed that when points are used as payment, the user can not get points back. This however can be overridden by adding the following line of code to your custom plugin or your theme’s functions.php file:
add_filter( 'mycred_woo_reward_mycred_payment', '__return_true' );
Selling points when you only accept points in your store can be a bit difficult. If you would like to allow your users to buy points that they can use in your store, consider using the buyCRED add-on. You can always as an administrator manually give your users points.