regiosoft/stripe-bundle

A simple Symfony bundle for Stripe API.

Installs: 142

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 2

Type:symfony-bundle

1.3.6 2022-07-29 16:32 UTC

README

A simple Symfony bundle for Stripe Api.

Only SMS/WhatsApp!

Setup

Step 1: Download RegiosoftStripeBundle using composer

Add Stripe Bundle in your composer.json:

{
    "require": {
        "regiosoft/stripe-bundle": "^1.0"
    }
}

Now tell composer to download the bundle by running the command:

$ php composer.phar update "regiosoft/stripe-bundle"

Step 2: Enable the bundle

Enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Regiosoft\StripeBundle\RegiosoftStripeBundle()
    );
}

Step 3: Add configuration

# app/config/config.yml
regiosoft:
        stripe:
            stripe_private_key:    %stripe_private_key%

Usage

Using service

<?php
        $stripeClient = $this->get('stripe_client');
?>

##Example

###Create customer & subscription

<?php 
    $customer = $stripeClient->createCustomer($token, $email, $name, $phone);

    // Store customer information

    $subsciption = $stripeClient->createSubscription($customerId, $planId);

    // Store subscription information

?>