2017 © Pedro Peláez
 

symfony-bundle ogone-payment-bundle

Ogone payment bundle, doctrine port

image

pilot/ogone-payment-bundle

Ogone payment bundle, doctrine port

  • Tuesday, June 23, 2015
  • by pilot
  • Repository
  • 2 Watchers
  • 2 Stars
  • 143 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Ogone payment bundle for ogone.com

Doctrine port of Cedriclombardot/OgonePaymentBundle, (*1)

Build Status, (*2)

Features

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

Todo

  • make part of original bundle with doctrine ORM option

Setup

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

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

Configure your kernel, (*4)

$bundles = array(
    new Pilot\OgonePaymentBundle\PilotOgonePaymentBundle(),
);

Configure ogone in config.yml, (*5)

pilot_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 the controller, (*6)

public function indexAction()
{
  $client = $this->getRepository('PilotOgonePaymentBundle:OgoneClient')->findOneBy(array(
      'email' => 'test@test.com',
  ));

  if (!$client) {
      $client = new OgoneClient();
      $client->setEmail('test@test.com');

      $this->getManager()->persist($client);
      $this->getManager()->flush();
  }

  $transaction = $this->get('ogone.transaction_builder')
      ->order()
          ->setClient($client)
          ->setAmount(99)
      ->end()
      ->configure()
          ->setBgColor('#ffffff')
          ->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()
  ;

  $transaction->save();

  $form = $transaction->getForm();

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

And the feedback:, (*7)

public function feedbackAction()
{
  if (!$this->get('ogone.feedbacker')->isValidCall()) {
      throw $this->createNotFoundException();
  }

  $this->get('ogone.feedbacker')->updateOrder();

  return $this->render(
      'PilotOgonePaymentBundle:Payment:feedback.html.twig'
  );
}

Alias managment

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

Update config.yml, (*9)

pilot_ogone_payment:
    general:
        use_aliases: true

In your transaction controller, (*10)

``` php // Client recuperation HERE, (*11)

// Transaction creation HERE, (*12)

$transaction->save();, (*13)

if ($this->container->getParameter('ogone.use_aliases')) { $alias = $this->getRepository('PilotOgonePaymentBundle:OgoneAlias')->findOneBy(array( 'client' => $client, 'operation' => OgoneAlias::OPERATION_BYMERCHANT, 'name' => 'ABONNEMENT', ));, (*14)

if (!$alias) {
    $alias = new OgoneAlias();
    $alias
        ->setClient($client)
        ->setOperation(OgoneAlias::OPERATION_BYMERCHANT)
        ->setStatus(OgoneAlias::STATUS_ACTIVE)
        ->setName('ABONNEMENT')
    ;

    $this->getManager()->persist($alias);
    $this->getManager()->flush();
}

$transaction->useAlias($alias);

}, (*15)

$form = $transaction->getForm();, (*16)

// render the view ```, (*17)

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

The Versions

23/06 2015

dev-master

9999999-dev

Ogone payment bundle, doctrine port

  Sources   Download

MIT

The Requires

 

The Development Requires

by Cedric LOMBARDOT
by Alex Demchenko

payment symfony2 bundle ogone

23/06 2015

1.0.0

1.0.0.0

Ogone payment bundle, doctrine port

  Sources   Download

MIT

The Requires

 

The Development Requires

by Cedric LOMBARDOT
by Alex Demchenko

payment symfony2 bundle ogone