Pay With Points

Estimated reading: 4 minutes 2554 views

Pay With Points

The Gateway add-on contains a custom WooCommerce payment gateway that will allow your users to pay for orders using points. This gateway works just like any other gateway but instead of charging in real money, it will charge your point balance (assuming you have one and can afford to pay).

 

If your store sells products for real money, you will need to provide an exchange rate between your stores currency and the point type you select to accept as payment.

 

Note that you can not do partial payments! In WooCommerce you must pay using one given payment gateway. You can not pay x amount with PayPal and the rest with some other service. The same principle applies for points. Your users can only pay for the entire order or none of it. This would mean they would pay for possible taxes or shipping.

The Payment Gateway

The Gateway add-on will add in a new custom gateway in your WooCommerce > Checkout settings called “myCred”. This gateway, if enabled, will allow users to pay for an order using their current point balance. If you have multiple point types, you must select to choose one point type that can be used as payment.

 

Based on the exchange rate you set, the gateway is automatically hidden as an option on the checkout page if the user can not afford to pay with points. This of course also means that if points are the only way to pay, there will be no payment option available and no purchases will be possible. You can change this behavior with a custom snippet like this one:

 
				
					define( 'SHOW_MYCRED_IN_WOOCOMMERCE', true );
				
			

(Showing a gateway does not mean anyone can use it. The gateway will still check to make sure the customer can afford to pay using points.)

Gateway Setup

You can find the myCred Gateways settings in the same place where you edit all other gateways, 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!

 

Next, if our store currency is not set to be points, we need to set an exchange rate in order to know the value of our points. This exchange rate is applied to the order total.

 

You can select to show the cost of the order in points in the cart and / or on the checkout page. This total will be shown even if the user can not afford to pay. You can also set the label that will be used with the point amount.

 

Finally, the gateway gives you the option to share the profits with the product owner. This means that when a buyer pays with points, a percentage of these points are given to the product author. If the buyer does not pay with points, the product author will not receive points either!

 

Just like with the previous log templates, the templates for profit sharing are mandatory. Remember to always save!