Skip to content
A guide on how to sell your Plug-Ins to marketplace owners using Stripe
PHP JavaScript CSS HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
One Time Charge
Subscription Based Billing
README.md

README.md

Arcadier

Charge Marketplace Owners for using your Plug-In

This Billing Engine offers 2 ways of collecting payment from the users of your Plug-In:

  • On a subscription basis
  • One time fee

To start using any of those, you'll need a Stripe Dashboard, you can get one here. Once you have your Stripe account, navigate to Developers > API keys and take note of you Publishable and Secret Keys.

key


Subscription Basis Plan

Back End

Start by downloading/cloning the Subscription Plan folder. To connect your Stripe account to the payments made by the user, navigate to “license” > “license.php”, open it, and insert your Stripe’s secret key into the line commented "#1".

1

You will also needa PlanID to be inserted at the line commented #2. To get this,

  • Go back to your Stripe Dashboard
  • Navigate to Billing > Products and then click on New. Give your product a name, and unit label or statement descriptor, if necessary, and create the product.

2

This will redirect you to the Pricing Plan Page for your product. Fill in the necessary details such as its Name, Currency, Price per Unit, and Billing interval.

3

Once your Pricing Plan has been created, click on it and you will be able to retrieve the Plan ID that you need.

4

Copy and paste this plan ID back into “license.php” where it says #2.

5


Front End

Going back to the root folder containing all the code for your Subscription Plug-In, navigate to “admin” > “subscribe.php” and open it. Search for the form tag that is shown in the picture below and you will need to change the following variables according to your unique plan (underlined).

  • Text on the main page before the Subscription button
  • Data-key: Your Stripe Publishable key
  • Data-name: Name of your Plug-In
  • Data-description: Details about specific Subscription Plan
  • Data-image: Absolute or relative URL of the image that you want to appear on the payment pop-up
  • Data-amount: The value that is ONLY DISPLAYED on the pay button (in cents)
    • This does not affect the actual cost of the Subscription Plan
  • Data-label: The text on the pay button

7

8


Adding a Free Trial to your Subscription Plan

If you want to add a free trial to your Subscription Plan, be sure to specify the duration of this trial on the Front End with the user. Return back to the root folder containing all the code for your Subscription Plug-In and navigate to “admin” > “trial.php” and open it. The underlined code in the illustration below follows this logic: time = current time + number of seconds. Therefore, changing the number of seconds would change the duration of the trial. For example, if you want to have a 15-day trial, your line of code should look like: $time = time() + 15 * 24 * 60 * 60; (15days * 24 hours * 60 minutes * 60 seconds).

trial


One-Time Fee

Back End

Start by downloading Arcadier’s Charge file containing the internal Stripe Plug-In that you will be implementing. To connect your Stripe account to the payments made by the user, navigate to “license” > “license.php”, open it, and paste your Stripe’s secret key into #1.

9

In order to create a One-Time fee that will be charged to your connected Stripe account, scroll down till you see the function “buy” and make modifications there. Under the Stripe API call for creating a charge, change the following variables according to your unique charge (underlined).

10

  • Amount: The amount (in cents) of money you will be charging the user
    • This is the actual amount that will be charged to the user
  • Currency: The currency of which the above amount will be charged in

Front End

Going back to the root folder containing all the code for your Subscription Plug-In, navigate to “admin” > “subscribe.php” and open it. Search for the form tag that is shown in the picture below and you will need to change the following variables according to your unique plan (underlined).

11

  • Text on the main page before the Payment button
  • Data-key: Your Stripe account’s publishable key (from when you retrieved it earlier)
  • Data-name: Name of your Plug-In
  • Data-description: Details about specific Payment Plan
  • Data-amount: The value that is ONLY DISPLAYED on the pay button (in cents)
    • This does not affect the actual cost of the One-Time Fee
  • Data-label: The name of the button

12

13


Location of the Actual Plug-In you are trying to Sell

Now that you have added a payment method (subscription or one-time fee), here is where you add the actual content of the Plug-In you are trying to sell. Whether you are implementing a Subscription Plan or a One-Time Fee, the location of the actual Plug-In itself should remain the same. In your root folder, you should have the same structure as normal Plug-Ins, in that there are three internal directories called "css", "html", and "scripts". However, in the case of an additional Plug-In Billing Engine, your "html" file should be empty while your "css" and "scripts" files remain the same. Now, return to your root folder and navigate to “admin” > “index.php” and open it. Your Plug-In's html code should go inside the if-statement just before the else-statement. If you take a look at the illustration below, the if-statement asks if the license is valid (which means paid), and if it is, then it will execute the according Plug-In. Essentially your Plug-In's "index.html" code should go within the indicated box.

14

Your Plug-In now has the Plug-In Billing Engine integrated into it and you may now customize your payment request!

You can’t perform that action at this time.