diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..ed4c8c3
Binary files /dev/null and b/.DS_Store differ
diff --git a/iyzico.ocmod.zip b/iyzico.ocmod.zip
new file mode 100644
index 0000000..fc34915
Binary files /dev/null and b/iyzico.ocmod.zip differ
diff --git a/iyzico/.DS_Store b/iyzico/.DS_Store
new file mode 100644
index 0000000..533e957
Binary files /dev/null and b/iyzico/.DS_Store differ
diff --git a/iyzico/admin/.DS_Store b/iyzico/admin/.DS_Store
new file mode 100644
index 0000000..eee835f
Binary files /dev/null and b/iyzico/admin/.DS_Store differ
diff --git a/iyzico/admin/controller/.DS_Store b/iyzico/admin/controller/.DS_Store
new file mode 100644
index 0000000..a0d8f30
Binary files /dev/null and b/iyzico/admin/controller/.DS_Store differ
diff --git a/iyzico/admin/controller/payment/.DS_Store b/iyzico/admin/controller/payment/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/iyzico/admin/controller/payment/.DS_Store differ
diff --git a/iyzico/admin/controller/payment/iyzico.php b/iyzico/admin/controller/payment/iyzico.php
new file mode 100644
index 0000000..f0c78dd
--- /dev/null
+++ b/iyzico/admin/controller/payment/iyzico.php
@@ -0,0 +1,416 @@
+ 'error_api_channel',
+ 'name' => 'payment_iyzico_api_channel',
+ ),
+ array(
+ 'validateField' => 'blank',
+ 'name' => 'payment_iyzico_api_url',
+ ),
+ array(
+ 'validateField' => 'error_api_key',
+ 'name' => 'payment_iyzico_api_key',
+ ),
+ array(
+ 'validateField' => 'error_secret_key',
+ 'name' => 'payment_iyzico_secret_key',
+ ),
+ array(
+ 'validateField' => 'error_design',
+ 'name' => 'payment_iyzico_design',
+ ),
+ array(
+ 'validateField' => 'error_language',
+ 'name' => 'payment_iyzico_language',
+ ),
+ array(
+ 'validateField' => 'error_order_status',
+ 'name' => 'payment_iyzico_order_status',
+ ),
+ array(
+ 'validateField' => 'error_cancel_order_status',
+ 'name' => 'payment_iyzico_order_cancel_status',
+ ),
+ array(
+ 'validateField' => 'blank',
+ 'name' => 'payment_iyzico_status',
+ ),
+ array(
+ 'validateField' => 'blank',
+ 'name' => 'payment_iyzico_sort_order',
+ ),
+ array(
+ 'validateField' => 'error_title',
+ 'name' => 'payment_iyzico_title',
+ ),
+ array(
+ 'validateField' => 'blank',
+ 'name' => 'payment_iyzico_order_status_id',
+ ),
+ array(
+ 'validateField' => 'blank',
+ 'name' => 'payment_iyzico_webhook_text',
+ ),
+ array(
+ 'validateField' => 'blank',
+ 'name' => 'payment_iyzico_overlay_token',
+ ),
+ array(
+ 'validateField' => 'blank',
+ 'name' => 'payment_iyzico_overlay_status',
+ ),
+ array(
+ 'validateField' => 'blank',
+ 'name' => 'webhook_iyzico_webhook_url_key',
+ )
+ );
+
+
+ /**
+ * iyzico extension: index methods
+ *
+ * @return void
+ */
+ public function index(): void
+ {
+ # Load Language
+ $this->load->language('extension/iyzico/payment/iyzico');
+
+ # Load Settings Model
+ $this->load->model('setting/setting');
+
+ # Load User Model
+ $this->load->model('user/user');
+
+ # Load Order Status Model
+ $this->load->model('localisation/order_status');
+
+ # Load Model
+ $this->load->model('extension/iyzico/payment/iyzico');
+
+ # Set Webhook Url
+ $this->setWebookUrl();
+
+ # Set Webhook Button
+ $this->setWebookButton();
+
+ # Set Webhook Update
+ $this->setWebhookUpdate();
+
+ foreach ($this->fields as $key => $field) {
+ if (isset($this->error[$field['validateField']]))
+ $data[$field['validateField']] = $this->error[$field['validateField']];
+ else
+ $data[$field['validateField']] = '';
+
+ if (isset($this->request->post[$field['name']]))
+ $data[$field['name']] = $this->request->post[$field['name']];
+ else
+ $data[$field['name']] = $this->config->get($field['name']);
+
+ }
+
+ # Get Title
+ $title = $this->language->get('heading_title');
+
+ # Set Title
+ $this->document->setTitle($title);
+
+ # Install Status
+ $data['install_status'] = $this->installStatus();
+
+ # Set Order Statues
+ $data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();
+
+ # Button Links
+ $data['action'] = $this->url->link('extension/iyzico/payment/iyzico.save', 'user_token=' . $this->session->data['user_token'], true);
+ $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment');
+
+ # Admin Page Options
+ $data['heading_title'] = $title;
+ $data['header'] = $this->load->controller('common/header');
+ $data['column_left'] = $this->load->controller('common/column_left');
+ $data['footer'] = $this->load->controller('common/footer');
+ $data['locale'] = $this->language->get('code');
+ $data['breadcrumbs'] = $this->createBreadcrumbs();
+
+ # iyzico Options
+ $data['iyzico_webhook_url'] = HTTP_CATALOG . 'index.php?route=extension/iyzico/payment/iyzico.webhook&key=' . $this->config->get('webhook_iyzico_webhook_url_key');
+ $data['module_version'] = $this->module_product_name;
+ $data['copy_clipboard_text'] = $this->language->get('copy_clipboard_text');
+
+ $this->response->setOutput($this->load->view('extension/iyzico/payment/iyzico', $data));
+ }
+
+ /**
+ * iyzico extension: save methods
+ *
+ * @return void
+ */
+ public function save(): void
+ {
+ # Load Language
+ $this->load->language('extension/iyzico/payment/iyzico');
+
+ # Load Model
+ $this->load->model('extension/iyzico/payment/iyzico');
+
+ # Check Permission
+ if (!$this->user->hasPermission('modify', 'extension/iyzico/payment/iyzico'))
+ $this->error['warning'] = $this->language->get('error_permission');
+
+ # Validate
+ $this->validate();
+
+ $formRequest = $this->request->post;
+
+ # Check payment_iyzico_api_channel
+ if($formRequest['payment_iyzico_api_channel'] == 'sandbox')
+ $formRequest['payment_iyzico_api_url'] = 'https://sandbox-api.iyzipay.com';
+ else
+ $formRequest['payment_iyzico_api_url'] = 'https://api.iyzipay.com';
+
+ $json = [];
+ if (!$this->error) {
+ $this->load->model('setting/setting');
+ $this->model_setting_setting->editSetting('payment_iyzico', $formRequest);
+ $json['success'] = $this->language->get('text_success');
+ } else {
+ $json['error'] = $this->error;
+ }
+
+ $data['test_Error'] = "test hata";
+
+ $this->response->addHeader('Content-Type: application/json');
+ $this->response->setOutput(json_encode($json));
+ }
+
+
+ /**
+ * iyzico extension: install methods
+ *
+ * @return void
+ */
+ public function install(): void
+ {
+ # Load Model
+ $this->load->model('setting/setting');
+
+ # Load Model
+ $this->load->model('extension/iyzico/payment/iyzico');
+
+
+ foreach ($this->fields as $key => $field) {
+ if (isset($this->error[$field['validateField']]))
+ $data[$field['validateField']] = $this->error[$field['validateField']];
+ else
+ $data[$field['validateField']] = '';
+
+ if (isset($this->request->post[$field['name']]))
+ $data[$field['name']] = $this->request->post[$field['name']];
+ else
+ $data[$field['name']] = $this->config->get($field['name']);
+ }
+
+ # Set Webhook Url
+ $this->setWebhookUpdate();
+
+ # Install
+ $this->model_extension_iyzico_payment_iyzico->install();
+
+ # Install Events
+ $this->__registerEvents();
+
+ # Set Settings
+ $this->model_setting_setting->editSetting('payment_iyzico', $data);
+ }
+
+ /**
+ * iyzico extension: uninstall methods
+ *
+ * @return void
+ */
+ public function uninstall(): void
+ {
+ # Load Model
+ $this->load->model('setting/setting');
+
+ # Load Model
+ $this->load->model('extension/iyzico/payment/iyzico');
+
+ # Delete Settings
+ $this->db->query("DELETE FROM " . DB_PREFIX . "setting WHERE store_id = '0' AND code = 'payment_iyzico_webhook'");
+
+ # Uninstall
+ $this->model_extension_iyzico_payment_iyzico->uninstall();
+
+ # Delete Settings
+ $this->model_setting_setting->deleteSetting('payment_iyzico');
+ }
+
+ /**
+ * iyzico extension: validate methods
+ *
+ * @return bool
+ */
+ protected function validate()
+ {
+ foreach ($this->fields as $field) {
+ if ($field['validateField'] != 'blank') {
+ if (!$this->request->post[$field['name']]) {
+ $this->error[$field['validateField']] = $this->language->get($field['validateField']);
+ }
+ }
+ }
+
+ return !$this->error;
+ }
+
+
+ /**
+ * iyzico extension: setWebookUrl methods
+ *
+ * @return bool
+ */
+ private function setWebookUrl(): bool
+ {
+
+ $getWebhookUrlKey = $this->config->get('webhook_iyzico_webhook_url_key');
+ $generateUrlId = substr(base64_encode(time() . mt_rand()), 15, 6);
+
+ if (!$getWebhookUrlKey)
+ $this->model_setting_setting->editSetting('webhook_iyzico', array("webhook_iyzico_webhook_url_key" => $generateUrlId));
+
+ return true;
+ }
+
+ /**
+ * iyzico extension: installStatus methods
+ *
+ * @return int
+ */
+ private function installStatus(): int
+ {
+ $counter = 0;
+ foreach ($this->fields as $key => $field) {
+ $data[$field['name']] = $this->config->get($field['name']);
+ if (!empty($this->config->get($field['name'])))
+ $counter++;
+ }
+ return $counter;
+ }
+
+ /**
+ * iyzico extension: setWebookButton methods
+ *
+ * @return void
+ */
+ private function setWebookButton(): void
+ {
+ $webhookActive = $this->config->get('payment_iyzico_webhook_active_button');
+ if (empty($webhookActive))
+ $this->db->query("INSERT INTO `" . DB_PREFIX . "setting` (`code`, `key`, `value`, `serialized`) VALUES ('payment_iyzico_webhook','payment_iyzico_webhook_active_button', '1' ,'0');");
+ }
+
+ /**
+ * iyzico extension: setWebhookUpdate methods
+ *
+ * @return void
+ */
+ private function setWebhookUpdate(): void
+ {
+
+ $configWebhookStatus = $this->config->get('payment_iyzico_webhook_active_button');
+ $configApikey = $this->config->get('payment_iyzico_api_key');
+ $configSecretKey = $this->config->get('payment_iyzico_secret_key');
+
+ if (isset($configApikey) && isset($configSecretKey)) {
+ if ($configWebhookStatus == 1) {
+ $webhookPost = new stdClass();
+ $webhookPost->webhookUrl = HTTP_CATALOG . 'index.php?route=extension/payment/iyzico.webhook&key=' . $this->config->get('webhook_iyzico_webhook_url_key');
+
+ $webhookPki = $this->model_extension_iyzico_payment_iyzico->pkiStringGenerate($webhookPost);
+ $authorizationData = $this->model_extension_iyzico_payment_iyzico->authorizationGenerate($configApikey, $configSecretKey, $webhookPki);
+ $requestResponseWebhook = $this->model_extension_iyzico_payment_iyzico->iyzicoPostWebhookUrlKey($authorizationData, $webhookPost);
+
+ if(isset($requestResponseWebhook->merchantNotificationUpdateStatus)){
+ if ($requestResponseWebhook->merchantNotificationUpdateStatus == 'UPDATED' || $requestResponseWebhook->merchantNotificationUpdateStatus == 'CREATED')
+ $this->model_setting_setting->editSetting('payment_iyzico_webhook', array("payment_iyzico_webhook_active_button" => 2));
+ else
+ $this->model_setting_setting->editSetting('payment_iyzico_webhook', array("payment_iyzico_webhook_active_button" => 3));
+ }
+ }
+ }
+ }
+
+ /**
+ * iyzico extension: createBreadcrumbs methods
+ *
+ * @return array
+ */
+ protected function createBreadcrumbs(): array
+ {
+ return array(
+ array(
+ 'text' => $this->language->get('text_home'),
+ 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
+ ),
+ array(
+ 'text' => $this->language->get('text_extension'),
+ 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment', true)
+ ),
+ array(
+ 'text' => $this->language->get('heading_title'),
+ 'href' => $this->url->link('extension/iyzico/payment/iyzico', 'user_token=' . $this->session->data['user_token'], true)
+ )
+ );
+ }
+
+ /**
+ * iyzico extension: __registerEvents methods
+ *
+ * @return void
+ */
+ protected function __registerEvents(): void
+ {
+
+ // events array
+ $events = array();
+
+ $events[] = array(
+ 'code' => "overlay_script",
+ 'trigger' => "catalog/controller/common/footer/after",
+ 'action' => "extension/iyzico/payment/iyzico.injectOverlayScript",
+ 'description' => "Injecting overlay script",
+ 'status' => 1,
+ 'sort_order' => 1,
+ );
+
+ $events[] = array(
+ 'code' => "module_notification",
+ 'trigger' => "admin/controller/common/footer/after",
+ 'action' => "extension/iyzico/payment/iyzico.injectModuleNotification",
+ 'description' => "Injecting module notification",
+ 'status' => 1,
+ 'sort_order' => 1,
+ );
+
+ $this->load->model('setting/event');
+ foreach ($events as $event) {
+ $this->model_setting_event->addEvent($event);
+ }
+ }
+}
diff --git a/iyzico/admin/language/.DS_Store b/iyzico/admin/language/.DS_Store
new file mode 100644
index 0000000..6dfe615
Binary files /dev/null and b/iyzico/admin/language/.DS_Store differ
diff --git a/iyzico/admin/language/en-gb/.DS_Store b/iyzico/admin/language/en-gb/.DS_Store
new file mode 100644
index 0000000..9839ef8
Binary files /dev/null and b/iyzico/admin/language/en-gb/.DS_Store differ
diff --git a/iyzico/admin/language/en-gb/payment/.DS_Store b/iyzico/admin/language/en-gb/payment/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/iyzico/admin/language/en-gb/payment/.DS_Store differ
diff --git a/iyzico/admin/language/en-gb/payment/iyzico.php b/iyzico/admin/language/en-gb/payment/iyzico.php
new file mode 100644
index 0000000..addb5e7
--- /dev/null
+++ b/iyzico/admin/language/en-gb/payment/iyzico.php
@@ -0,0 +1,75 @@
+iyzico';
+$_['general_select'] = 'Select';
+$_['live'] = 'Live';
+$_['sandbox'] = 'Sandbox / Test';
+$_['api_field'] = 'API Type';
+$_['api_field_tooltip'] = 'API Type Live or Sandbox';
+$_['api_key'] = 'API Key';
+$_['secret_key'] = 'Secret Key';
+$_['apikey_field_tooltip'] = 'Your API key with including 32 digit letter and number.';
+$_['secretkey_field_tooltip'] = 'Your Secret Key with including 32 digit letter and number.';
+$_['view_select'] = 'Design';
+$_['payment_iyzico_language_name'] = 'Checkout language';
+$_['order_status'] = 'Order Status';
+$_['cancel_order_status'] = 'Cancel Order Status';
+$_['order_status_tooltip'] = 'New ordering status info';
+$_['cancel_order_status_tooltip'] = 'Cancel ordering status info';
+$_['extension_status'] = 'Extension Status';
+$_['sort_order'] = 'Order';
+$_['error_api_channel'] = 'Api Channel Required!';
+$_['error_api_key'] = 'Api Key Required!';
+$_['error_secret_key'] = 'Secret Key Required!';
+$_['text_success'] = 'Iyzico Payment Extension: Updated Success!';
+$_['valid_live'] = 'Sandbox API key information is unusable for Live API';
+$_['valid_sandbox'] = 'Live API key information is unusable for Sandbox API';
+$_['install'] = 'Install';
+$_['help'] = 'Help';
+$_['settings'] = 'Settings';
+$_['settings_content'] = 'I Hope everything is okay';
+$_['install_title'] = 'Install Title';
+$_['install_hello'] = 'Hello';
+$_['support'] = 'Support';
+$_['install_content'] = 'Welcome to iyzico Opencart install screen.
Live: https://merchant.iyzipay.com
+ Sandbox: https://sandbox-merchant.iyzipay.com
+ Help detail Help is click.';
+$_['payment_title'] = 'Payment Value';
+$_['api_connection'] = 'Api Connection:';
+$_['api_connection_success'] = 'Success';
+$_['api_connection_failed'] = 'Failed';
+$_['api_connection_failed_content'] = 'Opss.. Help detail Help is click.';
+$_['buyer_protection'] = 'Buyer Protection';
+$_['overlay_design'] = 'Design:';
+$_['overlay_bottom_left'] = 'Bottom Left';
+$_['overlay_bottom_left_val'] = 'bottomLeft';
+$_['overlay_bottom_right'] = 'Bottom Right';
+$_['overlay_bottom_right_val'] = 'bottomRight';
+$_['overlay_closed'] = 'Hidden';
+$_['overlay_closed_val'] = 'hidden';
+$_['iyzico_update_screen'] = 'IYZICO UPDATE SCREEN';
+$_['current_version_name'] = 'Old Version:';
+$_['new_version_name'] = 'New Version:';
+$_['description_name'] = 'Description:';
+$_['iyzico_webhook'] = 'Webhook Integration';
+$_['webhook_url_description'] = "Don't forget to do webhook Integration.";
+$_['iyzico_webhook_url_key_error'] = "Webhook URL Error! Please, try these steps respectively. 1- Refresh web page 1-2 times. 2- If webhook url doesn't create , Please, after delete the iyzico plugin, re-install the iyzico plugin and save module settings. 3- Send an email to entegrasyon@iyzico.com";
+
+$_['pwi_status_error'] = "Pay with iyzico module is not enable!";
+$_['pwi_status_error_detail'] = "You can not access Settings of iyzico Checkout Form Module without installing the pay with iyzico module.";
+$_['dev_iyzipay_opencart_link'] = "https://dev.iyzipay.com/tr/acik-kaynak/opencart";
+$_['dev_iyzipay_detail'] = "Complete the installation of the Opencart 4.x - Pay with iyzico module via dev.iyzipay:";
+
+$_['checkout_language_automatic'] = 'Automatic';
+$_['checkout_language_turkish'] = 'Turkish';
+$_['checkout_language_english'] = 'English';
+
+$_['admin_active_button'] = 'Active';
+$_['text_extension'] = 'Extensions';
+$_['breadcrumb_heading_title'] = 'iyzico Module Settings';
+$_['copy_clipboard_text'] = 'Copy to Clipboard: ';
+$_['error_design'] = 'Design Required!';
+
+$_['text_info_label'] = ' If you have problems, please contact. entegrasyon@iyzico.com';
diff --git a/iyzico/admin/language/tr-tr/.DS_Store b/iyzico/admin/language/tr-tr/.DS_Store
new file mode 100644
index 0000000..942b022
Binary files /dev/null and b/iyzico/admin/language/tr-tr/.DS_Store differ
diff --git a/iyzico/admin/language/tr-tr/payment/.DS_Store b/iyzico/admin/language/tr-tr/payment/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/iyzico/admin/language/tr-tr/payment/.DS_Store differ
diff --git a/upload/admin/language/tr-tr/extension/payment/iyzico.php b/iyzico/admin/language/tr-tr/payment/iyzico.php
old mode 100755
new mode 100644
similarity index 67%
rename from upload/admin/language/tr-tr/extension/payment/iyzico.php
rename to iyzico/admin/language/tr-tr/payment/iyzico.php
index bead9b6..16370e2
--- a/upload/admin/language/tr-tr/extension/payment/iyzico.php
+++ b/iyzico/admin/language/tr-tr/payment/iyzico.php
@@ -1,8 +1,8 @@
';
+$_['heading_title'] = 'iyzico Ödeme Formu';
+$_['text_iyzico'] = 'iyzico';
$_['general_select'] = 'Seçiniz';
$_['live'] = 'Live';
$_['sandbox'] = 'Sandbox / Test';
@@ -13,6 +13,7 @@
$_['apikey_field_tooltip'] = 'iyzico panelinizin ayarlar bölümünden erişebileceğiniz api anahtarı';
$_['secretkey_field_tooltip'] = 'iyzico panelinizin ayarlar bölümünden erişebileceğiniz güvenlik api anahtarı';
$_['view_select'] = 'Görünüm';
+$_['payment_iyzico_language_name'] = 'Ödeme Formu Dili';
$_['design_field_tooltip'] = 'Ödeme formunuzun görünümü';
$_['order_status'] = 'Sipariş Durumu';
$_['order_status_tooltip'] = 'Sipariş alındığında müşteriye gösterilecek durum bilgisi';
@@ -53,4 +54,23 @@
$_['iyzico_update_screen'] = 'İYZİCO GÜNCELLEME EKRANI';
$_['current_version_name'] = 'Mevcur Sürümünüz:';
$_['new_version_name'] = 'Yeni Sürümünüz:';
-$_['description_name'] = 'Açıklama:';
\ No newline at end of file
+$_['description_name'] = 'Açıklama:';
+$_['iyzico_webhook'] = 'Webhook Entegrasyonu';
+$_['webhook_url_description'] = "Webhook entegrasyonunu yapmayı unutmayınız.";
+$_['iyzico_webhook_url_key_error'] = "Webhook URL üretilemedi. Lütfen sırasıyla bu adımları deneyin. 1- Web sayfasını 1-2 defa yenileyin. 2- Webhook URL üretilmediyse lütfen plugini kaldırıp, yeniden kurun ve ayarları kaydedin. 3- Sorun devam ederse entegrasyon@iyzico.com'a mail atınız.";
+
+$_['pwi_status_error'] = "iyzico İle Öde modülü aktif değil!";
+$_['pwi_status_error_detail'] = "iyzico ile Öde modülünü kurmadan iyzico Ödeme Formu ayarlarına erişemezsiniz.";
+$_['dev_iyzipay_opencart_link'] = "https://dev.iyzipay.com/tr/acik-kaynak/opencart";
+$_['dev_iyzipay_detail'] = "Opencart 4.x - iyzico ile Öde modülünün kurulumunu tamamlayınız: ";
+$_['checkout_language_automatic'] = 'Otomatik';
+$_['checkout_language_turkish'] = 'Türkçe';
+$_['checkout_language_english'] = 'İngilizce';
+
+$_['admin_active_button'] = 'Aktifleştir';
+$_['text_extension'] = 'Eklentiler';
+$_['breadcrumb_heading_title'] = 'iyzico Modül Ayarları';
+$_['copy_clipboard_text'] = 'Panoya Kopyalandı: ';
+$_['error_design'] = 'Görünüm Gerekli!';
+
+$_['text_info_label'] = ' Problem yaşıyorsanız iletişime geçiniz. entegrasyon@iyzico.com';
diff --git a/iyzico/admin/model/.DS_Store b/iyzico/admin/model/.DS_Store
new file mode 100644
index 0000000..942b022
Binary files /dev/null and b/iyzico/admin/model/.DS_Store differ
diff --git a/iyzico/admin/model/payment/.DS_Store b/iyzico/admin/model/payment/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/iyzico/admin/model/payment/.DS_Store differ
diff --git a/iyzico/admin/model/payment/iyzico.php b/iyzico/admin/model/payment/iyzico.php
new file mode 100644
index 0000000..c2ea0b7
--- /dev/null
+++ b/iyzico/admin/model/payment/iyzico.php
@@ -0,0 +1,183 @@
+db->query("
+ CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "iyzico_order` (
+ `iyzico_order_id` INT(11) NOT NULL AUTO_INCREMENT,
+ `payment_id` INT(11) NOT NULL,
+ `order_id` INT(11) NOT NULL,
+ `total_amount` DECIMAL( 10, 2 ) NOT NULL,
+ `status` VARCHAR(20) NOT NULL,
+ `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`iyzico_order_id`)
+ ) ENGINE=MyISAM DEFAULT COLLATE=utf8_general_ci;");
+
+ $this->db->query("
+ CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "iyzico_card` (
+ `iyzico_card_id` INT(11) NOT NULL AUTO_INCREMENT,
+ `customer_id` INT(11) NOT NULL,
+ `card_user_key` VARCHAR(50),
+ `api_key` VARCHAR(50),
+ `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`iyzico_card_id`)
+ ) ENGINE=MyISAM DEFAULT COLLATE=utf8_general_ci;");
+ }
+
+ public function uninstall()
+ {
+ $this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "iyzico_order`;");
+ $this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "iyzico_card`;");
+ }
+
+ public function pkiStringGenerate($objectData)
+ {
+ $pki_value = "[";
+ foreach ($objectData as $key => $data) {
+ if (is_object($data)) {
+ $name = var_export($key, true);
+ $name = str_replace("'", "", $name);
+ $pki_value .= $name . "=[";
+ $end_key = count(get_object_vars($data));
+ $count = 0;
+ foreach ($data as $key => $value) {
+ $count++;
+ $name = var_export($key, true);
+ $name = str_replace("'", "", $name);
+ $pki_value .= $name . "=" . "" . $value;
+ if ($end_key != $count)
+ $pki_value .= ",";
+ }
+ $pki_value .= "]";
+ } else if (is_array($data)) {
+ $name = var_export($key, true);
+ $name = str_replace("'", "", $name);
+ $pki_value .= $name . "=[";
+ $end_key = count($data);
+ $count = 0;
+ foreach ($data as $key => $result) {
+ $count++;
+ $pki_value .= "[";
+
+ foreach ($result as $key => $item) {
+ $name = var_export($key, true);
+ $name = str_replace("'", "", $name);
+
+ $pki_value .= $name . "=" . "" . $item;
+ $reResult = (array) $result;
+ $newResult = $reResult[array_key_last($reResult)];
+
+ if ($newResult != $item) {
+ $pki_value .= ",";
+ }
+
+ if ($newResult == $item) {
+
+ if ($end_key != $count) {
+ $pki_value .= "], ";
+ } else {
+ $pki_value .= "]";
+ }
+ }
+ }
+ }
+
+ $reData = (array) $data;
+ $newData = $reData[array_key_last($reData)];
+ if ($newData == $result)
+ $pki_value .= "]";
+ } else {
+ $name = var_export($key, true);
+ $name = str_replace("'", "", $name);
+
+ $pki_value .= $name . "=" . "" . $data . "";
+ }
+
+ $reObjectData = (array) $objectData;
+ $newobjectData = $reObjectData[array_key_last($reObjectData)];
+
+ if ($newobjectData != $data)
+ $pki_value .= ",";
+ }
+ $pki_value .= "]";
+ return $pki_value;
+ }
+
+ public function authorizationGenerate($api_key, $secret_key, $pki)
+ {
+
+ $rand_value = rand(100000, 99999999);
+ $hash_value = $api_key . $rand_value . $secret_key . $pki;
+ $hash = base64_encode(sha1($hash_value, true));
+
+ $authorization = 'IYZWS ' . $api_key . ':' . $hash;
+
+ $authorization_data = array(
+ 'authorization' => $authorization,
+ 'rand_value' => $rand_value
+ );
+
+ return $authorization_data;
+ }
+
+ public function apiConnection($authorization_data, $api_connection_object)
+ {
+
+ $url = $this->config->get('payment_iyzico_api_url');
+ $url = $url . '/payment/bin/check';
+
+ $api_connection_object = json_encode($api_connection_object);
+
+ return $this->curlPost($api_connection_object, $authorization_data, $url);
+
+ }
+
+ public function iyzicoPostWebhookUrlKey($authorization_data, $webhook_active_post)
+ {
+
+ $url = $this->config->get('payment_iyzico_api_url');
+ $url = $url . '/payment/notification/update';
+
+ $webhook_active_post = json_encode($webhook_active_post);
+
+ return $this->curlPost($webhook_active_post, $authorization_data, $url);
+
+ }
+
+ public function curlPost($json, $authorizationData, $url)
+ {
+
+ $curl = curl_init();
+ curl_setopt($curl, CURLOPT_URL, $url);
+ if ($json) {
+ curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
+ curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
+ }
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);
+ curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_NONE);
+ curl_setopt($curl, CURLOPT_TIMEOUT, 10);
+
+ curl_setopt(
+ $curl,
+ CURLOPT_HTTPHEADER,
+ array(
+ "Authorization: " . $authorizationData['authorization'],
+ "x-iyzi-rnd:" . $authorizationData['rand_value'],
+ "Content-Type: application/json",
+ )
+ );
+
+ $result = json_decode(curl_exec($curl));
+ curl_close($curl);
+
+
+ return $result;
+ }
+
+}
diff --git a/iyzico/admin/view/.DS_Store b/iyzico/admin/view/.DS_Store
new file mode 100644
index 0000000..cfa567f
Binary files /dev/null and b/iyzico/admin/view/.DS_Store differ
diff --git a/iyzico/admin/view/image/.DS_Store b/iyzico/admin/view/image/.DS_Store
new file mode 100644
index 0000000..ba8286f
Binary files /dev/null and b/iyzico/admin/view/image/.DS_Store differ
diff --git a/iyzico/admin/view/image/payment/iyzico_cards.png b/iyzico/admin/view/image/payment/iyzico_cards.png
new file mode 100644
index 0000000..bc64854
Binary files /dev/null and b/iyzico/admin/view/image/payment/iyzico_cards.png differ
diff --git a/iyzico/admin/view/image/payment/iyzico_logo.png b/iyzico/admin/view/image/payment/iyzico_logo.png
new file mode 100644
index 0000000..e9d57a7
Binary files /dev/null and b/iyzico/admin/view/image/payment/iyzico_logo.png differ
diff --git a/iyzico/admin/view/javascript/.DS_Store b/iyzico/admin/view/javascript/.DS_Store
new file mode 100644
index 0000000..a8ce148
Binary files /dev/null and b/iyzico/admin/view/javascript/.DS_Store differ
diff --git a/iyzico/admin/view/javascript/iyzico/.DS_Store b/iyzico/admin/view/javascript/iyzico/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/iyzico/admin/view/javascript/iyzico/.DS_Store differ
diff --git a/upload/admin/view/javascript/iyzico/accordion_iyzico.js b/iyzico/admin/view/javascript/iyzico/accordion_iyzico.js
old mode 100755
new mode 100644
similarity index 100%
rename from upload/admin/view/javascript/iyzico/accordion_iyzico.js
rename to iyzico/admin/view/javascript/iyzico/accordion_iyzico.js
diff --git a/iyzico/admin/view/javascript/iyzico/validation_iyzico.js b/iyzico/admin/view/javascript/iyzico/validation_iyzico.js
new file mode 100644
index 0000000..91b2163
--- /dev/null
+++ b/iyzico/admin/view/javascript/iyzico/validation_iyzico.js
@@ -0,0 +1 @@
+function getApiValid(){var e,n,t;return event.preventDefault(),e=document.getElementById("api_channel").value,n=document.getElementById("api_key").value,t=document.getElementById("api_key").value,"live"==e?l(n,t):"sandbox"==e?s(n,t):(alert("Geçersiz istek."),!1)}function l(e,n){if("sandbox-"==e.substring(0,8)||"sandbox-"==n.substring(0,8))return alert("{{valid_live}}"),!1}function s(e,n){if("sandbox-"!=e.substring(0,8)||"sandbox-"!=n.substring(0,8))return alert("{{valid_sandbox}}"),!1}
diff --git a/iyzico/admin/view/stylesheet/.DS_Store b/iyzico/admin/view/stylesheet/.DS_Store
new file mode 100644
index 0000000..a8ce148
Binary files /dev/null and b/iyzico/admin/view/stylesheet/.DS_Store differ
diff --git a/upload/admin/view/stylesheet/iyzico/iyzico.css b/iyzico/admin/view/stylesheet/iyzico/iyzico.css
old mode 100755
new mode 100644
similarity index 100%
rename from upload/admin/view/stylesheet/iyzico/iyzico.css
rename to iyzico/admin/view/stylesheet/iyzico/iyzico.css
diff --git a/iyzico/admin/view/template/.DS_Store b/iyzico/admin/view/template/.DS_Store
new file mode 100644
index 0000000..7147f7f
Binary files /dev/null and b/iyzico/admin/view/template/.DS_Store differ
diff --git a/iyzico/admin/view/template/payment/.DS_Store b/iyzico/admin/view/template/payment/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/iyzico/admin/view/template/payment/.DS_Store differ
diff --git a/iyzico/admin/view/template/payment/iyzico.twig b/iyzico/admin/view/template/payment/iyzico.twig
new file mode 100644
index 0000000..f35ad43
--- /dev/null
+++ b/iyzico/admin/view/template/payment/iyzico.twig
@@ -0,0 +1,301 @@
+{{ header }}
+{{ column_left }}
+
{{ error_message }}
+{{ errorMessage }}
diff --git a/iyzico/catalog/view/template/payment/iyzico_form.twig b/iyzico/catalog/view/template/payment/iyzico_form.twig new file mode 100644 index 0000000..23b6b14 --- /dev/null +++ b/iyzico/catalog/view/template/payment/iyzico_form.twig @@ -0,0 +1,23 @@ + +{% if checkoutFormType == 'responsive' %} + +{% endif %} +{% if checkoutFormType == 'popup' %} + +{% endif %} +{{ checkoutFormContent }} diff --git a/iyzico/catalog/view/template/payment/iyzico_success.twig b/iyzico/catalog/view/template/payment/iyzico_success.twig new file mode 100644 index 0000000..d8a6902 --- /dev/null +++ b/iyzico/catalog/view/template/payment/iyzico_success.twig @@ -0,0 +1,88 @@ +{{ header }} +{{ column_name }} | +{{ column_model }} | +{{ column_quantity }} | +{{ column_price }} | +{{ column_total }} | +
{{ product.name }} {% for option in product.option %} + - {{ option.name }}: {{ option.value }} {% endfor %} + {% if product.recurring %} + {{ text_recurring_item }} {{ product.recurring }} {% endif %} |
+ {{ product.model }} | +{{ product.quantity }} | +{{ product.price }} | +{{ product.total }} | +
{{ voucher.description }} | ++ | 1 | +{{ voucher.amount }} | +{{ voucher.amount }} | +
{{ total.title }}: | +{{ total.text }} | +
iyzico
- {% if form_type == 'onepage' %} -Ödeme formu bilgilerinizi doldurup siparişi tamamla butonuna bastığınız zaman aktif olacaktır.
- {% endif %} - -{{ column_name }} | -{{ column_model }} | -{{ column_quantity }} | -{{ column_price }} | -{{ column_total }} | -
{{ product.name }} {% for option in product.option %} - - {{ option.name }}: {{ option.value }} {% endfor %} - {% if product.recurring %} - {{ text_recurring_item }} {{ product.recurring }} {% endif %} |
- {{ product.model }} | -{{ product.quantity }} | -{{ product.price }} | -{{ product.total }} | -
{{ voucher.description }} | -- | 1 | -{{ voucher.amount }} | -{{ voucher.amount }} | -
{{ total.title }}: | -{{ total.text }} | -