Skip to content
This repository has been archived by the owner on Feb 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2 from mojtaba-naserei/master
Browse files Browse the repository at this point in the history
اضافه کردن درگاه زرین گیت
  • Loading branch information
shahryarjb authored Aug 18, 2017
2 parents 4cf3662 + 31510e1 commit ed14127
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
15 changes: 12 additions & 3 deletions rsfptrangellzarinpal.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @subpackage com_Rsfrom
* @subpackage trangell_Zarinpal
* @copyright trangell team => https://trangell.com
* @copyright Copyright (C) 20016 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (C) 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// no direct access
Expand Down Expand Up @@ -85,8 +85,13 @@ function rsfp_doPayment($payValue, $formId, $SubmissionId, $price, $products, $c

$resultStatus = abs($result->Status);
if ($resultStatus == 100) {
// Header('Location: https://sandbox.zarinpal.com/pg/StartPay/'.$result->Authority);
$app->redirect('https://www.zarinpal.com/pg/StartPay/'.$result->Authority);
// Header('Location: https://sandbox.zarinpal.com/pg/StartPay/'.$result->Authority);
if (RSFormProHelper::getConfig('trangellzarinpal.zaringate') == 0) {
$app->redirect('https://www.zarinpal.com/pg/StartPay/'.$result->Authority);
}
else {
$app->redirect('https://www.zarinpal.com/pg/StartPay/'.$result->Authority.'/ZarinGate');
}
} else {
$msg= $this->getGateMsg('error');
$link = JURI::root() . 'index.php?option=com_rsform&formId=' . $formId;
Expand Down Expand Up @@ -198,6 +203,10 @@ function trangellzarinpalConfigurationScreen() {
<td width="200" style="width: 200px;" align="right" class="key"><label for="api"><?php echo 'مرچند کد'; ?></label></td>
<td><input type="text" name="rsformConfig[trangellzarinpal.api]" value="<?php echo RSFormProHelper::htmlEscape(RSFormProHelper::getConfig('trangellzarinpal.api')); ?>" size="100" maxlength="64"></td>
</tr>
<tr>
<td width="200" style="width: 200px;" align="right" class="key"><label for="zaringate"><?php echo 'درگاه زرین گیت'; ?></label></td>
<td><?php echo JHTML::_('select.booleanlist', 'rsformConfig[trangellzarinpal.zaringate]' , '' , RSFormProHelper::htmlEscape(RSFormProHelper::getConfig('trangellzarinpal.zaringate')));?></td>
</tr>
<tr>
<td width="200" style="width: 200px;" align="right" class="key"><label for="tax.value"><?php echo 'مقدار مالیات'; ?></label></td>
<td><input type="text" name="rsformConfig[trangellzarinpal.tax.value]" value="<?php echo RSFormProHelper::htmlEscape(RSFormProHelper::getConfig('trangellzarinpal.tax.value')); ?>" size="4" maxlength="5"></td>
Expand Down
4 changes: 2 additions & 2 deletions rsfptrangellzarinpal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<name>System - RSForm! TrangellZarinpal</name>
<title>RSForm! TrangellZarinpal</title>
<author>Trangell</author>
<creationDate>Jan 2016</creationDate>
<copyright>Copyright 2016 Trangell Team</copyright>
<creationDate>Aug 2017</creationDate>
<copyright>Copyright 2017 Trangell Team</copyright>
<license>http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU/GPL version 2</license>
<authorEmail>info@trangell.com</authorEmail>
<authorUrl>http://trangell.com</authorUrl>
Expand Down
3 changes: 2 additions & 1 deletion sql/mysql/install.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
INSERT IGNORE INTO `#__rsform_config` (`SettingName`, `SettingValue`) VALUES
('trangellzarinpal.api', ''),
('trangellzarinpal.zaringate', '0'),
('trangellzarinpal.tax.value', '');

INSERT IGNORE INTO `#__rsform_component_types` (`ComponentTypeId`, `ComponentTypeName`) VALUES (200, 'trangellzarinpal');
Expand All @@ -9,4 +10,4 @@ INSERT IGNORE INTO `#__rsform_component_type_fields` (`ComponentTypeId`, `FieldN
(200, 'NAME', 'textbox', '', 0),
(200, 'LABEL', 'textbox', '', 1),
(200, 'COMPONENTTYPE', 'hidden', '200', 2),
(200, 'LAYOUTHIDDEN', 'hiddenparam', 'YES', 7);
(200, 'LAYOUTHIDDEN', 'hiddenparam', 'YES', 7);

0 comments on commit ed14127

Please sign in to comment.