Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ogone Payment Bundle Laravel Package

cedriclombardot/ogone-payment-bundle

View on GitHub
Deep Wiki
Context7

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 :

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

Configure your kernel

$bundles = array(
    new Cedriclombardot\OgonePaymentBundle\CedriclombardotOgonePaymentBundle(),
);

Configure ogone in config.yml

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

<?php

$client = OgoneClientQuery::create()
                       ->filterByEmail('[email protected]')
                       ->findOneOrCreate();
$client->save();

$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();

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

And the feedback :

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

Edit config.yml

cedriclombardot_ogone_payment:
    general:
        use_aliases: true

In your transaction controller

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

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle