driveop / stripe-bundle
A simple Symfony bundle for Stripe API.
Installs: 138
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 2
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.1
- stripe/stripe-php: ^7.27
- symfony/config: ^3.0 || ^4.0
- symfony/dependency-injection: ^3.0 || ^4.0
- symfony/framework-bundle: ^3.0 || ^4.0
- symfony/http-foundation: ^3.0 || ^4.0
- symfony/http-kernel: ^3.0 || ^4.0
- symfony/options-resolver: ^3.0 || ^4.0
- symfony/validator: ^3.0 || ^4.0
README
A simple Symfony bundle for Stripe Api.
Only SMS/WhatsApp!
Setup
Step 1: Download DriveOpStripeBundle using composer
Add Stripe Bundle in your composer.json:
{ "require": { "driveop/stripe-bundle": "^1.0" } }
Now tell composer to download the bundle by running the command:
$ php composer.phar update "driveop/stripe-bundle"
Step 2: Enable the bundle
Enable the bundle in the kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new DriveOp\StripeBundle\DriveOpStripeBundle() ); }
Step 3: Add configuration
# app/config/config.yml driveop: 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 ?>