" /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> " /> Header(array('fields' => 'Fields', 'settings' => 'Settings', 'help' => 'Help'), 'lr_sender_config_{n}'); ?> tabStart('fields'); ?> input('action_lr_sender_{n}_lr_acc_config', array('type' => 'text', 'label' => "Liberty Account ID", 'class' => 'medium_input', 'smalldesc' => 'ex: U1234567, X3214567')); ?> input('action_lr_sender_{n}_lr_store_config', array('type' => 'text', 'label' => "Your Store Name", 'class' => 'medium_input', 'smalldesc' => 'ex: Wallmart')); ?> input('action_lr_sender_{n}_lr_currency_config', array('type' => 'text', 'label' => "Currency", 'class' => 'medium_input', 'smalldesc' => 'ex: LRUSD for US Dollars, LREUR for Euro')); ?> input('action_lr_sender_{n}_lr_merchant_ref_config', array('type' => 'text', 'label' => "Merchant Reference", 'class' => 'medium_input', 'smalldesc' => 'Here we would like to use FP_User_id. So that we know which user send us money')); ?> input('action_lr_sender_{n}_lr_comments_config', array('type' => 'text', 'label' => "LR Comments", 'class' => 'medium_input', 'smalldesc' => 'If FP_User want to write his own message.')); ?> input('action_lr_sender_{n}_lr_success_url', array('type' => 'text', 'label' => "on Success URL", 'class' => 'medium_input', 'smalldesc' => 'Enter the page you wish your customers to go after a successful payment. ex: http://www.forbiddenpalace.tk/success.html')); ?> input('action_lr_sender_{n}_lr_success_url_method', array('type' => 'text', 'label' => "on Success Transaction Method", 'class' => 'medium_input', 'smalldesc' => 'POST or GET')); ?> input('action_lr_sender_{n}_lr_fail_url', array('type' => 'text', 'label' => "On Failure URL", 'class' => 'medium_input', 'smalldesc' => 'Enter the page you wish your customers to go after a successful payment. ex: http://www.forbiddenpalace.tk/fail.html')); ?> input('action_lr_sender_{n}_lr_fail_url_method', array('type' => 'text', 'label' => "on Failure Transaction Method", 'class' => 'medium_input', 'smalldesc' => 'POST or GET')); ?> input('action_lr_sender_{n}_lr_status_url', array('type' => 'text', 'label' => "Status URL", 'class' => 'medium_input', 'smalldesc' => 'Examples: http://www.example.com/status.php, mailto:mymail@example.com. ')); ?> input('action_lr_sender_{n}_lr_status_url_method', array('type' => 'text', 'label' => "Status URL Method", 'class' => 'medium_input', 'smalldesc' => 'ex: POST or GET')); ?> input('action_lr_sender_{n}_lr_field1', array('type' => 'text', 'label' => "Additional Field 1", 'class' => 'medium_input', 'smalldesc' => 'You may send additional passthrough information that will be returned to you and will not be stored anywhere in Librty Reserve system. This may include order numbers, customer user names or any other data. You will need to specify the field name and the field value. Information limited to 50 characters.')); ?> input('action_lr_sender_{n}_lr_field2', array('type' => 'text', 'label' => "Additional Field 2", 'class' => 'medium_input', 'smalldesc' => 'You may send additional passthrough information that will be returned to you and will not be stored anywhere in Librty Reserve system. This may include order numbers, customer user names or any other data. You will need to specify the field name and the field value. Information limited to 50 characters.')); ?> input('action_lr_sender_{n}_lr_field3', array('type' => 'text', 'label' => "Additional Field 3", 'class' => 'medium_input', 'smalldesc' => 'You may send additional passthrough information that will be returned to you and will not be stored anywhere in Librty Reserve system. This may include order numbers, customer user names or any other data. You will need to specify the field name and the field value. Information limited to 50 characters.')); ?> tabEnd(); ?> tabStart('settings'); ?> tabEnd(); ?> tabStart('help'); ?> This plugin will communicate with the Liberty Reserve server, you must have a Liberty Reserve Account in order to be able to use this one. Map your form fields names to the fields required by Liberty Reserve, no spaces should be in the fields name. Enter your Libert Reserve account settings. Once triggered, this action will redirect the user to the Libert Reserve servers for payment. For more documentation about the LR parameters, please search the Liberty Reserve website for http://www.libertyreserve.com/en/paymentform. tabEnd(); ?>Please can you point out where I am going wrong.RegardsHassan"> Adding New Payment Processor - LR Sender + Listener - Forums

