Selling Points

Estimated reading: 3 minutes 755 views

Selling Points

Selling points using Stripe allows your users to buy points using credit cards with the option for users to save their credit card details with Stripe for future purchases.

 

Installation

Before you can sell points, we need to setup the payment gateway. Once you have installed and enabled the plugin, two new payment gateways will become available in your admin area. Go to the myCred > Payment Gateways page and click on “Stripe” first to reveal your core settings.

Base Setings

Besides ticking the enabled box, we need to start by entering our Stripe API keys. I highly recommend you use both your live keys and test keys so you can test your setup before accepting real purchases. For test purchases, also make sure you select “Test Purchases” in the Transaction Mode dropdown.

 

Next we need to select a currency we want to use and the exchange rate for all the point types you have enabled to be purchased via buyCred.

Checkout Window

Finally we need to setup how the Stripe Checkout popup window will look. This includes the logo we want to show, the title, short description and the purchase button label. This is the label shown in the popup window and not the shortcode button label!

Custom Shortcode

Normally you would use the mycred_buy or mycred_buy_form shortcodes to sell points. With Stripe, we need to use a custom shortcode when selling points. This is because the Stripe Checkout feature is not compatible with the buyCred checkout page.

 

When selling points using Stripe, we need to use the mycred_stripe_buy shortcode which renders the Checkout window. You can use this shortcode multiple times on the same page, however it should be used on a separate page if you are using Stripe for other services on your website, e.g. in a store.

 

Since the Stripe gateway does not support the mycred_buy_form shortcode, you can not let your users nominate the amount of points they buy. Each time you use the mycred_stripe_buy shortcode, you will be required to set the number of points the shortcode sells.

Available Shortcodes

ShortcodeDescription
mycred_stripe_buyRenders a point purchase button that uses the Stripe Checkout API.