Get Github to Attempt Billing Again

Charge Marketplace Owners for using your Plug-In

You lot can make marketplace administrators pay for your plug-in in 2 ways:

  • Subscribe to your Plug-In
  • Purchase your Plug-In

This tool collects payment from your customers using Stripe only. Long story short, the Plug-In Billing Engine encapsulates your source lawmaking and makes it only available after payment has been washed

Pre-requirements

  • A Stripe Dashboard, you can go one here. In one case you lot have your Stripe business relationship, navigate to Developers > API keys and take annotation of your Publishable and Secret Keys
  • Decent knowledge of Stripe'due south APIs
  • Thirst for money 💵

key


Subscribe to your plug-in

Back End

Start past downloading the Subscription Plan folder. To connect your Stripe account to the payments made past the user, navigate to license > license.php, and insert your Stripe Secret cardinal into the line commented "#1".

1

You volition also demand a PlanID to be inserted at the line commented #2. To get this,

  • Get to your Stripe Dashboard
  • Navigate to Billing > Products and so click on New. Give your production a name, and unit characterization or statement descriptor, if necessary, and create the product.

2

This will lead you to the Pricing Plan Folio for your product. Fill up in the necessary details such equally its Name, Currency, Price per Unit, and Billing interval.

3

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

4

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

5


Forepart Finish

Back upwardly the root folder, navigate to admin > subscribe.php and open it. Search for the class tag that is shown in the flick below and you lot can (and should) customizethe text and grade parameters to friction match the plan you created on Stripe.

  • Text on the primary folio before the Subscription push button
  • data-key: Your Stripe Publishable primal
  • data-name: Proper name of your Plug-In
  • data-description: Information for the customer
  • data-image: Absolute or relative URL of the image that y'all want to announced on the payment popular-upward
  • data-amount: The amount (in cents) that the customer is about to pay
    • This is simply a front-end facing number. The corporeality that gets charged from the customer's card is decided in your Stripe Plan.
  • data-characterization: The text on the pay push button. Due east.grand: Buy or Subscribe

7

8


Adding a Costless Trial to your Subscription Program

If you want to add a complimentary trial to your Subscription Programme, ensure specifying the duration of this trial on the Front with the user. Navigate to admin > trial.php and open it. The underlined code in the analogy below follows this logic: fourth dimension = current time + number of seconds. Therefore, changing the number of seconds would alter the elapsing of the trial. For example, if you want to have a 15-day trial, your line of code should look like:

                              $fourth dimension              =              time() +              fifteen              *              24              *              sixty              *              60;              //(15days * 24 hours * hour * 60 seconds).            

In the screenshot below, the trial duration is xxx seconds:

trial

After using upwardly a trial, the customer volition non exist able to apply it again, unless he/she pays for it. The trial cannot be exploited by uninstalling and re-installing the plug-in. It knows.

Important

Uninstalling the Plug-In will unsubscribe the customer from the subscription programme.

Installing the plug-in again volition make it enquire for payment again.

-----------------------------------------------------------------------------------------------------------------------------

One-Fourth dimension Fee

Back End

Kickoff by downloading Arcadier's I Time Charge file. To connect your Stripe account to the payments made by the user, navigate to license > license.php, and paste your Stripe'south clandestine key into #1.

9

In order to create a Quondam fee that will be charged to your Stripe account, roll down till y'all see the function buy() and make modifications there. Under the Stripe API phone call for creating a charge, change the following variables according to what you lot want to charge (underlined).

10

  • amount: The amount (in cents) of money you lot will be charging the user
    • This is the actual corporeality that will exist charged to the user
  • currency: The currency of which the in a higher place corporeality will be charged in

Front end End

Going back to the root folder (One Time Charge), navigate to admin > subscribe.php and open up information technology. Search for the grade tag that is shown in the motion picture below and brand changes y'all want (underlined).

  • Text on the main page earlier the Payment push data-central: Your Stripe Publishable fundamental
  • information-name: Name of your Plug-In
  • data-clarification: Information for the customer
  • data-image: Absolute or relative URL of the paradigm that yous want to appear on the payment pop-up
  • data-amount: The corporeality (in cents) that the customer is nigh to pay
    • This is but a front end-stop facing number. The amount that gets charged from the customer's carte du jour is the one that has been specified in license.php.
  • data-label: The text on the pay button. East.g: Buy or Subscribe

11

12

13


Where does your Plug-In'south source code reside in all this?

The Plug-In Billing engine has the same file construction every bit all other plug-ins should accept:

  • root
    • admin
      • html
      • css
      • scripts
    • user
      • html
      • css
      • scripts
    • a.php
    • b.php
    • c.php

Let'southward say you desire to create a Premium Market Report Generator. 100% of its source code is institute in the admin folder and subfolders. So the Market place Report Generator's

  • .js files go in the Plug-In Billing Engine's admin > scripts folder.
  • .css files go in the Plug-In Billing Engine'due south admin > css folder
  • index.html file goes inside admin > index.php of the Plug-In Billing Engine
                      if(                    $licence->isValid()){                  ?>                  <                  link                  rel="stylesheet"                  href="css/style.css">                  <                  p                  >Plug-In Content</                  p                  >                  <                  script                  type="text/javascript"                  src="scripts/scripts.js">                  <?php                  }

For Plug-Ins that accept user side code likewise, you should accept your scripts and php files bank check for validity of the marketplace owner's license using the isValid() role plant in license.php.

14

dialwelyine.blogspot.com

Source: https://github.com/Arcadier/Plug-In-Billing-Engine

0 Response to "Get Github to Attempt Billing Again"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel