Skip to content

Commit

Permalink
version 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alnazer committed Nov 6, 2021
0 parents commit 12a0b4f
Show file tree
Hide file tree
Showing 8 changed files with 1,925 additions and 0 deletions.
Binary file added assets/knet-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/knet-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
667 changes: 667 additions & 0 deletions classes/SimpleXLSXGen.php

Large diffs are not rendered by default.

676 changes: 676 additions & 0 deletions index.php

Large diffs are not rendered by default.

112 changes: 112 additions & 0 deletions languages/wc_knet-ar.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#: index.php:67
msgid "Knet"
msgstr "كي نت"

#: index.php:99
msgid "Tranportal Id"
msgstr "Tranportal Id"

#: index.php:101
msgid "Necessary data requested from the bank "
msgstr "بيانات ضرورية تطلب من البنك"

#: index.php:105
msgid "Transportal Password"
msgstr ""

#: index.php:107
msgid "Necessary data requested from the bank "
msgstr "بيانات ضرورية تطلب من البنك"

#: index.php:112
msgid "Terminal Resource Key"
msgstr ""

#: index.php:114
msgid "Necessary data requested from the bank "
msgstr "بيانات ضرورية تطلب من البنك"

#: index.php:126
msgid "Knet"
msgstr ""

#: index.php:167
msgid "Knet can't get data"
msgstr ""

#: index.php:281
msgid "Order not found"
msgstr "لم يتم العثور علي الطب"

#: index.php:82
msgid "Thank you. Your order has been"
msgstr "شكرا لك حالة طلبك هي :"

#: index.php:90
msgid "Order"
msgstr "طلبك "

#: index.php:629
msgid "currency must be KWD when using this knet payment"
msgstr "العملة يجب ان تكون بالدينار الكويت KWD عندما تحدد الكي نت كخيار للدفع "


msgid "fail"
msgstr "فشلت"

msgid "success"
msgstr "نجحت"

msgid "Knet transactions"
msgstr "عمليت الكي نت"

msgid "Filter"
msgstr "تصفية"

msgid "WC_Knet_List"
msgstr ""

msgid "Order"
msgstr "رقم الطلب"

msgid "Status"
msgstr "الحالة"

msgid "Result"
msgstr "نتيجة الدفع"

msgid "Amount"
msgstr "المبلغ"

msgid "Payment id"
msgstr ""

msgid "Tracking id"
msgstr ""

msgid "Transaction id"
msgstr ""

msgid "Refrance id"
msgstr ""

msgid "Created at"
msgstr "تمت بتاريخ"

msgid "Reset"
msgstr "اعادة تهيئة"

msgid "Export excel"
msgstr "تصدير الي اكسل"

msgid "Export csv"
msgstr "تصدير ال csv"

msgid "No Transations avaliable."
msgstr "لم يتم العثور علي عمليات دفع"






58 changes: 58 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
=== Payment Gateway for knet on WooCommerce ===
Contributors: hassan
Tags: K-Net, knet, knetv2, payment, kuwait, woocommerce, ecommerce, payment, gateway
Requires at least: 5.6
Tested up to: 5.8
Tested in WooCommerce : 5.8
Requires PHP: 7.0
Stable tag: 2.0.0
License: MIT
License URI: https://choosealicense.com/licenses/mit/

نساعدك في تطوير اعمالك الخاصه بتقديم الاضافة الجديد
الخاصة بالدفع عن طريق بوابة الكي نت بعد تحديثها
وسع دائرة عملائك باتاحة امكانية الدفع عن طريق الكي نت
==========
We help you to develop your business by introducing the new add-on
For payment through the K-Net portal, after it has been updated
Expand your customers' circle by making the payment available via Knet

## Installation

download and unzip to plugins folder
<br/>
or
From merchant’s WordPress admin
1. Go to plugin section-> Add new
2. Search for “Payment Gateway for knet on WooCommerce”
3. Click on Install Now
4. Click on Activate


## Usage

go to woocommerce setting in side menu and select tab payment and active knet v2 from list


## Changelog

== Changelog ==

= 2.0.0 =
* add knet transations list for order
* export transations to csv,excel
* change licenses to mit

= 1.1.0 =
* add order status in received page.
* colored status
- ![#0470fb](https://via.placeholder.com/15/0470fb/000000?text=+) `pending`
- ![#fbbd04](https://via.placeholder.com/15/fbbd04/000000?text=+) `processing`
- ![#04c1fb](https://via.placeholder.com/15/0470fb/000000?text=+) `on-hold`
- ![#green](https://via.placeholder.com/15/green/000000?text=+) `completed`
- ![#fb0404](https://via.placeholder.com/15/fb0404/000000?text=+) `cancelled,refunded,failed`


## License

[MIT](https://choosealicense.com/licenses/mit/)
62 changes: 62 additions & 0 deletions transactions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
defined( 'ABSPATH' ) || exit;

/**
* create transactions table
*/
function create_transactions_db_table(){
global $wpdb;

$charset_collate = $wpdb->get_charset_collate();
$table_name = $wpdb->prefix.WC_KNET_TABLE;
$sql = "CREATE TABLE IF NOT EXISTS $table_name (
id int(11) NOT NULL AUTO_INCREMENT,
order_id int(11) NOT NULL,
payment_id varchar(255) NOT NULL,
track_id varchar(255) NOT NULL,
amount DECIMAL(20,3) DEFAULT 0.000 NOT NULL,
tran_id varchar(255) NULL,
ref_id varchar(255) NULL,
status varchar(255) DEFAULT '".STATUS_FAIL."' NOT NULL,
result varchar(255) DEFAULT '".STATUS_NEW."' NOT NULL,
info text NULL,
created_at datetime DEFAULT CURRENT_TIMESTAMP NOT NULL,
PRIMARY KEY (id),
INDEX (id, order_id, payment_id, result)
) $charset_collate;";

require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta( $sql );
add_option( 'wc_knet_db_version', WC_KNET_DV_VERSION);
}

/**
* create new transation record
* @param $data
* @return bool|false|int
*/
add_action("wc_knet_create_new_transation","fun_wc_knet_create_new_transation", 10, 2);
function fun_wc_knet_create_new_transation($order,$transation_data){
global $wpdb;
$table_name = $wpdb->prefix.WC_KNET_TABLE;
try {
return $wpdb->insert(
$table_name,
[
'order_id' => $order->id,
'payment_id' => $transation_data["payment_id"],
'track_id' => $transation_data["track_id"],
'tran_id' => $transation_data["tran_id"],
'ref_id' => $transation_data["ref_id"],
'status' => $transation_data["status"],
'result' => $transation_data["result"],
'amount'=>$transation_data["amount"],
'info' => json_encode($transation_data),
'created_at' => date("Y-m-d H:i:s"),
]
);
}catch (Exception $e){
return false;
}
}

Loading

0 comments on commit 12a0b4f

Please sign in to comment.