2017 © Pedro PelĂĄez
 

symfony-bundle stripe-bundle

Stripe bundle

image

iulyanp/stripe-bundle

Stripe bundle

  • Sunday, July 3, 2016
  • by iulyanp
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

IPStripeBundle

This is a symfony bundle that implements payment with Stripe library., (*1)

Requirements

The version 0.1.0 requires that you'll have already installed AsseticBundle., (*2)

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., (*3)

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., (*4)

# 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., (*5)

# 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., (*6)

# 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., (*7)

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

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

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

The Versions

03/07 2016

dev-master

9999999-dev

Stripe bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Iulian Popa

03/07 2016