Download the PHP package miracode/stripe-bundle without Composer
On this page you can find all versions of the php package miracode/stripe-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package stripe-bundle
MiracodeStripeBundle
The MiracodeStripeBundle integrates Stripe PHP SDK to your Symfony project. Also you can configure bundle to save Stripe data in database. You are free to choose what Stripe objects will be stored.
This bundle tested on Symfony versions 2.7, 2.8, 3.1, 3.3, 3.4, 4.0. Compatible with Symfony >=2.4
Installation
To install this bundle, run the command below and you will get the latest stable version.
Register bundle
For Symfony >=3.4
And set-up required configuration
Usage
After minimal bundle configuration you can start using Stripe SDK.
For example create new customer:
Stripe Events
Add bundle routing configuration to enable Stripe webhooks handler
This will register route with url /stripe/webhook
. You should add this webhook endpoint in Stripe Dashboard. Finally you will be able to listen all Stripe events.
For example for stripe event charge.succeeded
webhook controller will dispatch event stripe.charge.succeeded
.
Event Subscriber example:
Saving stripe data in database
Now only Doctrine ORM driver is available.
In bundle there are abstract entity classes with orm mapping for main stripe objects:
- card:
Miracode\StripeBundle\Model\AbstractCardModel
- charge:
Miracode\StripeBundle\Model\AbstractChargeModel
- coupon:
Miracode\StripeBundle\Model\AbstractCouponModel
- customer:
Miracode\StripeBundle\Model\AbstractCustomerModel
- invoice:
Miracode\StripeBundle\Model\AbstractInvoiceModel
- plan:
Miracode\StripeBundle\Model\AbstractPlanModel
- refund:
Miracode\StripeBundle\Model\AbstractRefundModel
- subscription:
Miracode\StripeBundle\Model\AbstractSubscriptionModel
Use this abstract classes to create entities. For example charge entity class:
You must also specify entity classes in the bundle configuration
After adding entity classes in bundle configuration you can use model manager service to store stripe data.
For example:
If you enabled webhooks handling (described above), you can omit using model manager service to save objects data. There is event subscriber that will save/update/remove configured entities by stripe events automatically.
Note some data can be deleted by webhooks handler. If you want to use safe delete technique, implement interface Miracode\StripeBundle\Model\SafeDeleteModelInterface
in your entity classes.
Also you can use trait Miracode\StripeBundle\Model\Traits\SafeDeleteTrait
for easy interface implementation.
License
This bundle is released under the MIT license. See the included LICENSE file for more information.
All versions of stripe-bundle with dependencies
symfony/framework-bundle Version >=2.4
symfony/config Version >=2.3
stripe/stripe-php Version >=3.0
doctrine/common Version >=2.2