Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.

Commit

Permalink
Added stripe plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
rogergros authored and mmoreram committed Jun 8, 2015
1 parent a205e1f commit 8c09cff
Show file tree
Hide file tree
Showing 33 changed files with 671 additions and 124 deletions.
1 change: 1 addition & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public function registerBundles()
new Elcodi\Plugin\StoreTemplateBundle\StoreTemplateBundle(),
new Elcodi\Plugin\PaypalWebCheckoutBundle\ElcodiPaypalWebCheckoutBundle(),
new Elcodi\Plugin\FreePaymentBundle\ElcodiFreePaymentBundle(),
new Elcodi\Plugin\StripeBundle\ElcodiStripeBundle(),
);

if (in_array($this->getEnvironment(), array('dev', 'test'))) {
Expand Down
4 changes: 4 additions & 0 deletions app/Resources/translations/messages.ca.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
elcodi_plugin:
paypal_web_checkout:
name: Paypal
description: Integració de Paypal per a la teva botiga
4 changes: 4 additions & 0 deletions app/Resources/translations/messages.en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
elcodi_plugin:
paypal_web_checkout:
name: Paypal
description: Paypal integration for your shop
4 changes: 4 additions & 0 deletions app/Resources/translations/messages.es.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
elcodi_plugin:
paypal_web_checkout:
name: Paypal
description: Integración de Paypal para tu tienda
3 changes: 0 additions & 3 deletions app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ parameters:

paypal_web_checkout_recipient: payment-test-facilitator@elcodi.com

paymill_public_key: 2476404399006243aa65bb1ccd6c43f4
paymill_private_key: 56ebd85ae7479627a4f05efa445365d3

bamboo_admin_prefix: admin
bamboo_api_prefix: api
bamboo_store_firewall: store_area
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"knplabs/knp-gaufrette-bundle": "~0.1.0",
"paymentsuite/paymentsuite": "~1.5.0",
"paymentsuite/paypal-web-checkout-bundle": "~1.5.0",
"paymentsuite/stripe-bundle": "~1.5.0",
"incenteev/composer-parameter-handler": "~2.0",
"hwi/oauth-bundle": "0.4.*@dev",
"snc/redis-bundle": "^1.1.8",
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions src/Elcodi/Plugin/PaypalWebCheckoutBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"symfony/twig-bridge": "~2.6",
"twig/twig": "~1.16",
"sensio/framework-extra-bundle": "~3.0",
"paymentsuite/paypal-web-checkout-bundle": "~1.5.0",

"elcodi/core-bundle": "~0.5.0",
"elcodi/configuration-bundle": "~0.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,42 @@
{% include "@StoreTemplate/Modules/_checkout-progress.html.twig" with {"step": "3"} %}
</p>

<form id="form-payment-execute" action="" method="post">
{% if shippingRanges|length > 0 %}
<div class="form form-checkout">
{% set actualShippingRange = cart.shippingRange.id %}
<div class="grid grid-pad">
<h2>{{ 'template.store_template_bundle.checkout.payment.shipping_carrier_method'|trans }}</h2>
{% for shippingRange in shippingRanges %}
{% if shippingRange.id == actualShippingRange %}
<div class="col-1-3"><i class="fa fa-caret-right"></i> <strong>{{ shippingRange.carrier.name }} - {{ shippingRange.price|print_convert_money }}</strong></div>
{% else %}
<div class="col-1-3"><a href="{{ url("store_checkout_shipping_range_apply", {
'rangeId': shippingRange.id
}) }}">
{{ shippingRange.carrier.name }} - {{ shippingRange.price|print_convert_money }}
</a></div>
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
<div class="form form-checkout">
{% for paymentMethod in elcodi_payment_methods() %}

