-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbd2115
commit dc5cba3
Showing
64 changed files
with
5,886 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Private files | ||
# The following files contain your database credentials and other personal data. | ||
|
||
config/settings.*.php | ||
|
||
# Cache, temp and generated files | ||
# The following files are generated by PrestaShop. | ||
|
||
admin-dev/autoupgrade/ | ||
/cache/ | ||
!/cache/index.php | ||
!/cache/cachefs/index.php | ||
!/cache/purifier/index.php | ||
!/cache/push/index.php | ||
!/cache/sandbox/index.php | ||
!/cache/smarty/index.php | ||
!/cache/tcpdf/index.php | ||
config/xml/*.xml | ||
/log/* | ||
*sitemap.xml | ||
themes/*/cache/ | ||
modules/*/config*.xml | ||
|
||
# Site content | ||
# The following folders contain product images, virtual products, CSV's, etc. | ||
|
||
admin-dev/backups/ | ||
admin-dev/export/ | ||
admin-dev/import/ | ||
download/ | ||
/img/* | ||
upload/ |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 - moka Ödeme Hizmetleri A.Ş. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
<?php | ||
Class KahveDigital | ||
{ | ||
|
||
|
||
const max_installment = 12; | ||
|
||
public static function getAvailablePrograms() | ||
{ | ||
return array( | ||
'axess' => array('name' => 'Axess', 'bank' => 'Akbank A.Ş.'), | ||
'world' => array('name' => 'WordCard', 'bank' => 'Yapı Kredi Bankası'), | ||
'bonus' => array('name' => 'BonusCard', 'bank' => 'Garanti Bankası A.Ş.'), | ||
'cardfinans' => array('name' => 'CardFinans', 'bank' => 'FinansBank A.Ş.'), | ||
'maximum' => array('name' => 'Maximum', 'bank' => 'T.C. İş Bankası'), | ||
'paraf' => array('name' => 'Paraf', 'bank' => 'Halk Bankası'), | ||
|
||
); | ||
} | ||
|
||
public static function setRatesFromPost($posted_data) | ||
{ | ||
$banks = KahveDigital::getAvailablePrograms(); | ||
$return = array(); | ||
foreach ($banks as $k => $v) { | ||
$return[$k] = array(); | ||
for ($i = 1; $i <= self::max_installment; $i++) { | ||
$return[$k][$i] = isset($posted_data[$k]['installments'][$i]) ? ((float) $posted_data[$k]['installments'][$i]) : 0.0; | ||
if ($posted_data[$k]['installments'][$i]['passive']) { | ||
$return[$k][$i] = -1.0; | ||
} | ||
} | ||
} | ||
return $return; | ||
} | ||
|
||
public static function setRatesDefault() | ||
{ | ||
$banks = KahveDigital::getAvailablePrograms(); | ||
$return = array(); | ||
foreach ($banks as $k => $v) { | ||
$return[$k] = array('active' => 0); | ||
for ($i = 1; $i <= self::max_installment; $i++) { | ||
$return[$k]['installments'][$i] = (float) (1 + $i + ($i / 5) + 0.1); | ||
if ($i == 1) | ||
$return[$k]['installments'][$i] = 0.00; | ||
} | ||
} | ||
return $return; | ||
} | ||
|
||
public static function createRatesUpdateForm($rates) | ||
{ | ||
$return = '<table class="kahvedigital_moka_table table">' | ||
. '<thead>' | ||
. '<tr><th>Banka</th>' | ||
. '<th>Durum</th>'; | ||
for ($i = 1; $i <= self::max_installment; $i++) { | ||
$return .= '<th>' . $i . ' taksit</th>'; | ||
} | ||
$return .= '</tr></thead><tbody>'; | ||
|
||
$banks = KahveDigital::getAvailablePrograms(); | ||
foreach ($banks as $k => $v) { | ||
$return .= '<tr>' | ||
. '<th><img src="../modules/mokasanalpos/img/' . $k . '.svg" width="100px"></th>' | ||
. '<th><select name="kahvedigital_moka_taksit[' . $k . '][active]" >' | ||
. '<option value="1">Aktif</option>' | ||
. '<option value="0" '.((int)$rates[$k]['active'] == 0 ? 'selected="selected"' : '').'>Pasif</option>' | ||
.'</select></th>'; | ||
for ($i = 1; $i <= self::max_installment; $i++) { | ||
$return .= '<td><input class="form-control" type="number" step="0.001" maxlength="4" size="4" ' | ||
. ' value="' . ((float) $rates[$k]['installments'][$i]) . '"' | ||
. ' name="kahvedigital_moka_taksit[' . $k . '][installments][' . $i . ']"/></td>'; | ||
} | ||
$return .= '</tr>'; | ||
} | ||
$return .= '</tbody></table>'; | ||
return $return; | ||
} | ||
|
||
public static function calculatePrices($price, $rates) | ||
{ | ||
$banks = KahveDigital::getAvailablePrograms(); | ||
$price = (float)str_replace(',', '', $price); | ||
$return = array(); | ||
foreach ($banks as $k => $v) { | ||
$return[$k] = array('active' => $rates[$k]['active']); | ||
for ($i = 1; $i <= self::max_installment; $i++) { | ||
$return[$k]['installments'][$i] = array( | ||
'total' => number_format((((100 + $rates[$k]['installments'][$i]) * $price) / 100), 2, '.', ''), | ||
'monthly' => number_format((((100 + $rates[$k]['installments'][$i]) * $price) / 100) / $i, 2, '.', ''), | ||
); | ||
} | ||
} | ||
return $return; | ||
} | ||
|
||
public static function createInstallmentsForm($price, $rates) | ||
{ | ||
$prices = KahveDigital::calculatePrices($price, $rates); | ||
$return = '<table class="kahvedigital_moka_table table">' | ||
. '<thead>' | ||
. '<tr>' | ||
. '<th>Banka</th>'; | ||
for ($i = 1; $i <= self::max_installment; $i++) { | ||
$return .= '<th>' . $i . ' taksit</th>'; | ||
} | ||
$return .= '</tr></thead><tbody>'; | ||
|
||
$banks = KahveDigital::getAvailablePrograms(); | ||
foreach ($banks as $k => $v) { | ||
if($v['active'] == 0) | ||
continue; | ||
$return .= '<tr>' | ||
. '<th><img src="/modules/mokasanalpos/img/' . $k . '.svg"></th>'; | ||
for ($i = 1; $i <= self::max_installment; $i++) { | ||
$return .= '<td><input type="number" step="0.001" maxlength="4" size="4" ' | ||
. ' value="' . ((float) $rates[$k]['installments'][$i]) . '"' | ||
. ' name="kahvedigital_moka_taksit[' . $k . '][installments][' . $i . ']"/></td>'; | ||
} | ||
$return .= '</tr>'; | ||
} | ||
$return .= '</tbody></table>'; | ||
return $return; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<module> | ||
<name>mokasanalpos</name> | ||
<displayName><![CDATA[Moka Sanal Pos]]></displayName> | ||
<version><![CDATA[1.7.0]]></version> | ||
<description><![CDATA[Moka ile kolay ödeme]]></description> | ||
<author><![CDATA[KahveDigital]]></author> | ||
<tab><![CDATA[payments_gateways]]></tab> | ||
<confirmUninstall><![CDATA[Are you sure about removing these details?]]></confirmUninstall> | ||
<is_configurable>1</is_configurable> | ||
<need_instance>1</need_instance> | ||
<limited_countries></limited_countries> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<module> | ||
<name>mokasanalpos</name> | ||
<displayName><![CDATA[Moka Sanal Pos]]></displayName> | ||
<version><![CDATA[1.7.0]]></version> | ||
<description><![CDATA[Moka ile kolay ödeme]]></description> | ||
<author><![CDATA[KahveDigital]]></author> | ||
<tab><![CDATA[payments_gateways]]></tab> | ||
<confirmUninstall><![CDATA[Are you sure about removing these details?]]></confirmUninstall> | ||
<is_configurable>1</is_configurable> | ||
<need_instance>1</need_instance> | ||
<limited_countries></limited_countries> | ||
</module> |
10 changes: 10 additions & 0 deletions
10
moka-prestashop1-7/mokasanalpos/controllers/front/index.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); | ||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); | ||
|
||
header('Cache-Control: no-store, no-cache, must-revalidate'); | ||
header('Cache-Control: post-check=0, pre-check=0', false); | ||
header('Pragma: no-cache'); | ||
|
||
header('Location: ../../../../'); | ||
exit; |
Oops, something went wrong.