Forums

Adding New Payment Processor - LR Sender + Listener

codeslayer 26 Aug, 2011
Hi,

I am trying to make a new payment processor called Liberty Reserve.
I copied the files from Administrator/components/com_hronoforms/form_actions/2co_sender to Lr_Sender folder. Edited the the php and ctp file to match the fields to be acceptables by Liberty Reserve SCI Servers. Now my Liberty Reserever Sender is showing on ChronoForm in Advanced Wizard > Actions > Payment Gateways/Processors. Dragged it on my Onload Event. In the edit windows set all the paramenters. But out of 14 fileds only 5 can save be saved and remaining fields remain blank.

Following is the code I am using:

lr_sender.php

<?php
/**
* CHRONOFORMS version 4.0
* Copyright (c) 2006 - 2011 Chrono_Man, ChronoEngine.com. All rights reserved.
* Author: Chrono_Man (ChronoEngine.com)
* @license		GNU/GPL
* Visit http://www.ChronoEngine.com for regular updates and information.
* Liberty Reserve Payment Gateway Plugin by CodeSlayer. Created, modifying Original 2Co Payment Processor by Chrono_Man
**/
class CfactionLRSender{
	var $formname;
	var $formid;
	var $group = array('id' => 'payments', 'title' => 'Payment Gateways/Processors');
	var $events = array('success' => 0, 'fail' => 0);
	var $details = array('title' => 'Liberty Reserve Sender', 'tooltip' => 'Communicate with the Liberty Reserve payment gateway.');
	
	function run($form, $actiondata){
		$params = new JParameter($actiondata->params);
		global $mainframe;
		
		$checkout_values = array(
			//variables
			'lr_acc' => $form->data[$params->get('lr_acc')],
			'lr_store' => $form->data[$params->get('lr_store')],
			'lr_currency' => $form->data[$params->get('lr_currency')],
			'lr_merchant_ref' => $form->data[$params->get('lr_merchant_ref')],
			'lr_comments' => $form->data[$params->get('lr_comments')],
			'lr_success_url' => $form->data[$params->get('lr_success_url')],
			'lr_success_url_method' => $form->data[$params->get('lr_success_url_method')],
			'lr_fail_url' => $form->data[$params->get('lr_fail_url')],
			'lr_fail_url_method' => $form->data[$params->get('lr_fail_url_method')],
			'lr_status_url' => $form->data[$params->get('lr_status_url')],
			'lr_status_url_method' => $form->data[$params->get('lr_status_url_method')],
			'lr_field1' => $form->data[$params->get('lr_field1')],
			'lr_field2' => $form->data[$params->get('lr_field2')],
			'lr_field3' => $form->data[$params->get('lr_field3')],
		
		);
		
	}
	
	function load($clear){
		if($clear){
			$action_params = array(
				'lr_acc' =>  '',
				'lr_store' => '',
				'lr_currency' => '',
				'lr_merchant_ref' => '',
				'lr_comments' => '',
				'lr_success_url' => '',
				'lr_success_url_method' => '',
				'lr_fail_url' => '',
				'lr_fail_url_method' => '',
				'lr_status_url' => '',
				'lr_status_url_method' => '',
				'lr_field1' => '',
				'lr_field2' => '',
				'lr_field3' => '',				

			);
		}
		return array('action_params' => $action_params);
	}
	
}
?>




And

