Download the PHP package snowbaha/etransactions-bundle without Composer
On this page you can find all versions of the php package snowbaha/etransactions-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package etransactions-bundle
E-transactionsBundle
This bundle allows to implement a Payment Solution working with E-transactions for your symfony project. E-transactions is a payment proposed by the following bank "Crédit Agricole". Don't hesitate to contact me to improve it ;)
Installation
Step 1 : Import using Composer
Using composer :
Step 2 : Enable the plugin
Enable the bundle in the kernel:
Step 3 : Configure the bundle
Mandatory fields PARAMETER:
Mandatory fields CONFIG :
How to use
Controller
Create a Transaction
To initiate a new Transaction, you need to create an action in one of your controller and call the snowbaha.etransactions
service.
All mandatory fields are used with their default value. You can configure all the common fields of your transactions in the app/config/config.yml
file.
To see what fields are available see the PDF official doc.
Service Method
init($order_id, $amount, $email_buyer, $currency = 978)
allows you to specify the id, amount, email of buyer and the currency of the transaction.setOptionnalFields(array)
allows you to specify any field.
Example
Handle the response from the server
This route will be called by the E-Transactions service to update you about the payment status. This is the only way to correctly handle payment verfication.
Service Method:
responseBankServer(Request)
is used to update the transaction status (in database)- You will get a array with :
- sucessPayment: (should be true to validate the payment)
- amount: (your pbx_total var)
- ref: (your pbx_cmb var)
- error:E; (error with
00000
if nothing) - auto:A; (autorisation)
- sign:K (signature to check)
Example
Template
This is how the template for the payOnlineAction()
may look like. You can use the paiementForm
twig function to automatically generate the form based on the fields created in the service and returned by the getFields()
function.
LOG
When you will get an error with the payment, you can have more information with the log : ENV.etransaction.log