Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Symfony2 bundle for Payplug
https://github.com/alcalyn/payplug-bundle

github-evacuee payplug symfony

Last synced: 3 months ago
JSON representation

Symfony2 bundle for Payplug

Awesome Lists containing this project

README

        

AlcalynPayplugBundle
====================

[Payplug](https://www.payplug.fr/) integration to symfony2.

[![Latest Stable Version](https://poser.pugx.org/alcalyn/payplug-bundle/v/stable.svg)](https://packagist.org/packages/alcalyn/payplug-bundle)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/alcalyn/payplug-bundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/alcalyn/payplug-bundle/?branch=master)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/5db1af60-63e4-40a6-bb5a-671725d9ac73/mini.png)](https://insight.sensiolabs.com/projects/5db1af60-63e4-40a6-bb5a-671725d9ac73)
[![Build Status](https://travis-ci.org/alcalyn/payplug-bundle.svg?branch=master)](https://travis-ci.org/alcalyn/payplug-bundle)
[![License](https://poser.pugx.org/alcalyn/payplug-bundle/license.svg)](https://packagist.org/packages/alcalyn/payplug-bundle)

## Installation

### Step 1: Download using composer

``` js
{
"require": {
"alcalyn/payplug-bundle": "1.x"
}
}
```

Update your composer.

``` bash
php composer.phar update
```

### Step 2: Register the Bundle

``` php
**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
get('payplug.payment');

// Generate url
$payplugPayment->generateUrl($payment); // returns "https://www.payplug.fr/p/aca8...ef?data=...&sign=..."
}
```

### Treat IPNs

AlcalynPayplugBundle dispatches
[PayplugIPNEvent](https://github.com/alcalyn/payplug-bundle/blob/master/Event/PayplugIPNEvent.php)
when an IPN is received.

This event contains an instance of [IPN](https://github.com/alcalyn/payplug-bundle/blob/master/Model/IPN.php)
that you can access by calling **PayplugIPNEvent::getIPN()**.

So listen it like that:

- Create the listener class:

``` php
getIPN();

// treat $ipn
}
}
```

- 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:

- [Use TEST mode](https://github.com/alcalyn/payplug-bundle/blob/master/Resources/doc/test_mode.md)
- [Extend IPN class](https://github.com/alcalyn/payplug-bundle/blob/master/Resources/doc/extend_ipn.md)
- [Listen to malformed IPN](https://github.com/alcalyn/payplug-bundle/blob/master/Resources/doc/malformed_ipn.md)
- [Generate payment Url from command](https://github.com/alcalyn/payplug-bundle/blob/master/Resources/doc/generate_url_command.md)
- [Simulate an IPN from command](https://github.com/alcalyn/payplug-bundle/blob/master/Resources/doc/simulate_ipn_command.md)

## License

This bundle is under the MIT license. See the complete license:

[Resources/meta/LICENSE](https://github.com/alcalyn/payplug-bundle/blob/master/Resources/meta/LICENSE)