lr_sender.ctp
<?php
require_once(JPATH_SITE.DS."administrator".DS."components".DS."com_chronoforms".DS."helpers".DS."tabs_helper.php");
$PluginTabsHelper = new TabsHelper();
?>
<div class="dragable" id="cfaction_lr_sender">Liberty Reserve Sender</div>
<!--start_element_code-->
<div class="element_code" id="cfaction_lr_sender_element">
	<label class="action_label">lr Sender</label>

	<input type="hidden" name="chronoaction[{n}][action_lr_sender_{n}_lr_acc]" id="action_lr_sender_{n}_lr_acc" value="<?php echo $action_params['lr_acc']; ?>" />
	<input type="hidden" name="chronoaction[{n}][action_lr_sender_{n}_lr_store]" id="action_lr_sender_{n}_lr_store" value="<?php echo $action_params['lr_store']; ?>" />
	<input type="hidden" name="chronoaction[{n}][action_lr_sender_{n}_lr_currency]" id="action_lr_sender_{n}_lr_currency" value="<?php echo $action_params['lr_currency']; ?>" />
	<input type="hidden" name="chronoaction[{n}][action_lr_sender_{n}_lr_merchant_ref]" id="action_lr_sender_{n}_lr_merchant_ref" value="<?php echo $action_params['lr_merchant_ref']; ?>" />
	<input type="hidden" name="chronoaction[{n}][action_lr_sender_{n}_lr_comments]" id="action_lr_sender_{n}_lr_comments" value="<?php echo $action_params['lr_comments']; ?>" />
	
	<input type="hidden" name="chronoaction[{n}][action_lr_sender_{n}_lr_success_url]" id="action_lr_sender_{n}_lr_success_url" value="<?php echo $action_params['lr_success_url']; ?>" />
	<input type="hidden" name="chronoaction[{n}][action_lr_sender_{n}_lr_success_url_method]" id="action_lr_sender_{n}_lr_success_url_method" value="<?php echo $action_params['lr_success_url_method']; ?>" />
	<input type="hidden" name="chronoaction[{n}][action_lr_sender_{n}_lr_fail_url]" id="action_lr_sender_{n}_lr_fail_url" value="<?php echo $action_params['lr_fail_url']; ?>" />
	<input type="hidden" name="chronoaction[{n}][action_lr_sender_{n}_lr_fail_url_method]" id="action_lr_sender_{n}_lr_fail_url_method" value="<?php echo $action_params['lr_fail_url_method']; ?>" />
	<input type="hidden" name="chronoaction[{n}][action_lr_sender_{n}_lr_status_url]" id="action_lr_sender_{n}_lr_status_url" value="<?php echo $action_params['lr_status_url']; ?>" />
	<input type="hidden" name="chronoaction[{n}][action_lr_sender_{n}_lr_status_url_method]" id="action_lr_sender_{n}_lr_status_url_method" value="<?php echo $action_params['lr_status_url_method']; ?>" />
	<input type="hidden" name="chronoaction[{n}][action_lr_sender_{n}_lr_field1]" id="action_lr_sender_{n}_lr_field1" value="<?php echo $action_params['lr_field1']; ?>" />
	<input type="hidden" name="chronoaction[{n}][action_lr_sender_{n}_lr_field2]" id="action_lr_sender_{n}_lr_field2" value="<?php echo $action_params['lr_field2']; ?>" />
	<input type="hidden" name="chronoaction[{n}][action_lr_sender_{n}_lr_field3]" id="action_lr_sender_{n}_lr_field3" value="<?php echo $action_params['lr_field3']; ?>" />

    <input type="hidden" id="chronoaction_id_{n}" name="chronoaction_id[{n}]" value="{n}" />
	<input type="hidden" name="chronoaction[{n}][type]" value="lr_sender" />
</div>
<!--end_element_code-->

