2017 © Pedro Peláez
 

symfony-bundle ogone-payment-bundle

Ogone payment bundle for symfony2

image

cedriclombardot/ogone-payment-bundle

Ogone payment bundle for symfony2

  • Wednesday, August 7, 2013
  • by cedriclombardot
  • Repository
  • 1 Watchers
  • 9 Stars
  • 1,669 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Ogone payment bundle, help you to make payment transactions with ogone and Symfony2 project status# build status

Features

  • Full featured sample controller
  • Simple transactions
  • Feedback managment
  • Alias managment

Comming

  • Batch operations

Setup

Add in your composer.json :, (*1)

"require": {
   "cedriclombardot/ogone-payment-bundle": "dev-master"
}

Configure your kernel, (*2)

``` php $bundles = array( new Cedriclombardot\OgonePaymentBundle\CedriclombardotOgonePaymentBundle(), );, (*3)


Configure ogone in config.yml ``` yaml cedriclombardot_ogone_payment: secret: shaInKey: Mysecretsig1875!? shaOutKey: Mysecretsig1875!? algorithm: sha512 general: PSPID: MyCompagny currency: EUR language: en_EN design: title: Give Me Your money - Payment page bgColor: "#4e84c4" txtColor: "#FFFFFF" tblBgColor: "#FFFFFF" buttonBgColor: "#00467F" buttonTxtColor: "#FFFFFF" fontType: "Verdana"

Creation of a transaction

In a controller, (*4)

``` php <?php, (*5)

$client = OgoneClientQuery::create() ->filterByEmail('test@test.com') ->findOneOrCreate(); $client->save();, (*6)

$transaction = $this->get('ogone.transaction_builder') ->order() ->setClient($client) ->setAmount(100) ->end() ->configure() ->setBgColor("red") ->setAcceptUrl($this->generateUrl('ogone_payment_feedback', array(), true)) ->setDeclineUrl($this->generateUrl('ogone_payment_feedback', array(), true)) ->setExceptionUrl($this->generateUrl('ogone_payment_feedback', array(), true)) ->setCancelUrl($this->generateUrl('ogone_payment_feedback', array(), true)) ->setBackUrl($this->generateUrl('ogone_payment_feedback', array(), true)) ->end() ; $form = $transaction->getForm();, (*7)

return $this->render( 'CedriclombardotOgonePaymentBundle:Payment:index.html.twig', array( 'form' => $form->createView(), ) );, (*8)



And the feedback : ``` php <?php public function feedbackAction() { if (!$this->get('ogone.feedbacker')->isValidCall()) { throw $this->createNotFoundException(); } $this->get('ogone.feedbacker')->updateOrder(); return $this->render( 'CedriclombardotOgonePaymentBundle:Payment:feedback.html.twig' ); }

Alias managment

You have Ogone premium account with alias option :, (*9)

Edit config.yml, (*10)

``` yaml cedriclombardot_ogone_payment: general: use_aliases: true, (*11)

In your transaction controller

``` php
// Client recuperation HERE

// Alias creation
if ($this->container->getParameter('ogone.use_aliases')) {
    $alias = OgoneAliasQuery::create()
               ->filterByOgoneClient($client)
               ->filterByOperation(OgoneAliasPeer::OPERATION_BYMERCHANT)
               ->filterByName('ABONNEMENT')
               ->findOneOrCreate();

   $alias->setLabel('Your abonnement');
   $alias->save();
}

// Transaction creation HERE

if ($this->container->getParameter('ogone.use_aliases')) {
    $transaction->useAlias($alias);
}

$form = $transaction->getForm();

// call the view

See a complete controller implementation here https://github.com/cedriclombardot/OgonePaymentBundle/blob/master/Controller/PaymentController.php, (*12)

The Versions

07/08 2013

dev-master

9999999-dev

Ogone payment bundle for symfony2

  Sources   Download

MIT

The Requires

 

by Cedric LOMBARDOT

payment symfony2 bundle ogone

08/06 2012

dev-feat-api-alias-manager

dev-feat-api-alias-manager

Ogone payment bundle for symfony2

  Sources   Download

MIT

The Requires

 

by Cedric LOMBARDOT

payment symfony2 bundle ogone