loading

How to Stripe Subscription Payment Integration in CodeIgniter

How to Stripe Subscription Payment Integration in CodeIgniter

How to Stripe Subscription Payment Integration in CodeIgniter

0 Sales

Free

The Stripe payment gateway makes it simple to take subscription fees through the web application. You may use the Stripe API to construct a membership subscription system with recurring billing. The Stripe Plans & Subscription API enables you to quickly and effectively incorporate recurring payment features. Stripe Subscription is a great solution for allowing your website's members to buy/subscribe membership online with their credit card.

 

Stripe library facilitates the integration of Stripe Subscription API in PHP. If you use the CodeIgniter approach to create your website, the Stripe PHP API must be incorporated through into CodeIgniter app. The subscriber is charged recurringly based on the interval in the Stripe subscription payment system. The subscriber can use their credit/debit card to purchase a subscription package for your website without exiting the web application. This article will demonstrate how to add Stripe subscription payment capabilities into CodeIgniter.

 

The following functionality will be provided in this example script to create a CodeIgniter Membership service using the Stripe API.

 

- Get subscription plans from the database and display them in a dropdown menu.


- Create an HTML form for choosing a plan and entering payment card details.


- To securely transfer card information, create a Stripe token.


- Verify the credit card information and establish a subscription plan using the Stripe API.


- In the database, save transaction information and subscription plan information.

 

Stripe Test API Keys

 

Before launching the Stripe payment gateway, ensure that the checkout process is functioning properly. To test the credit card payment procedure, you must employ the experimental API keys data.

 

- Visit to the Developers » API keys page after logging into your Stripe account.


- Your API keys (Both the Secret key and Publishable key) are mentioned underneath the Standard keys portion in the TEST DATA. Click the Display test key token box to view the Secret key.

 

Acquire the Publishable and Secret keys to be used later in the script.

Take a look at the configuration files before beginning to integrate Stripe Subscription payout in CodeIgniter.

codeigniter_stripe_subscription_payment_integration/
├── application/
│   ├── config/
│   │   └── stripe.php
│   ├── controllers/
│   │   └── Subscription.php
│   ├── libraries/
│   │   └── Stripe_lib.php
│   ├── models/
│   │   └── User.php
│   ├── third_party/
│   │   └── stripe-php/
│   ├── views/
│   │   └── subscription/
│   │       ├── index.php
│   │       └── payment-status.php
└── assets/
    └── css/
        └── style.css

 

Create Database Tables

 

In order to store the scheme, membership, and registration information in the database, three tables are necessary.

 

1. The following are examples: SQL adds a plans table in the MySQL database to store subscription plan information.

CREATE TABLE `plans` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `price` float(10,2) NOT NULL,
 `currency` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'USD',
 `interval` enum('week','month','year') COLLATE utf8_unicode_ci NOT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

 

 

2. The following are examples SQL builds a users table in the MySQL database to store information about website members.