<div class="element_config" id="cfaction_lr_sender_element_config">
	<?php echo $PluginTabsHelper->Header(array('fields' => 'Fields', 'settings' => 'Settings', 'help' => 'Help'), 'lr_sender_config_{n}'); ?>
	<?php echo $PluginTabsHelper->tabStart('fields'); ?>
		<?php echo $HtmlHelper->input('action_lr_sender_{n}_lr_acc_config', array('type' => 'text', 'label' => "Liberty Account ID", 'class' => 'medium_input', 'smalldesc' => 'ex: U1234567, X3214567')); ?>
		<?php echo $HtmlHelper->input('action_lr_sender_{n}_lr_store_config', array('type' => 'text', 'label' => "Your Store Name", 'class' => 'medium_input', 'smalldesc' => 'ex: Wallmart')); ?>
		<?php echo $HtmlHelper->input('action_lr_sender_{n}_lr_currency_config', array('type' => 'text', 'label' => "Currency", 'class' => 'medium_input', 'smalldesc' => 'ex: LRUSD for US Dollars, LREUR for Euro')); ?>
		<?php echo $HtmlHelper->input('action_lr_sender_{n}_lr_merchant_ref_config', array('type' => 'text', 'label' => "Merchant Reference", 'class' => 'medium_input', 'smalldesc' => 'Here we would like to use FP_User_id. So that we know which user send us money')); ?>
		<?php echo $HtmlHelper->input('action_lr_sender_{n}_lr_comments_config', array('type' => 'text', 'label' => "LR Comments", 'class' => 'medium_input', 'smalldesc' => 'If FP_User want to write his own message.')); ?>
		
		<?php echo $HtmlHelper->input('action_lr_sender_{n}_lr_success_url', array('type' => 'text', 'label' => "on Success URL", 'class' => 'medium_input', 'smalldesc' => 'Enter the page you wish your customers to go after a successful payment. ex: http://www.forbiddenpalace.tk/success.html')); ?>
		<?php echo $HtmlHelper->input('action_lr_sender_{n}_lr_success_url_method', array('type' => 'text', 'label' => "on Success Transaction Method", 'class' => 'medium_input', 'smalldesc' => 'POST or GET')); ?>
		<?php echo $HtmlHelper->input('action_lr_sender_{n}_lr_fail_url', array('type' => 'text', 'label' => "On Failure URL", 'class' => 'medium_input', 'smalldesc' => 'Enter the page you wish your customers to go after a successful payment. ex: http://www.forbiddenpalace.tk/fail.html')); ?>
		<?php echo $HtmlHelper->input('action_lr_sender_{n}_lr_fail_url_method', array('type' => 'text', 'label' => "on Failure Transaction Method", 'class' => 'medium_input', 'smalldesc' => 'POST or GET')); ?>
		<?php echo $HtmlHelper->input('action_lr_sender_{n}_lr_status_url', array('type' => 'text', 'label' => "Status URL", 'class' => 'medium_input', 'smalldesc' => 'Examples: http://www.example.com/status.php, mailto:mymail@example.com. ')); ?>
		<?php echo $HtmlHelper->input('action_lr_sender_{n}_lr_status_url_method', array('type' => 'text', 'label' => "Status URL Method", 'class' => 'medium_input', 'smalldesc' => 'ex: POST or GET')); ?>
		<?php echo $HtmlHelper->input('action_lr_sender_{n}_lr_field1', array('type' => 'text', 'label' => "Additional Field 1", 'class' => 'medium_input', 'smalldesc' => 'You may send additional passthrough information that will be returned to you and will not be stored anywhere in Librty Reserve system. This may include order numbers, customer user names or any other data. You will need to specify the field name and the field value. Information limited to 50 characters.')); ?>
		<?php echo $HtmlHelper->input('action_lr_sender_{n}_lr_field2', array('type' => 'text', 'label' => "Additional Field 2", 'class' => 'medium_input', 'smalldesc' => 'You may send additional passthrough information that will be returned to you and will not be stored anywhere in Librty Reserve system. This may include order numbers, customer user names or any other data. You will need to specify the field name and the field value. Information limited to 50 characters.')); ?>
		<?php echo $HtmlHelper->input('action_lr_sender_{n}_lr_field3', array('type' => 'text', 'label' => "Additional Field 3", 'class' => 'medium_input', 'smalldesc' => 'You may send additional passthrough information that will be returned to you and will not be stored anywhere in Librty Reserve system. This may include order numbers, customer user names or any other data. You will need to specify the field name and the field value. Information limited to 50 characters.')); ?>
		
	<?php echo $PluginTabsHelper->tabEnd(); ?>
	<?php echo $PluginTabsHelper->tabStart('settings'); ?>
		
	<?php echo $PluginTabsHelper->tabEnd(); ?>
	<?php echo $PluginTabsHelper->tabStart('help'); ?>
		<p>
			<ul>
				<li>This plugin will communicate with the Liberty Reserve server, you must have a Liberty Reserve Account in order to be able to use this one.</li>
				<li>Map your form fields names to the fields required by Liberty Reserve, no spaces should be in the fields name.</li>
				<li>Enter your Libert Reserve account settings.</li>
				<li>Once triggered, this action will redirect the user to the Libert Reserve servers for payment.</li>
				<li>For more documentation about the LR parameters, please search the Liberty Reserve website for http://www.libertyreserve.com/en/paymentform.</li>
			</ul>
		</p>
	<?php echo $PluginTabsHelper->tabEnd(); ?>
