230,783 Installs and Counting! Get Sparks Now!
Hey! Keep up to date with the project through its beta and public launch by following @getsparks.
Tweet
A Quick Looks At Sparks (EllisLab Official Post)
March 11, 2012
from: codeigniter.com
The Top Sparks of 2011
December 31, 2011
from: codefury.net
CodeIgniter Starter Project − A Starting Point for Any CI Dev
December 12, 2011
from: github.com
NetTuts+ Tutorial for GetSparks
November 24, 2011
from: net.tutsplus.com
Spark to use the Realex Payments RealAuth service
| Contributor | : seandowney |
| : Log in to view | |
| Author Website | : |
| Spark Website | : https://bitbucket.org/seandowney/realex_payments |
| Repository Type | : hg |
| Number of Installs | : 1,146 |
php tools/spark install -v0.7.0 realex-payments
Or download this version manually:
Get realex-payments-0.7.0.zip
Realex Payments is an online payments provider which provides a solution which does not require the merchant to have their own secure server. The Realex Payments Spark provides an easy to use library to get up an running with Realex very quickly.
Note: Realex Payments is fully PCI compliant to the highest level of PCI, allowing redirect integration which significantly reduces the merchants PCI compliance requirements. Remote integration merchants will need to be fully compliant with PCI.
In sparks/realex-payments/config/realex_payments.php you will find the preferences for connecting to your Realex account. The config file is well commented.
In sparks/realex-payments/language/english/realex_payments.php you will find the English language messages used in the form and response view files.
function __construct(){
parent::__construct();
// load the Realex Payments spark
$this->load->spark( 'realex-payments/[version #]');
}
function index(){
// setup the details of the form
$this->realex_payments->set_field('form_name', 'realex_form')
->set_field('form_id', 'realex_id')
->set_field('currency', 'EUR')
->set_button_delimiters('<div>', '</div>');
// set specific order details
$this->realex_payments->set_field('customer_num', 'cust123')
->set_field('product_id', 'PRO-1234')
->set_field('comment1', 'This is a comment about the order')
->set_field('comment2', 'This is another comment');
// display the form - passing in the order_id and amount
echo $this->realex_payments->return_form('ORD-1231', '1200');
}
function payment_response()
{
// get the Post details and return in a usable format
$response_array = $this->realex_payments->return_response_status();
// Check if the payment was successful
if( !empty($response_array['success']) ) {
// perform any database updates
// display the success view
$this->load->view('success', $response_array);
}
else {
switch ($response_array['error'])
{
case 'PAYMENT_FAILURE':
$response_array['failure_message'] = $this->_payment_failure($response_array);
break;
case 'HASH_MISMATCH':
$response_array['failure_message'] = $this->CI->lang->line( 'realex_payments_response_hash_mismatch' );
break;
default:
$response_array['failure_message'] = $this->CI->lang->line( 'realex_payments_response_no_data' );
break;
}
// perform any database updates
// display the failure view
$this->load->view('failure', $response_array);
}
}
function _payment_failure($response_array)
{
$failure_message = '';
switch ($response_array->cause)
{
case 'DECLINED':
$failure_message = $this->CI->lang->line( 'realex_response_declined' );
break;
case 'LOST_STOLEN':
$failure_message = $this->CI->lang->line( 'realex_response_lost_stolen' );
break;
case 'BANK_ERROR':
$failure_message = $this->CI->lang->line( 'realex_response_bank_error' );
break;
case 'PAYMENT_SYSTEM_ERROR':
$failure_message = $this->CI->lang->line( 'realex_response_payment_system_error' );
break;
default:
$failure_message = $this->CI->lang->line( 'realex_response_other_error' );
break;
}
return $failure_message;
}
You can edit the success and failure view files. It is advisable that all returned data is Not displayed to the user.
php tools/spark install -v0.6.0 realex-payments
Or download this version manually:
Get realex-payments-v0.6.0.zip
php tools/spark install -v0.5.0 realex-payments
Or download this version manually:
Get realex-payments-v0.5.0.zip