sfPaymentCICPlugin - 0.5.0

CIC/Crédit Mutuel payment module integration into Symfony

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source | Show as Markdown

sfPaymentCIC plugin

The sfPaymentCIC is a symfony plugin that provides P@iementCIC module for Symfony applications. Additional checkings and return code handling are done to provide a better comfort with API calls.

Installation

  • Install the plugin

    symfony plugin-install http://plugins.symfony-project.com/sfPaymentCICPlugin
    
  • Clear your cache

    symfony cc
    

Usage

  • Merchant parameters

Edit the app.yml and add these parameters with your information :

  • the bank HTTPS page provided

  • the currency

  • the Electronic Payment Gateway (TPE) information

    all:
      cic_payment:
        request_url:  https://ssl.paiement.cic-banques.fr/test/paiement.cgi
        return_url:   http://example.org/index.php
        passphrase:   PassPhraseHere
        currencies:   [EUR]
        submit_label: Go to payment
        tpe: 
          number:     1234567
          key:        YourKeyHere
          company:    mycompany
    
  • Symfony specific

The plugin provides the ability to redirect to your own actions once the payment return has been checked.

In your app.yml, simply add the module/action for both return cases (good or error) and user redirection after payment :

    all:
      cic_payment:
        response_ok:  mymodule/mybankok
        response_nok: mymodule/mybanknok
        user_return:  mymodule/myactionok
        user_cancel:  mymodule/myactionnok
  • Transferring information to the CIC payment

Once you're ready to transfer information to the payment, set a redirect to sfPaymentSIPS/request in your module and provide three parameters through sfUser object :

    $this->getUser()->setParameter('amount', '14.00', 'cic_payment');    
    $this->getUser()->setParameter('currency', 'EUR', 'cic_payment');    
    $this->getUser()->setParameter('order_id', '145', 'cic_payment');

    $this->forward('sfPaymentCIC', 'request');    
  • Handling CIC payment return

sfPaymentCIC/response handles the bank return code and transfers to the module/Action you have specified. In your custom action, it is possible to get the instance of the sfPaymentCIC class containing the detailed bank information, with ability to get a verbose message as specified in the original documentation.

     $cicPayment = $this->getUser()->getParameter('payment', null, 'cic_payment');
  • Further information

Please refer to the CIC documentation provided by Crédit Mutuel / CIC.

Known limitations

  • Allow to set more variables through YAML file