Skip to content

Commit

Permalink
2.9/released
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihtoprak committed Dec 30, 2021
1 parent b63f7ae commit 7c4e4df
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 8 deletions.
18 changes: 17 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
{
"name": "optimisthub/moka-woocommerce",
"type": "project",
"type": "wordpress-plugin",
"license": "MIT",
"description": "Moka Payment Gateway for WooCommerce",
"keywords": [
"woocommerce",
"woocommerce-isbankasi",
"woocommerce-moka",
"woocommerce-moka-pos",
"is-bankasi",
"is-bankasi-3d",
"isbankasi",
"isbankasi-sanalpos",
"optimisthub",
"optimisthub-moka-pos",
"optimisthub-moka"
],
"homepage": "https://optimisthub.com/",
"authors": [
{
Expand All @@ -11,6 +24,9 @@
"homepage": "https://github.com/optimisthub"
}
],
"support": {
"email": "[email protected]"
},
"require": {
"php": ">=7.1",
"rappasoft/laravel-helpers": "^2.0",
Expand Down
26 changes: 21 additions & 5 deletions core/library/Moka_Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,11 @@ public function receipt_page( $orderId )
$order->update_status('processing', __('Payment is processing via Moka Pay.', 'moka-woocommerce'));
$order->add_order_note( __('Hey, the order is paid by Moka Pay!','moka-woocommerce').'<br> Tutar : '.$total.' '.$currency , true );
$order->payment_complete();

## User Role Changer Support
self::userRoleChangerSupport($orderId);
## User Role Changer Support

$order->reduce_order_stock();

$woocommerce->cart->empty_cart();
Expand Down Expand Up @@ -745,7 +750,6 @@ private function mokaPosErrorMessages($string)
case "PaymentDealer.RequiredFields.ExpMonthRequired":
$errorOutput = "Son Kullanım Tarihi Gönderme Zorunludur.";
break;

case "PaymentDealer.CheckPaymentDealerAuthentication.InvalidAccount":
$errorOutput = "Böyle bir bayi bulunamadı";
break;
Expand All @@ -757,12 +761,10 @@ private function mokaPosErrorMessages($string)
break;
case "PaymentDealer.CheckDealerPaymentLimits.DailyCardLimitExceeded":
$errorOutput = "Gün içinde bu kart kullanılarak daha fazla işlem yapılamaz";

case "PaymentDealer.CheckCardInfo.InvalidCardInfo":
$errorOutput = "Kart bilgilerinde hata var lütfen doğru bilgileri işleyiniz";
break;
case "PaymentDealer.DoDirectPayment3dRequest.InstallmentNotAvailableForForeignCurrencyTransaction":

$errorOutput = "Yabancı para ile taksit yapılamaz";
break;
case "PaymentDealer.DoDirectPayment3dRequest.ThisInstallmentNumberNotAvailableForDealer":
Expand All @@ -774,7 +776,6 @@ private function mokaPosErrorMessages($string)
case "PaymentDealer.DoDirectPayment3dRequest.ThisInstallmentNumberNotAvailableForVirtualPos":
$errorOutput = "Sanal Pos bu taksit sayısına izin vermiyor";
break;

default:
$errorOutput = "Beklenmeyen bir hata oluştu";
}
Expand Down Expand Up @@ -849,7 +850,7 @@ private function getHash($params)
global $wpdb;
$orderId = data_get($params, 'orderId');
$tableName = $wpdb->prefix . 'moka_transactions_hash';
return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $tableName WHERE id_order = $orderId ORDER BY id DESC" ), ARRAY_A );
return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $tableName WHERE id_order = %d ORDER BY id DESC", $orderId ), ARRAY_A );
}

/**
Expand Down Expand Up @@ -909,6 +910,21 @@ private function formatExpiryDate($str)

return '20'.$output;
}

/**
* User Role Change Plugin Support
*
* @param [type] $orderId
*/
private function userRoleChangerSupport($orderId)
{
if(class_exists('DfxWooRoleChanger'))
{
$roleChanger = DfxWooRoleChanger::get_instance();
$roleChanger->role_assignment($orderId);
}

}

}
}
2 changes: 1 addition & 1 deletion core/library/Moka_Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exit;
}

define('OPTIMISTHUB_MOKA_PAY_VERSION', '2.8');
define('OPTIMISTHUB_MOKA_PAY_VERSION', '2.9');

global $mokaVersion;
$mokaVersion = OPTIMISTHUB_MOKA_PAY_VERSION;
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Moka Payment Gateway for WooCommerce
* Plugin URI: https://github.com/optimisthub/moka-woocommerce
* Description: Moka Payment gateway for woocommerce
* Version: 2.8
* Version: 2.9
* Author: Optimist Hub
* Author URI: https://optimisthub.com?ref=mokaPayment
* Domain Path: /languages/
Expand Down
11 changes: 11 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ Moka Pos, Moka Pay plugin;

### Changelog

#### Version 2.9
- Security : `$wpdb` security and performence issues.
- Feature : Added `DfxWooRoleChanger` Plugin Support.
- Information : Added, composer.json tag details.

#### Version 2.8
- Issue : Installment Issues.

#### Version 2.7
- Issue : Typo Issues.

#### Version 2.6
- Issue : Test cards added to readme file.
- Issue : Payment Status set completed after successfully payment.
Expand Down

0 comments on commit 7c4e4df

Please sign in to comment.