2017 © Pedro Peláez
 

symfony-bundle payplug-bundle

Payplug integration to symfony2

image

alcalyn/payplug-bundle

Payplug integration to symfony2

  • Friday, August 25, 2017
  • by alcalyn
  • Repository
  • 4 Watchers
  • 7 Stars
  • 652 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 19 Versions
  • 1 % Grown

The README.md

AlcalynPayplugBundle

Payplug integration to symfony2., (*1)

Latest Stable Version Scrutinizer Code Quality SensioLabsInsight Build Status License, (*2)

Installation

Step 1: Download using composer

``` js { "require": { "alcalyn/payplug-bundle": "1.x" } }, (*3)


Update your composer. ``` bash php composer.phar update

Step 2: Register the Bundle

``` php <?php // app/AppKernel.php, (*4)

public function registerBundles()
{
    $bundles = array(
        // ...
        new Alcalyn\PayplugBundle\AlcalynPayplugBundle(),
    );
}


### Step 3: Import Payplug IPN route To create payments and process IPNs, the bundle need to have its routes enabled. Add this to **app/config/routing.yml**: ``` yml # Payplug routing alcalyn_payplug: resource: "@AlcalynPayplugBundle/Resources/config/routing.yml" prefix: /

Step 4: Configure the bundle and your account settings

Add these lines to your config.yml:, (*5)

``` yaml, (*6)

Payplug configuration

alcalyn_payplug: account: url: %payplug_account_url% amount_min: %payplug_account_amount_min% amount_max: %payplug_account_amount_max% currencies: %payplug_account_currencies% payplugPublicKey: %payplug_account_payplugPublicKey% yourPrivateKey: %payplug_account_yourPrivateKey%, (*7)


And these lines into **parameters.yml**, and optionally into **parameters.yml.dist**: ``` yaml payplug_account_url: ~ payplug_account_amount_min: ~ payplug_account_amount_max: ~ payplug_account_currencies: ~ payplug_account_payplugPublicKey: ~ payplug_account_yourPrivateKey: ~

Then run this command to load your Payplug account settings:, (*8)

``` bash php app/console payplug:account:update, (*9)


(*Your Payplug email and password will be prompted*) > **Warning**: > > Be sure to never commit your account settings by commiting your **parameters.yml** See [Payplug documentation](http://payplug-developer-documentation.readthedocs.org/en/latest/#configuration) for more informations about account configuration. > **Note**: > > This command uses curl to load your account parameters from https://www.payplug.fr/portal/ecommerce/autoconfig > > **If the command fails**, go to https://www.payplug.fr/portal/ecommerce/autoconfig > and copy/paste your parameters manually. > > Your parameters.yml should looks like this: > [parameters.yml.example](https://github.com/alcalyn/payplug-bundle/blob/master/Resources/doc/parameters.yml.example) You can also [configure your TEST mode](https://github.com/alcalyn/payplug-bundle/blob/master/Resources/doc/test_mode.md). ## Basic usage: ### Generating payment url: ``` php <?php use Alcalyn\PayplugBundle\Model\Payment; // ... public function wtfAction() { // Create a payment of 16 € $payment = new Payment(1600, Payment::EUROS); // Get Payplug payment service $payplugPayment = $this->get('payplug.payment'); // Generate url $payplugPayment->generateUrl($payment); // returns "https://www.payplug.fr/p/aca8...ef?data=...&sign=..." }

Treat IPNs

AlcalynPayplugBundle dispatches PayplugIPNEvent when an IPN is received., (*10)

This event contains an instance of IPN that you can access by calling PayplugIPNEvent::getIPN()., (*11)

So listen it like that:, (*12)

  • Create the listener class:

``` php <?php // src/Acme/AcmeBundle/EventListener/PaymentListener.php, (*13)

namespace Acme\AcmeBundle\EventListener;, (*14)

use Alcalyn\PayplugBundle\Event\PayplugIPNEvent;, (*15)

class PaymentListener { /** * @param PayplugIPNEvent $event */ public function onPayment(PayplugIPNEvent $event) { $ipn = $event->getIPN();, (*16)

    // treat $ipn
}

}, (*17)


- Register your listener: ``` yaml # src/Acme/AcmeBundle/Resources/services.yml services: acme.listeners.payment: class: Acme\AcmeBundle\EventListener\PaymentListener tags: - { name: kernel.event_listener, event: event.payplug.ipn, method: onPayment }

Advanced usage:

License

This bundle is under the MIT license. See the complete license:, (*18)

Resources/meta/LICENSE, (*19)

The Versions

25/08 2017

dev-master

9999999-dev https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

payment symfony-bundle payplug

09/12 2015

v1.2.5

1.2.5.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

payment symfony-bundle payplug

15/05 2015

v1.2.4

1.2.4.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

payment symfony-bundle payplug

07/11 2014

v1.2.3

1.2.3.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

payment symfony-bundle payplug

31/10 2014

v1.2.2

1.2.2.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

payment symfony-bundle payplug

28/10 2014

v1.2.1

1.2.1.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

payment symfony-bundle payplug

27/10 2014

v1.2

1.2.0.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

payment symfony-bundle payplug

17/10 2014

v1.1

1.1.0.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

payment symfony-bundle payplug

07/10 2014

v1.0

1.0.0.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

payment symfony-bundle payplug

30/09 2014

v0.9.3

0.9.3.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

payment symfony-bundle payplug

30/09 2014

v0.9.2

0.9.2.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

payment symfony-bundle payplug

26/09 2014

v0.9.1

0.9.1.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

payment symfony-bundle payplug

14/09 2014

v0.9

0.9.0.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

payment symfony-bundle payplug

29/08 2014

v0.8.3

0.8.3.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

payment symfony-bundle payplug

28/08 2014

v0.8.2

0.8.2.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

payment symfony-bundle payplug

27/08 2014

v0.8.1

0.8.1.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

payment symfony-bundle payplug

27/08 2014

v0.8

0.8.0.0 https://github.com/alcalyn/payplug-bundle

Payplug integration to symfony2

  Sources   Download

MIT

The Requires

 

payment symfony-bundle payplug