</div>


Please can you point out where I am going wrong.

Regards

Hassan
GreyHead 27 Aug, 2011
Hi codeslayer,

I took a look but don't see any obvious bugs. I do get the same error with parameters not saving. Looks like some deeper debugging is needed :-(

Bob
codeslayer 27 Aug, 2011
Hi Bob,

I started editing existing 2co_sender from scratch again and now everything is saving 😀
The working Liberty Reserve Payment Action file is attached herein.

I still have no idea how to use this action. Please guide me.

Regards,
Hassan
Max_admin 30 Aug, 2011
Hi Hassan,

I still have no idea how to use this action. Please guide me.



Well, you didn't tell the action what to do when it runs inside the "run" function, you have only built an array with fields data but then ? how does this payment processor handles the data ? does it use CURL ? you should check their developers section and read the PHP integration examples if they have any.

Good luck!🙂

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
codeslayer 30 Aug, 2011
Hi Max,

Thanks for your reply.
Following is the PHP sample from the developer section in Libert Reserve site.
http://www.libertyreserve.com/downloads/samplestore-2007-09-20.zip

Rest of the details are here:
http://www.libertyreserve.com/en/help/sciguide

It does not say anything about CURL method.

Bascally I have never implemented and any payment processor as yet. I am unable to use Chronoforms Paypal Plugin as paypal is not accepting any transaction form my country. So I have lack of knowledge, how data process between Chronoform and the payment gateways. By searching through this forum. What I have learned so far is:

1- Make a form using Chronoforms > add Payment processor plugin. Configure action to match form data with required data on the payment gateway like liberty reserve.

2- Upon form submission the user is redirected to the SCI (shopping Cart Interface) with required information.

3- In case of either successfull or failed transaction. Liberty reserves' SCI sent back status page to the merchant. This is where listener action comes in and handles the data sent by the SCI and display either success of failure page.

You are requested to please help me with this actions plugin to use Libery Reserves as my payment gateway. Also please tell me how to bind these fields in LR_sender with my form and make it functional.

Best regards
Hassan
Max_admin 31 Aug, 2011
Hi Hassan,

I suggest that you check the "PayPal listener" action, it does what you need exactly, but of course PayPal has its own logic to check the response, and I'm sure that LR has its own logic code as well.

Also there is a 2CO listener in the latest version if this may help you ? I know 2CO supports almost any country, only too few ones are not supported.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
GreyHead 31 Aug, 2011
Hi Hassan,

I think I already posted that I looked at the LR documents you linked to and it is very similar to PayPal standard. Unless you need something more comlex you can do this with a simple Redirect URL + ReDirect User.

Bob
This topic is locked and no more replies can be posted.