Skip to content

Commit

Permalink
Issue techjoomla#40 fix: pass name, address, city etc while placing t…
Browse files Browse the repository at this point in the history
…he order so that the order details are shown prefilled on the 2checkout
  • Loading branch information
ankush-maherwal committed Jun 28, 2018
1 parent 944a471 commit dae83b6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 16 deletions.
7 changes: 5 additions & 2 deletions code/plugins/2checkout/2checkout.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php
/**
* @copyright Copyright (c) 2009-2015 TechJoomla. All rights reserved
* @license GNU General Public License version 2, or later
* @package Joomla Payments
* @author TechJoomla <[email protected]>
* @website http://techjoomla.com
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

// No direct access
Expand Down
22 changes: 16 additions & 6 deletions code/plugins/2checkout/2checkout/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php
/**
* @copyright Copyright (c) 2009-2015 TechJoomla. All rights reserved
* @license GNU General Public License version 2, or later
* @package Joomla Payments
* @author TechJoomla <[email protected]>
* @website http://techjoomla.com
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die('Restricted access');
?>
Expand All @@ -12,14 +15,21 @@
<input type="hidden" name="sid" value="<?php echo $vars->sid?>" />
<input type="hidden" name="cart_order_id" value="<?php echo $vars->order_id ?>" />
<input type="hidden" name="total" value="<?php echo sprintf('%02.2f',$vars->amount) ?>" />

<input type="hidden" name="demo" value="<?php echo $vars->demo; ?>" />
<input type="hidden" name="merchant_order_id" value="<?php echo $vars->order_id ?>" />
<input type="hidden" name="merchant_order_id" value="<?php echo $vars->order_id ?>" />
<input type="hidden" name="fixed" value="Y" />
<input type="hidden" name="lang" value="<?php echo $vars->lang; ?>" />
<input type='hidden' name='return_url' value="<?php echo $vars->return;?>" >
<input type='hidden' name='x_receipt_link_url' value="<?php echo $vars->notify_url;?>" >
<input type='hidden' name='x_receipt_link_url' value="<?php echo $vars->return;?>" />
<input type="hidden" name="pay_method" value="<?php echo strtoupper($vars->pay_method); ?>" />
<input type="hidden" name="card_holder_name" value="<?php echo $vars->user_firstname . " " . $vars->user_lastname?>" />
<input type="hidden" name="email" value="<?php echo $vars->user_email?>" />
<input type="hidden" name="street_address" value="<?php echo $vars->address?>" />
<input type="hidden" name="street_address2" value="<?php echo $vars->address2?>" />
<input type="hidden" name="zip" value="<?php echo $vars->zipcode?>" />
<input type="hidden" name="phone" value="<?php echo $vars->contactNumber?>" />
<input type="hidden" name="city" value="<?php echo $vars->cityName?>" />
<input type="hidden" name="state" value="<?php echo $vars->stateName?>" />
<input type="hidden" name="country" value="<?php echo $vars->countryName?>" />
<input type="hidden" name="id_type" value="1" />
<div class="form-actions">
<input name='submit' type='submit' class="btn btn-success btn-large" value="<?php echo JText::_('SUBMIT'); ?>" >
Expand Down
24 changes: 16 additions & 8 deletions code/plugins/2checkout/2checkout/tmpl/form.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
<?php
/**
* @copyright Copyright (c) 2009-2015 TechJoomla. All rights reserved
* @license GNU General Public License version 2, or later
* @package Joomla Payments
* @author TechJoomla <[email protected]>
* @website http://techjoomla.com
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die('Restricted access');

?>
?>
<div class="tjcpg-wrapper">
<form action="<?php echo $vars->action_url ?>" class="form-horizontal" method="post" id="paymentForm">

<input type="hidden" name="sid" value="<?php echo $vars->sid?>" />
<input type="hidden" name="cart_order_id" value="<?php echo $vars->order_id ?>" />
<input type="hidden" name="total" value="<?php echo sprintf('%02.2f',$vars->amount) ?>" />

<input type="hidden" name="demo" value="<?php echo $vars->demo; ?>" />
<input type="hidden" name="merchant_order_id" value="<?php echo $vars->order_id ?>" />
<input type="hidden" name="merchant_order_id" value="<?php echo $vars->order_id ?>" />
<input type="hidden" name="fixed" value="Y" />
<input type="hidden" name="lang" value="<?php echo $vars->lang; ?>" />
<input type='hidden' name='return_url' value="<?php echo $vars->return;?>" >
<input type='hidden' name='x_receipt_link_url' value="<?php echo $vars->notify_url;?>" >
<input type="hidden" name="pay_method" value="<?php echo strtoupper($vars->pay_method); ?>" />
<input type="hidden" name="card_holder_name" value="<?php echo $vars->user_firstname . " " . $vars->user_lastname?>" />
<input type="hidden" name="email" value="<?php echo $vars->user_email?>" />
<input type="hidden" name="street_address" value="<?php echo $vars->address?>" />
<input type="hidden" name="street_address2" value="<?php echo $vars->address2?>" />
<input type="hidden" name="zip" value="<?php echo $vars->zipcode?>" />
<input type="hidden" name="phone" value="<?php echo $vars->contactNumber?>" />
<input type="hidden" name="city" value="<?php echo $vars->cityName?>" />
<input type="hidden" name="state" value="<?php echo $vars->stateName?>" />
<input type="hidden" name="country" value="<?php echo $vars->countryName?>" />
<input type="hidden" name="id_type" value="1" />
<div class="form-actions">
<input name="submit" type="submit" class="btn btn-success btn-large" value="Pay Now" >
Expand Down

0 comments on commit dae83b6

Please sign in to comment.