iulyanp/stripe-bundle

This package is abandoned and no longer maintained. The author suggests using the iulyanp/stripe-bundle package instead.

Stripe bundle

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:symfony-bundle

v0.1.0 2016-07-03 13:16 UTC

This package is not auto-updated.

Last update: 2021-07-22 09:36:55 UTC


README

This is a symfony bundle that implements payment with Stripe library.

Requirements

The version 0.1.0 requires that you'll have already installed AsseticBundle.

Why to use it?

The most important thing you need to know when you choose to use this bundle is that your customer card information are safe. This means that the sensible information about the client credit card will never touch your servers.

Installation

Require the bundle

$ composer require iulyanp/IPStripeBundle

Update AppKernel.php

$bundles = [
    new IP\StripeBundle\IPStripeBundle(),
];

Add bundle routes to app/config/routing.yml file

ip_stripe:
    resource: "@IPStripeBundle/Resources/config/routing.yml"
    prefix:   /stripe

Configure the bundle

# parameters.yml
stripe_public_key: 'your_public_stripe_key'
stripe_private_key: 'your_private_stripe_key'
amount: 1000
currency: usd

# config.yml
ip_stripe:
    public_key: "%stripe_public_key%"
    private_key: "%stripe_private_key%"
    amount: "%amount%"
    currency: "%currency%"
    view_template: "%view_template%"

Configure where to redirect after success payment

By default after success the bundle will redirect you to ip_stripe_success route. If you want to change this you just need to override the route_success parameter and set the correct route for you.

# parameters.yml
route_success: 'ip_stripe_success'

# config.yml
ip_stripe:
    route_success: "%route_success%"

Configure the success payment template

By default the success template is set to 'IPStripeBundle:Stripe:success.html.twig' twig template. To override it you just need to add success_template in your parameters.yml file.

# parameters.yml
success_template: 'IPStripeBundle:Stripe:success.html.twig'

# config.yml
ip_stripe:
    success_template: "%success_template%"

Change the stripe payment form template

By default the stripe payment form template is set to 'IPStripeBundle:Stripe:charge.html.twig' twig template. To override it you just need to add view_template in your parameters.yml file.

# parameters.yml
view_template: 'IPStripeBundle:Stripe:charge.html.twig'

# config.yml
ip_stripe:  
    view_template: "%view_template%"

Example: Overriding The Default layout.html.twig¶

It is highly recommended that you override the Resources/views/layout.html.twig template so that the pages provided by the IPStripeBundle have a similar look and feel to the rest of your application. The following Twig template file is an example of a layout file that might be used to override the one provided by the bundle.

{% extends 'layout.html.twig' %}

{% block title %}My Demo Application{% endblock %}

{% block ip_stripe_content %}
    {% include 'your_brand_new_form.html.twig' %}
{% endblock %}