Copyright (c) 2008 Christophe Buguet
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Installation for sf 1.1
php symfony plugin:install sfPaymentCICPlugin --release=0.5.0
Installation for sf 1.0
php symfony plugin-install http://plugins.symfony-project.org/sfPaymentCICPlugin
PEAR
Download the PEAR package
Repository
Go to the repository: http://svn.symfony-project.com/plugins/sfPaymentCICPlugin
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
Usage
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');
Please refer to the CIC documentation provided by Crédit Mutuel / CIC.
Known limitations
- Allow to set more variables through YAML file