CREATE TABLE `users` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `subscription_id` int(11) NOT NULL DEFAULT 0,
 `first_name` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
 `last_name` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
 `email` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
 `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `gender` enum('Male','Female') COLLATE utf8_unicode_ci NOT NULL,
 `phone` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
 `created` datetime NOT NULL,
 `modified` datetime NOT NULL,
 `status` enum('1','0') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

 

3. The following are examples SQL creates a user subscriptions table in the MySQL database to store subscription and payment information.

CREATE TABLE `user_subscriptions` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `user_id` int(11) NOT NULL DEFAULT 0,
 `plan_id` int(11) NOT NULL,
 `payment_method` enum('stripe') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'stripe',
 `stripe_subscription_id` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
 `stripe_customer_id` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
 `stripe_plan_id` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
 `plan_amount` float(10,2) NOT NULL,
 `plan_amount_currency` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
 `plan_interval` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
 `plan_interval_count` tinyint(2) NOT NULL,
 `plan_period_start` datetime NOT NULL,
 `plan_period_end` datetime NOT NULL,
 `payer_email` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
 `created` datetime NOT NULL,
 `status` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

 

Config

 

stripe.php

 

This file defines the Stripe library's configuration variables.

 

- Enter the Stripe API Secret key (stripe api key), API Publishable key (stripe publishable key), and currency code (stripe currency) in the appropriate fields.

<?php 
defined('BASEPATH') OR exit('No direct script access allowed'); 
/* 
| ------------------------------------------------------------------- 
|  Stripe API Configuration 
| ------------------------------------------------------------------- 
| 
| You will get the API keys from Developers panel of the Stripe account 
| Login to Stripe account (https://dashboard.stripe.com/) 
| and navigate to the Developers » API keys page 
| Remember to switch to your live publishable and secret key in production! 
| 
|  stripe_api_key            string   Your Stripe API Secret key. 
|  stripe_publishable_key    string   Your Stripe API Publishable key. 
|  stripe_currency           string   Currency code. 
*/ 
$config['stripe_api_key']         = 'Your_API_Secret_key'; 
$config['stripe_publishable_key'] = 'Your_API_Publishable_key'; 
$config['stripe_currency']        = 'usd';

Please keep in mind that your Stripe API Secret key and Publishable key may be located under the API Keys Data area of your Stripe account.

 

Third Party

stripe-php/

 

The Stripe PHP bindings API is being used to build user, package, and membership objects using the Stripe API. The Stripe PHP library must be put in your CodeIgniter application's third party/ directory.

 

It is important to note that you need not download the Stripe PHP library individually; all of the necessary files are present in the source code.

 

Library

Stripe_lib.php

 

The Stripe CodeIgniter Library facilitates the integration of Stripe subscription payments into CodeIgniter 3 applications. A configuration file (application/config/stripe.php) and the Stripe PHP bindings library (application/third party/stripe-php) are required for this library.

 

- __construct() – Generate an API key and launch the Stripe class.


- addCustomer() — Use the Stripe Customer API to add a customer to your Stripe account.


- createPlan() — Use the Stripe Plan API to create a plan.


- createSubscription() — Use the Stripe Subscription API to make a subscription.

 

<?php 
defined('BASEPATH') OR exit('No direct script access allowed'); 
 
/** 
 * Stripe Library for CodeIgniter 3.x 
 * 
 * Library for Stripe payment gateway. It helps to integrate Stripe payment gateway 
 * in CodeIgniter application. 
 * 
 * This library requires the Stripe PHP bindings and it should be placed in the third_party folder. 
 * It also requires Stripe API configuration file and it should be placed in the config directory. 
 * 
 * @package     CodeIgniter 
 * @category    Libraries 
 * @author      CodexWorld 
 * @license     http://www.codexworld.com/license/ 
 * @link        http://www.codexworld.com 
 * @version     3.0 
 */ 
 
class Stripe_lib{ 
    var $CI; 
    var $api_error; 
     
    function __construct(){ 
        $this->api_error ''; 
        $this->CI =& get_instance(); 
        $this->CI->load->config('stripe'); 
         
        // Include the Stripe PHP bindings library 
        require APPPATH .'third_party/stripe-php/init.php'; 
         
        // Set API key 
        \Stripe\Stripe::setApiKey($this->CI->config->item('stripe_api_key')); 
    } 
 
    function addCustomer($name$email$token){ 
        try { 
            // Add customer to stripe 
            $customer = \Stripe\Customer::create(array( 
                'name' => $name, 
                'email' => $email, 
                'source'  => $token 
            )); 
            return $customer; 
        }catch(Exception $e) { 
            $this->api_error $e->getMessage(); 
            return false; 
        } 
    } 
     
    function createPlan($planName$planPrice$planInterval){ 
        // Convert price to cents 
        $priceCents = ($planPrice*100); 
        $currency $this->CI->config->item('stripe_currency'); 
         
        try { 
            // Create a plan 
            $plan = \Stripe\Plan::create(array( 
                "product" => [ 
                    "name" => $planName 
                ], 
                "amount" => $priceCents, 
                "currency" => $currency, 
                "interval" => $planInterval, 
                "interval_count" => 1 
            )); 
            return $plan; 
        }catch(Exception $e) { 
            $this->api_error $e->getMessage(); 
            return false; 
        } 
    } 
     
    function createSubscription($customerID$planID){ 
        try { 
            // Creates a new subscription 
            $subscription = \Stripe\Subscription::create(array( 
                "customer" => $customerID, 
                "items" => array( 
                    array( 
                        "plan" => $planID 
                    ), 
                ), 
            )); 
             
            // Retrieve charge details 
            $subsData $subscription->jsonSerialize(); 
            return $subsData; 
        }catch(Exception $e) { 
            $this->api_error $e->getMessage(); 
            return false; 
        } 
    } 
}

 

Controller (Subscription.php)

 

The Stripe library is used by the Subscription controller to manage the plan subscription and billing process.

 

- __construct() –

     - This method loads the Stripe library and the user model.
     - Get the SESSION's logged-in user ID.

 

- index() –

 

- Fetch the plan data from the database and send it to view to display the plan listing.


- If a payment form is submitted,
     - verify that it has a valid Stripe token.

     - Retrieve the stripe token, subscriber, and plan information from the form data.
     - To make the payment, use the payment() function and give the supplied data.

 

- If the payment is successful, you will be sent to the subscription status page.

 

- payment() – This call is just for the Subscription controller's internal use.

 

     - Obtain the Stripe token and user information.


     - Using the getPlans() function of the User model, retrieve particular plan data from the database.


     - Using the Stripe library's addCustomer() function, add a customer by entering their name, email, and token.


     - Using the Stripe library's createPlan() function, make a plan by selecting plan information.


     - Using the Stripe library's createSubscription() function, create a subscription based on the customer ID and plan ID.


     - If the subscription activation is successful,


          - use the insertSubscription() function of the User model to insert transaction and subscription details into the database.


          - Subscription ID  returned.

 

- payment_status()

 

     Using the getSubscription() function of the User model, retrieve the subscription details from the database.


     Subscription data should be passed to the view in order for the subscription status to be shown.

 

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
 
class Subscription extends CI_Controller { 
     
    function __construct() { 
        parent::__construct(); 
         
        // Load Stripe library 
        $this->load->library('stripe_lib'); 
         
        // Load product model 
        $this->load->model('user'); 
         
        // Get user ID from current SESSION 
        $this->userID = isset($_SESSION['loggedInUserID'])?$_SESSION['loggedInUserID']:1; 
    } 
     
    public function index(){ 
        $data = array(); 
         
        // If payment form is submitted with token 
        if($this->input->post('stripeToken')){ 
            // Retrieve stripe token and user info from the posted form data 
            $postData $this->input->post(); 
             
            // Make payment 
            $paymentID $this->payment($postData); 
             
            // If payment successful 
            if($paymentID){ 
                redirect('subscription/payment_status/'.$paymentID); 
            }else{ 
                $apiError = !empty($this->stripe_lib->api_error)?' ('.$this->stripe_lib->api_error.')':''; 
                $data['error_msg'] = 'Transaction has been failed!'.$apiError; 
            } 
        } 
         
        // Get plans from the database 
        $data['plans'] = $this->user->getPlans(); 
         
        // Pass plans data to the list view 
        $this->load->view('subscription/index'$data); 
    } 
     
    function payment($postData){ 
         
        // If post data is not empty 
        if(!empty($postData)){ 
            // Retrieve stripe token and user info from the submitted form data 
            $token  $postData['stripeToken']; 
            $name $postData['name']; 
            $email $postData['email']; 
             
            // Plan info 
            $planID $_POST['subscr_plan']; 
            $planInfo $this->user->getPlans($planID); 
            $planName $planInfo['name']; 
            $planPrice $planInfo['price']; 
            $planInterval $planInfo['interval']; 
             
            // Add customer to stripe 
            $customer $this->stripe_lib->addCustomer($name$email$token); 
             
            if($customer){ 
                // Create a plan 
                $plan $this->stripe_lib->createPlan($planName$planPrice$planInterval); 
                 
                if($plan){ 
                    // Creates a new subscription 
                    $subscription $this->stripe_lib->createSubscription($customer->id$plan->id); 
                     
                    if($subscription){ 
                        // Check whether the subscription activation is successful 
                        if($subscription['status'] == 'active'){ 
                            // Subscription info 
                            $subscrID $subscription['id']; 
                            $custID $subscription['customer']; 
                            $planID $subscription['plan']['id']; 
                            $planAmount = ($subscription['plan']['amount']/100); 
                            $planCurrency $subscription['plan']['currency']; 
                            $planInterval $subscription['plan']['interval']; 
                            $planIntervalCount $subscription['plan']['interval_count']; 
                            $created date("Y-m-d H:i:s"$subscription['created']); 
                            $current_period_start date("Y-m-d H:i:s"$subscription['current_period_start']); 
                            $current_period_end date("Y-m-d H:i:s"$subscription['current_period_end']); 
                            $status $subscription['status']; 
                             
                            // Insert tansaction data into the database 
                            $subscripData = array( 
                                'user_id' => $this->userID, 
                                'plan_id' => $planInfo['id'], 
                                'stripe_subscription_id' => $subscrID, 
                                'stripe_customer_id' => $custID, 
                                'stripe_plan_id' => $planID, 
                                'plan_amount' => $planAmount, 
                                'plan_amount_currency' => $planCurrency, 
                                'plan_interval' => $planInterval, 
                                'plan_interval_count' => $planIntervalCount, 
                                'plan_period_start' => $current_period_start, 
                                'plan_period_end' => $current_period_end, 
                                'payer_email' => $email, 
                                'created' => $created, 
                                'status' => $status 
                            ); 
                            $subscription_id $this->user->insertSubscription($subscripData); 
                             
                            // Update subscription id in the users table  
                            if($subscription_id && !empty($this->userID)){ 
                                $data = array('subscription_id' => $subscription_id); 
                                $update $this->user->updateUser($data$this->userID); 
                            } 
                             
                            return $subscription_id; 
                        } 
                    } 
                } 
            } 
        } 
        return false; 
    } 
     
    function payment_status($id){ 
        $data = array(); 
         
        // Get subscription data from the database 
        $subscription $this->user->getSubscription($id); 
         
        // Pass subscription data to the view 
        $data['subscription'] = $subscription; 
        $this->load->view('subscription/payment-status'$data); 
    } 
}

 

 

Model (User.php)

 

The User model manages database-related actions (fetch, insert, and update).

 

- __construct() — This function defines the names of the database tables.


- updateUser() — This function is used to update user data in the users table.


- getSubscription() – Retrieves subscription information from the user subscriptions and plans tables.


- insertSubscription() – Inserts subscription information into the user subscriptions database.


- getPlans() – Returns an array of records from the plans table.

 

<?php 
if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
 
class User extends CI_Model { 
    function __construct(){ 
        $this->userTbl        'users'; 
        $this->planTbl    'plans'; 
        $this->subscripTbl    'user_subscriptions'; 
    } 
     
    /* 
     * Update user data to the database 
     * @param data array 
     * @param id specific user 
     */ 
    public function updateUser($data$id){ 
        $update $this->db->update($this->userTbl$data, array('id' => $id)); 
        return $update?true:false; 
    } 
     
    /* 
     * Fetch order data from the database 
     * @param id returns a single record 
     */ 
    public function getSubscription($id){ 
        $this->db->select('s.*, p.name as plan_name, p.price as plan_price, p.currency as plan_price_currency, p.interval'); 
        $this->db->from($this->subscripTbl.' as s'); 
        $this->db->join($this->planTbl.' as p''p.id = s.plan_id''left'); 
        $this->db->where('s.id'$id); 
        $query  $this->db->get(); 
        return ($query->num_rows() > 0)?$query->row_array():false; 
    } 
     
    /* 
     * Insert subscription data in the database 
     * @param data array 
     */ 
    public function insertSubscription($data){ 
        $insert $this->db->insert($this->subscripTbl,$data); 
        return $insert?$this->db->insert_id():false; 
    } 
     
    /* 
     * Fetch plans data from the database 
     * @param id returns a single record if specified, otherwise all records 
     */ 
    public function getPlans($id ''){ 
        $this->db->select('*'); 
        $this->db->from($this->planTbl); 
        if($id){ 
            $this->db->where('id'$id); 
            $query  $this->db->get(); 
            $result = ($query->num_rows() > 0)?$query->row_array():array(); 
        }else{ 
            $this->db->order_by('id''asc'); 
            $query  $this->db->get(); 
            $result = ($query->num_rows() > 0)?$query->result_array():array(); 
        } 
         
        // return fetched data 
        return !empty($result)?$result:false; 
    } 
}

 

View

 

1. subscription/index.php

This page displays a plan option menu with a payment form.

 

Plan and Payment Form:

 

The HTML form takes user information (name and email address) as well as credit card information (Card Number, Expiration Date, and CVC No.).

 

     - A dropdown menu lists all of the possible plans.

 

<div class="panel">
    <form action="" method="POST" id="paymentFrm">
        <div class="panel-heading">
            <h3 class="panel-title">Plan Subscription with Stripe</h3>
            <!-- Plan Info -->
            <p>
                <b>Select Plan:</b>
                <select name="subscr_plan" id="subscr_plan">
                    <?php foreach($plans as $plan){ ?>
                    <option value="<?php echo $plan['id']; ?>"><?php echo $plan['name'].' [$'.$plan['price'].'/'.$plan['interval'].']'?></option>
                    <?php ?>
                </select>
            </p>
        </div>
        <div class="panel-body">
            <!-- Display errors returned by createToken -->
            <div id="paymentResponse"></div>
			
            <!-- Payment form -->
            <div class="form-group">
                <label>NAME</label>
                <input type="text" name="name" id="name" class="field" placeholder="Enter name" required="" autofocus="">
            </div>
            <div class="form-group">
                <label>EMAIL</label>
                <input type="email" name="email" id="email" class="field" placeholder="Enter email" required="">
            </div>
            <div class="form-group">
                <label>CARD NUMBER</label>
                <div id="card_number" class="field"></div>
            </div>
            <div class="row">
                <div class="left">
                    <div class="form-group">
                        <label>EXPIRY DATE</label>
                        <div id="card_expiry" class="field"></div>
                    </div>
                </div>
                <div class="right">
                    <div class="form-group">
                        <label>CVC CODE</label>
                        <div id="card_cvc" class="field"></div>
                    </div>
                </div>
            </div>
            <button type="submit" class="btn btn-success" id="payBtn">Submit Payment</button>
        </div>
    </form>
</div>

 

 

Validate Card with Stripe JS Library:

 

Include the Stripe.js v3 package, which allows you to securely communicate sensitive data to Stripe right from the browser.

<script src="https://js.stripe.com/v3/"></script>

 

The JavaScript code below is being used to acquire a token using the Stripe JS v3 api.

- Configure your publishable API key, which will be used to identify your site to Stripe.


- Stripe Elements may be used to alter UI components with in payment gateway.


- Using the stripe.elements() function, make a copy of Elements.


- Using elements, create an instance of a certain Element.
create() is a method.


- Using the element.mount() function, you may attach your Element to the DOM.


- The createToken() method uses stripe to generate a single-use token.
card components and the createToken() function


- The stripeTokenHandler() function appends the Stripe token to a hidden input created by the stripeTokenHandler() method.


- When the transaction is successful, the card information is sent to the server. Otherwise, the error notice appears.

 

<script>
// Create an instance of the Stripe object
// Set your publishable API key
var stripe = Stripe('<?php echo $this->config->item('stripe_publishable_key'); ?>');

// Create an instance of elements
var elements = stripe.elements();

var style = {
    base: {
        fontWeight: 400,
        fontFamily: 'Roboto, Open Sans, Segoe UI, sans-serif',
        fontSize: '16px',
        lineHeight: '1.4',
        color: '#555',
        backgroundColor: '#fff',
        '::placeholder': {
            color: '#888',
        },
    },
    invalid: {
        color: '#eb1c26',
    }
};

var cardElement = elements.create('cardNumber', {
    style: style
});
cardElement.mount('#card_number');

var exp = elements.create('cardExpiry', {
    'style': style
});
exp.mount('#card_expiry');

var cvc = elements.create('cardCvc', {
    'style': style
});
cvc.mount('#card_cvc');

// Validate input of the card elements
var resultContainer = document.getElementById('paymentResponse');
cardElement.addEventListener('change', function(event) {
    if (event.error) {
        resultContainer.innerHTML = '<p>'+event.error.message+'</p>';
    } else {
        resultContainer.innerHTML = '';
    }
});

// Get payment form element
var form = document.getElementById('paymentFrm');

// Create a token when the form is submitted.
form.addEventListener('submit', function(e) {
    e.preventDefault();
    createToken();
});

// Create single-use token to charge the user
function createToken() {
    stripe.createToken(cardElement).then(function(result) {
        if (result.error) {
            // Inform the user if there was an error
            resultContainer.innerHTML = '<p>'+result.error.message+'</p>';
        } else {
            // Send the token to your server
            stripeTokenHandler(result.token);
        }
    });
}

// Callback to handle the response from stripe
function stripeTokenHandler(token) {
    // Insert the token ID into the form so it gets submitted to the server
    var hiddenInput = document.createElement('input');
    hiddenInput.setAttribute('type', 'hidden');
    hiddenInput.setAttribute('name', 'stripeToken');
    hiddenInput.setAttribute('value', token.id);
    form.appendChild(hiddenInput);
	
    // Submit the form
    form.submit();
}
</script>

 

 

2. subscription/payment-status.php

 

This page displays the subscription information as well as the payment status.

<?php if(!empty($subscription)){ ?>
    <?php if($subscription['status'] == 'active'){ ?>
    <h1 class="success">Your Subscription Payment has been Successful!</h1>
    <?php }else{ ?>
    <h1 class="error">Subscription activation failed!</h1>
    <?php ?>

    <h4>Payment Information</h4>
    <p><b>Reference Number:</b> <?php echo $subscription['id']; ?></p>
    <p><b>Transaction ID:</b> <?php echo $subscription['stripe_subscription_id']; ?></p>
    <p><b>Amount:</b> <?php echo $subscription['plan_amount'].' '.$subscription['plan_amount_currency']; ?></p>
    
    <h4>Subscription Information</h4>
    <p><b>Plan Name:</b> <?php echo $subscription['plan_name']; ?></p>
    <p><b>Amount:</b> <?php echo $subscription['plan_price'].' '.$subscription['plan_price_currency']; ?></p>
    <p><b>Plan Interval:</b> <?php echo $subscription['plan_interval']; ?></p>
    <p><b>Period Start:</b> <?php echo $subscription['plan_period_start']; ?></p>
    <p><b>Period End:</b> <?php echo $subscription['plan_period_end']; ?></p>
    <p><b>Status:</b> <?php echo $subscription['status']; ?></p>
<?php }else{ ?>
    <h1 class="error">The transaction has been failed!</h1>
<?php ?>

 

 

Make Stripe Payment Gateway Live

 

Once the Stripe checkout procedure is operational, proceed with the steps below to activate the Stripe payment gateway.

 

1. Browse to the Developers » API keys page after logging into your Stripe account.


2. Retrieve the API keys from Live Data (Publishable key and Secret key).


3. Change the Testing API keys (Publishable key and Secret key) in the application/config/stripe.php file with the Active API keys (Publishable key and Secret key).

 

Conclusion

 

Stripe Subscription API is incredibly handy when you want to bill a client on a weekly/monthly/yearly basis. This sample script will let you incorporate a membership subscription billing system on your website. Users can use a credit/debit card to purchase a membership on your CodeIgniter website. Using the Stripe API, our sample code makes the membership payment process user-friendly, and payment can be done on a single page.

LICENSE OF USE

You can use it for personal or commercial projects. You can't resell it partially or in this form.

PRODUCT INFO

Create Date : Jan 21, 2022

Updated Date : Jan 23, 2022

Ratings

Comments : 0

Downloads : 0