{% set paymentMethodName = paymentMethod.name %}
{% if paymentMethod.url %}
<a href="{{ paymentMethod.url }}">{{ paymentMethodName|trans }}</a>
{% if shippingRanges|length > 0 %}
<div class="form form-checkout">
{% set actualShippingRange = cart.shippingRange.id %}
<div class="grid grid-pad">
<h2>{{ 'template.store_template_bundle.checkout.payment.shipping_carrier_method'|trans }}</h2>
{% for shippingRange in shippingRanges %}
{% if shippingRange.id == actualShippingRange %}
<div class="col-1-3"><i class="fa fa-caret-right"></i> <strong>{{ shippingRange.carrier.name }} - {{ shippingRange.price|print_convert_money }}</strong></div>
{% else %}
<details>
<summary>{{ paymentMethodName|trans }}</summary>
<div class="payment-wrapper">
{{ paymentMethod.script }}
</div>
</details>
<div class="col-1-3"><a href="{{ url("store_checkout_shipping_range_apply", {
'rangeId': shippingRange.id
}) }}">
{{ shippingRange.carrier.name }} - {{ shippingRange.price|print_convert_money }}
</a></div>
{% endif %}

{% endfor %}
</div>
</form>
</div>
</div>
{% endif %}
<div class="form form-checkout">
{% for paymentMethod in elcodi_payment_methods() %}

{% set paymentMethodName = paymentMethod.name %}
{% if paymentMethod.url %}
<a href="{{ paymentMethod.url }}">{{ paymentMethodName|trans }}</a>
{% else %}
<details>
<summary>{{ paymentMethodName|trans }}</summary>
<div class="payment-wrapper">
{{ paymentMethod.script|raw }}
</div>
</details>
{% endif %}

{% endfor %}
</div>

<p class="checkout-actions checkout-actions-bottom">
<a class="button" href="{{ url('store_checkout_address') }}"> <i class="fa fa-arrow-left"></i> {{ 'template.store_template_bundle.checkout.back'|trans }}</a>
Expand Down
10 changes: 10 additions & 0 deletions src/Elcodi/Plugin/StripeBundle/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; top-most EditorConfig file
root = true

; Unix-style newlines
[*]
end_of_line = LF

[*.php]
indent_style = space
indent_size = 4
23 changes: 23 additions & 0 deletions src/Elcodi/Plugin/StripeBundle/.formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use-sort:
group:
- _main
- Elcodi
group-type: each
sort-type: alph
sort-direction: asc

header: |
/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014-2015 Elcodi.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Feel free to edit as you please, and have fun.
*
* @author Marc Morera <yuhu@mmoreram.com>
* @author Aldo Chiecchia <zimage@tiscali.it>
* @author Elcodi Team <tech@elcodi.com>
*/
4 changes: 4 additions & 0 deletions src/Elcodi/Plugin/StripeBundle/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vendor
composer.phar
composer.lock
phpunit.xml
17 changes: 17 additions & 0 deletions src/Elcodi/Plugin/StripeBundle/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Contributing
------------

This project follows some standards. If you want to collaborate, please ensure
that your code fulfills these standards before any Pull Request.

``` bash
composer.phar update
bin/php-cs-fixer fix
bin/php-formatter formatter:use:sort src/
bin/php-formatter formatter:header:fix src/
```

There is also a policy for contributing to this project. Pull requests must
be explained step by step to make the review process easy in order to
accept and merge them. New features must come paired with Unit and/or Functional
tests.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014-2015 Elcodi.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Feel free to edit as you please, and have fun.
*
* @author Marc Morera <yuhu@mmoreram.com>
* @author Aldo Chiecchia <zimage@tiscali.it>
* @author Elcodi Team <tech@elcodi.com>
*/

namespace Elcodi\Plugin\StripeBundle\DependencyInjection;

use Elcodi\Bundle\CoreBundle\DependencyInjection\Abstracts\AbstractExtension;

/**
* Class ElcodiStripeExtension
*/
class ElcodiStripeExtension extends AbstractExtension
{
/**
* @var string
*
* Extension name
*/
const EXTENSION_NAME = 'elcodi_stripe';

/**
* Get the Config file location
*
* @return string Config file location
*/
public function getConfigFilesLocation()
{
return __DIR__ . '/../Resources/config';
}

/**
* Config files to load
*
* @param array $config Config array
*
* @return array Config files
*/
public function getConfigFiles(array $config)
{
return [
'services',
'eventListeners',
];
}

/**
* Returns the extension alias, same value as extension name
*
* @return string The alias
*/
public function getAlias()
{
return static::EXTENSION_NAME;
}
}
Loading

0 comments on commit 8c09cff

Please sign in to comment.