diff --git a/Payments/iyzico/upload/admin/controller/payment/iyzico_checkout_installment.php b/Payments/iyzico/upload/admin/controller/payment/iyzico_checkout_form.php similarity index 55% rename from Payments/iyzico/upload/admin/controller/payment/iyzico_checkout_installment.php rename to Payments/iyzico/upload/admin/controller/payment/iyzico_checkout_form.php index b982d60..64cf49e 100644 --- a/Payments/iyzico/upload/admin/controller/payment/iyzico_checkout_installment.php +++ b/Payments/iyzico/upload/admin/controller/payment/iyzico_checkout_form.php @@ -1,31 +1,28 @@ language->load('payment/iyzico_checkout_installment'); + $this->language->load('payment/iyzico_checkout_form'); $this->document->setTitle($this->language->get('heading_title')); $this->load->model('setting/setting'); if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) { - $this->model_setting_setting->editSetting('iyzico_checkout_installment', $this->request->post); - + $this->model_setting_setting->editSetting('iyzico_checkout_form', $this->request->post); $this->session->data['success'] = $this->language->get('text_success'); - if (isset($this->request->post['button']) and $this->request->post['button'] == 'save') { + if (isset($this->request->post['button']) && ($this->request->post['button'] == 'save')) { $this->response->redirect($this->url->link($this->request->get['route'], 'token=' . $this->session->data['token'], 'SSL')); } @@ -33,9 +30,23 @@ public function index() } $data = $this->language->all(); + $data['text_edit'] = $data['heading_title']; + + $data['message'] = ''; - $data['message'] = ''; - $data['error_warning'] = ''; + if (isset($this->error['warning'])) { + $data['error_warning'] = $this->error['warning']; + } else { + $data['error_warning'] = ''; + } + + if (isset($this->session->data['success'])) { + $data['success'] = $this->session->data['success']; + + unset($this->session->data['success']); + } else { + $data['success'] = ''; + } $error_data_array_key = array( 'api_id_live', @@ -46,101 +57,98 @@ public function index() $data["error_{$key}"] = isset($this->error[$key]) ? $this->error[$key] : ''; } - $data['action'] = $this->url->link('payment/iyzico_checkout_installment', 'token=' . $this->session->data['token'], 'SSL'); + $data['action'] = $this->url->link('payment/iyzico_checkout_form', 'token=' . $this->session->data['token'], 'SSL'); $data['cancel'] = $this->url->link('extension/payment', 'token=' . $this->session->data['token'], 'SSL'); $merchant_keys_name_array = array( - 'iyzico_checkout_installment_api_id_live', - 'iyzico_checkout_installment_secret_key_live', - 'iyzico_checkout_installment_order_status_id', - 'iyzico_checkout_installment_status', - 'iyzico_checkout_installment_sort_order', - 'iyzico_checkout_installment_form_class', - 'iyzico_checkout_installment_cancel_order_status_id' + 'iyzico_checkout_form_api_id_live', + 'iyzico_checkout_form_secret_key_live', + 'iyzico_checkout_form_total', + 'iyzico_checkout_form_order_status_id', + 'iyzico_checkout_form_sort_order', + 'iyzico_checkout_form_form_class', + 'iyzico_checkout_form_test', + 'iyzico_checkout_form_status', + 'iyzico_checkout_form_cancel_order_status_id' ); foreach ($merchant_keys_name_array as $key) { $data[$key] = isset($this->request->post[$key]) ? $this->request->post[$key] : $this->config->get($key); } - if (isset($this->request->post['iyzico_checkout_installment_test'])) { - $data['iyzico_checkout_installment_test'] = $this->request->post['iyzico_checkout_installment_test']; - } else { - $mode = $this->config->get('iyzico_checkout_installment_test'); - - if (isset($mode) && $mode == 0) { - $data['iyzico_checkout_installment_test'] = 0; - } else { - $data['iyzico_checkout_installment_test'] = 1; - } - } - $this->load->model('localisation/order_status'); $data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses(); - $data['header'] = $this->load->controller('common/header'); + $data['header'] = $this->load->controller('common/header'); $data['column_left'] = $this->load->controller('common/column_left'); - $data['footer'] = $this->load->controller('common/footer'); + $data['footer'] = $this->load->controller('common/footer'); - $this->response->setOutput($this->load->view('payment/iyzico_checkout_installment.tpl', $data)); + + $this->response->setOutput($this->load->view('payment/iyzico_checkout_form.tpl', $data)); } /** * Install necessary tables and configurations */ - public function install() - { - $this->load->model('payment/iyzico_checkout_installment'); - - $this->model_payment_iyzico_checkout_installment->install(); + public function install() { + $this->load->model('payment/iyzico_checkout_form'); + $this->model_payment_iyzico_checkout_form->install(); } /** * Uninstall necessary tables and configurations */ - public function uninstall() - { - $this->load->model('payment/iyzico_checkout_installment'); - - $this->model_payment_iyzico_checkout_installment->uninstall(); + public function uninstall() { + $this->load->model('payment/iyzico_checkout_form'); + $this->model_payment_iyzico_checkout_form->uninstall(); } /** * Display iyzico transactions in order details * */ - public function order() - { - $this->load->model('payment/iyzico_checkout_installment'); - $this->language->load('payment/iyzico_checkout_installment'); - - $data = $this->language->all(); + public function order() { + $this->load->model('payment/iyzico_checkout_form'); + $this->language->load('payment/iyzico_checkout_form'); $language_id = (int) $this->config->get('config_language_id'); - + $data = array(); $order_id = (int) $this->request->get['order_id']; - $data['token'] = $this->request->get['token']; + $data['text_payment_cancel'] = $this->language->get('text_payment_cancel'); + $data['text_order_cancel'] = $this->language->get('text_order_cancel'); + $data['text_items'] = $this->language->get('text_items'); + $data['text_transactions'] = $this->language->get('text_transactions'); + $data['text_item_name'] = $this->language->get('text_item_name'); + $data['text_paid_price'] = $this->language->get('text_paid_price'); + $data['text_total_refunded_amount'] = $this->language->get('text_total_refunded_amount'); + $data['text_action'] = $this->language->get('text_action'); + $data['text_refund'] = $this->language->get('text_refund'); + $data['text_date_added'] = $this->language->get('text_date_added'); + $data['text_type'] = $this->language->get('text_type'); + $data['text_status'] = $this->language->get('text_status'); + $data['text_note'] = $this->language->get('text_note'); + $data['text_are_you_sure'] = $this->language->get('text_are_you_sure'); + $data['text_please_enter_amount'] = $this->language->get('text_please_enter_amount'); $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "iyzico_order` WHERE `order_id` = '{$order_id}' ORDER BY `iyzico_order_id` DESC"); - - $data['successful_cancel_counts'] = 0; - $data['successful_refund_counts'] = 0; - $data['same_date'] = 'no'; - $data['iyzico_transactions'] = array(); - $data['order_id'] = $order_id; - $data['payment_success'] = 'no'; - $data['display_cancel_option'] = 'no'; + $data['successful_cancel_counts'] = 0; + $data['successful_refund_counts'] = 0; + $data['same_date'] = 'no'; + $data['iyzico_transactions'] = array(); + $data['order_id'] = $order_id; + $data['payment_success'] = 'no'; + $data['display_cancel_option'] = 'no'; $data['iyzico_transactions_refunds_data'] = array(); - foreach ($query->rows as $row) { switch ($row['request_type']) { case 'get_auth': $row['transaction_type'] = $this->language->get('payment_transaction_type'); if ($row['transaction_status'] == "success") { + if (date('Y-m-d', strtotime($row['date_modified'])) == date('Y-m-d')) { $data['same_date'] = 'yes'; } @@ -149,7 +157,6 @@ public function order() if (!empty($row['api_response'])) { $auth_response = json_decode($row['api_response'], true); - if (is_array($auth_response) && $auth_response['status'] == 'success' && $auth_response['paymentStatus'] == "SUCCESS") { if (!empty($auth_response['paymentId'])) { $data['display_cancel_option'] = 'yes'; @@ -161,21 +168,25 @@ public function order() $data['iyzico_transactions'][] = $row; break; + case 'order_cancel': + if ($row['transaction_status'] == "success") { - $data['successful_cancel_counts']++; + $data['successful_cancel_counts'] ++; } - $row['transaction_type'] = $this->language->get('cancel_transaction_type'); + $row['transaction_type'] = $this->language->get('cancel_transaction_type'); $data['iyzico_transactions'][] = $row; break; + case 'order_refund': + if ($row['transaction_status'] == "success") { - $data['successful_refund_counts']++; + $data['successful_refund_counts'] ++; } - $row['transaction_type'] = $this->language->get('refund_transaction_type'); + $row['transaction_type'] = $this->language->get('refund_transaction_type'); $data['iyzico_transactions'][] = $row; break; @@ -183,7 +194,6 @@ public function order() } $this->load->model('sale/order'); - $order_details = $this->model_sale_order->getOrder($order_id); $refunded_transactions_query_string = "SELECT rf.*, pd.name FROM `" . DB_PREFIX . "iyzico_order_refunds` rf " . @@ -194,41 +204,36 @@ public function order() "ORDER BY `iyzico_order_refunds_id` ASC"; $refunded_transactions_query = $this->db->query($refunded_transactions_query_string); - foreach ($refunded_transactions_query->rows as $refunded_item) { - $refunded_item['paid_price_converted'] = $this->currency->format($refunded_item['paid_price'], $order_details['currency_code'], false); + $refunded_item['paid_price_converted'] = $this->currency->format($refunded_item['paid_price'], $order_details['currency_code'], false); $refunded_item['total_refunded_converted'] = $this->currency->format($refunded_item['total_refunded'], $order_details['currency_code'], false); - $refunded_item['remaining_refund_amount'] = $refunded_item['paid_price'] - $refunded_item['total_refunded']; - $refunded_item['full_refunded'] = ($refunded_item['paid_price'] == $refunded_item['total_refunded']) ? 'yes' : 'no'; - + $refunded_item['remaining_refund_amount'] = $refunded_item['paid_price'] - $refunded_item['total_refunded']; + $refunded_item['full_refunded'] = ($refunded_item['paid_price'] == $refunded_item['total_refunded']) ? 'yes' : 'no'; $data['iyzico_transactions_refunds_data'][] = $refunded_item; } - return $this->load->view('payment/iyzico_checkout_installment_order.tpl', $data); + return $this->load->view('payment/iyzico_checkout_form_order.tpl', $data); } /** * Cancel order API * */ - public function cancel() - { + public function cancel() { error_reporting(0); - - $this->language->load('payment/iyzico_checkout_installment'); + $this->language->load('payment/iyzico_checkout_form'); $order_id = $this->request->post['order_id']; - $data = array( 'order_id' => $order_id, - 'success' => 'false' + 'success' => 'false' ); - try { + if (!$order_id) { throw new \Exception($this->language->get('error_invalid_order')); } - $this->load->model('payment/iyzico_checkout_installment'); + $this->load->model('payment/iyzico_checkout_form'); $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "iyzico_order` WHERE `order_id` = '{$order_id}' AND `request_type` = 'get_auth' ORDER BY `iyzico_order_id` DESC"); @@ -239,7 +244,6 @@ public function cancel() $transaction = $query->row; $auth_response = json_decode($transaction['api_response'], true); - if (empty($auth_response)) { throw new \Exception($this->language->get('error_invalid_order')); } @@ -252,52 +256,48 @@ public function cancel() IyzipayBootstrap::init(); - $merchant_api_id = $this->config->get('iyzico_checkout_installment_api_id_live'); - $merchant_secret_key = $this->config->get('iyzico_checkout_installment_secret_key_live'); + $merchant_api_id = $this->config->get('iyzico_checkout_form_api_id_live'); + $merchant_secret_key = $this->config->get('iyzico_checkout_form_secret_key_live'); - $configuration = new \Iyzipay\Client\Configuration\ClientConfiguration(); - $configuration->setApiKey($merchant_api_id); - $configuration->setSecretKey($merchant_secret_key); - $configuration->setBaseUrl($this->base_url); + $options = new \Iyzipay\Options(); + $options->setApiKey($merchant_api_id); + $options->setSecretKey($merchant_secret_key); + $options->setBaseUrl($this->getBaseUrl()); - $client = \Iyzipay\Client\Service\EcomPaymentServiceClient::fromConfiguration($configuration); - - $request = new \Iyzipay\Client\Basic\Payment\Request\PaymentCancelRequest(); - $request->setLocale(\Iyzipay\Client\RequestLocaleType::TR); + $request = new \Iyzipay\Request\CreateCancelRequest(); + $request->setLocale($this->config->get('config_language')); $request->setConversationId(uniqid($this->order_prefix) . "_cancel_" . $order_id); $request->setPaymentId($payment_id); $request->setIp($this->request->server['REMOTE_ADDR']); $save_data_array = array( - 'order_id' => $order_id, + 'order_id' => $order_id, 'transaction_status' => 'in process', - 'date_created' => date('Y-m-d H:i:s'), - 'date_modified' => date('Y-m-d H:i:s'), - 'api_request' => $request->toJsonString(), - 'api_response' => '', - 'request_type' => 'order_cancel', - 'note' => '' + 'date_created' => date('Y-m-d H:i:s'), + 'date_modified' => date('Y-m-d H:i:s'), + 'api_request' => $request->toJsonString(), + 'api_response' => '', + 'request_type' => 'order_cancel', + 'note' => '' ); + $cancel_transaction_id = $this->model_payment_iyzico_checkout_form->createOrderEntry($save_data_array); - $cancel_transaction_id = $this->model_payment_iyzico_checkout_installment->createOrderEntry($save_data_array); - - $response = $client->cancel($request); + $response = \Iyzipay\Model\Cancel::create($request, $options); $update_data_array = array( - 'date_modified' => date('Y-m-d H:i:s'), - 'api_response' => $response->getRawResult(), - 'transaction_status' => $response->getStatus(), + 'date_modified' => date('Y-m-d H:i:s'), + 'api_response' => $response->getRawResult(), + 'transaction_status' => $response->getStatus(), 'processing_timestamp' => date('Y-m-d H:i:s', $response->getSystemTime() / 1000), - 'note' => ($response->getStatus() == "failure") ? $response->getErrorMessage() : $this->language->get('cancel_done_success') + 'note' => ($response->getStatus() == "failure") ? $response->getErrorMessage() : $this->language->get('cancel_done_success') ); - - $this->model_payment_iyzico_checkout_installment->updateOrderEntry($update_data_array, $cancel_transaction_id); + $this->model_payment_iyzico_checkout_form->updateOrderEntry($update_data_array, $cancel_transaction_id); if ($response->getStatus() == "failure") { throw new \Exception($response->getErrorMessage()); } - $this->_addhistory($order_id, $this->config->get('iyzico_checkout_installment_cancel_order_status_id'), $data['message']); + $this->_addhistory($order_id, $this->config->get('iyzico_checkout_form_cancel_order_status_id'), $data['message']); $data['message'] = $this->language->get('cancel_done_success'); $data['success'] = "true"; @@ -312,37 +312,34 @@ public function cancel() * Full/Partial Refund API * */ - public function refund() - { + public function refund() { error_reporting(0); - - $this->language->load('payment/iyzico_checkout_installment'); - - $order_id = (int) $this->request->post['order_id']; + $this->language->load('payment/iyzico_checkout_form'); + $order_id = (int) $this->request->post['order_id']; $language_id = (int) $this->config->get('config_language_id'); - $data = array( 'order_id' => $order_id, - 'success' => 'false' + 'success' => 'false' ); try { + if (!$order_id) { throw new \Exception($this->language->get('error_invalid_order')); } $this->load->model('sale/order'); - $this->load->model('payment/iyzico_checkout_installment'); - - $item_id = (int) $this->request->post['item_id']; - $amount = (double) $this->request->post['amount']; + $this->load->model('payment/iyzico_checkout_form'); + $item_id = (int) $this->request->post['item_id']; + $amount = (double) $this->request->post['amount']; $order_details = $this->model_sale_order->getOrder($order_id); if (!$order_details) { throw new \Exception($this->language->get('error_invalid_order')); } - $refunded_transactions_query_string = "SELECT * FROM `" . DB_PREFIX . "iyzico_order_refunds` " . "WHERE `order_id` = '{$order_id}' AND `item_id` = '{$item_id}'"; + $refunded_transactions_query_string = "SELECT * FROM `" . DB_PREFIX . "iyzico_order_refunds` " . + "WHERE `order_id` = '{$order_id}' AND `item_id` = '{$item_id}'"; $refunded_transactions_query = $this->db->query($refunded_transactions_query_string); @@ -350,67 +347,62 @@ public function refund() throw new \Exception($this->language->get('error_invalid_order')); } - $refund_data = $refunded_transactions_query->row; + $refund_data = $refunded_transactions_query->row; $remaining_amount = (double) $refund_data['paid_price'] - (double) $refund_data['total_refunded']; $diff = (string) $amount - (string) $remaining_amount; - if ($diff > 0) { throw new \Exception(sprintf($this->language->get('request_amount_not_greater_than'), $remaining_amount)); } IyzipayBootstrap::init(); - $merchant_api_id = $this->config->get('iyzico_checkout_installment_api_id_live'); - $merchant_secret_key = $this->config->get('iyzico_checkout_installment_secret_key_live'); - - $configuration = new \Iyzipay\Client\Configuration\ClientConfiguration(); + $merchant_api_id = $this->config->get('iyzico_checkout_form_api_id_live'); + $merchant_secret_key = $this->config->get('iyzico_checkout_form_secret_key_live'); - $configuration->setApiKey($merchant_api_id); - $configuration->setSecretKey($merchant_secret_key); - $configuration->setBaseUrl($this->base_url); + $options = new \Iyzipay\Options(); + $options->setApiKey($merchant_api_id); + $options->setSecretKey($merchant_secret_key); + $options->setBaseUrl($this->getBaseUrl()); - $client = \Iyzipay\Client\Service\EcomPaymentServiceClient::fromConfiguration($configuration); - - $request = new \Iyzipay\Client\Basic\Payment\Request\PaymentRefundRequest(); - - $request->setLocale(\Iyzipay\Client\RequestLocaleType::TR); + $request = new \Iyzipay\Request\CreateRefundRequest(); + $request->setLocale($this->config->get('config_language')); $request->setConversationId(uniqid($this->order_prefix) . "_refund_{$order_id}_{$item_id}"); $request->setPaymentTransactionId($refund_data['payment_transaction_id']); $request->setPrice($amount); $request->setIp($this->request->server['REMOTE_ADDR']); - $product_data_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "product_description` " . "WHERE `product_id` = '{$item_id}' " . "AND `language_id` = '{$language_id}'"); - $product_data = $product_data_query->row; + $product_data_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "product_description` " . + "WHERE `product_id` = '{$item_id}' " . + "AND `language_id` = '{$language_id}'"); + $product_data = $product_data_query->row; - $amount_formated = $this->currency->format($amount, $order_details['currency_code'], false); + $amount_formated = $this->currency->format($amount, $order_details['currency_code'], false); $success_refund_message = sprintf($this->language->get('refund_done_success'), $item_id, $product_data['name'], $amount_formated); $save_data_array = array( - 'order_id' => $order_id, + 'order_id' => $order_id, 'transaction_status' => 'in process', - 'date_created' => date('Y-m-d H:i:s'), - 'date_modified' => date('Y-m-d H:i:s'), - 'api_request' => $request->toJsonString(), - 'api_response' => '', - 'item_id' => $item_id, - 'request_type' => 'order_refund', - 'note' => '' + 'date_created' => date('Y-m-d H:i:s'), + 'date_modified' => date('Y-m-d H:i:s'), + 'api_request' => $request->toJsonString(), + 'api_response' => '', + 'item_id' => $item_id, + 'request_type' => 'order_refund', + 'note' => '' ); + $refund_transaction_id = $this->model_payment_iyzico_checkout_form->createOrderEntry($save_data_array); - $refund_transaction_id = $this->model_payment_iyzico_checkout_installment->createOrderEntry($save_data_array); - - $response = $client->refund($request); + $response = \Iyzipay\Model\Refund::create($request, $options); $update_data_array = array( - 'date_modified' => date('Y-m-d H:i:s'), - 'api_response' => $response->getRawResult(), - 'transaction_status' => $response->getStatus(), + 'date_modified' => date('Y-m-d H:i:s'), + 'api_response' => $response->getRawResult(), + 'transaction_status' => $response->getStatus(), 'processing_timestamp' => date('Y-m-d H:i:s', $response->getSystemTime() / 1000), - 'note' => ($response->getStatus() == "failure") ? $response->getErrorMessage() : $success_refund_message + 'note' => ($response->getStatus() == "failure") ? $response->getErrorMessage() : $success_refund_message ); - - $this->model_payment_iyzico_checkout_installment->updateOrderEntry($update_data_array, $refund_transaction_id); + $this->model_payment_iyzico_checkout_form->updateOrderEntry($update_data_array, $refund_transaction_id); if ($response->getStatus() == "failure") { throw new \Exception($response->getErrorMessage()); @@ -418,7 +410,9 @@ public function refund() $new_refunded_total = (double) $refund_data['total_refunded'] + $amount; - $update_refund_query_string = "UPDATE `" . DB_PREFIX . "iyzico_order_refunds` " . "SET `total_refunded` = '{$new_refunded_total}' " . "WHERE `order_id` = '{$order_id}' AND `item_id` = '{$item_id}'"; + $update_refund_query_string = "UPDATE `" . DB_PREFIX . "iyzico_order_refunds` " . + "SET `total_refunded` = '{$new_refunded_total}' " . + "WHERE `order_id` = '{$order_id}' AND `item_id` = '{$item_id}'"; $this->db->query($update_refund_query_string); @@ -437,29 +431,34 @@ public function refund() * Validate admin settings form * */ - protected function validate() - { - if (!$this->user->hasPermission('modify', 'payment/iyzico_checkout_installment')) { + protected function validate() { + if (!$this->user->hasPermission('modify', 'payment/iyzico_checkout_form')) { $this->error['warning'] = $this->language->get('error_permission'); } - if (empty($this->request->post["iyzico_checkout_installment_api_id_live"])) { - $this->error['api_id_live'] = $this->language->get("error_api_id_live"); - } + $validation_array = array( + 'api_id_live', + 'secret_key_live' + ); - if (empty($this->request->post["iyzico_checkout_installment_secret_key_live"])) { - $this->error['secret_key_live'] = $this->language->get("error_secret_key_live"); + foreach ($validation_array as $key) { + if (empty($this->request->post["iyzico_checkout_form_{$key}"])) { + $this->error[$key] = $this->language->get("error_$key"); + } } - return !$this->error; + if (!$this->error) { + return true; + } else { + return false; + } } /** * Add history after cancel and refund api execution. * */ - protected function _addhistory($order_id, $order_status_id, $comment) - { + private function _addhistory($order_id, $order_status_id, $comment) { error_reporting(0); $this->load->model('user/api'); @@ -472,9 +471,8 @@ protected function _addhistory($order_id, $order_status_id, $comment) $api_login_response = $this->_curlCall(array( 'key' => $api_key - ), - $site_url . 'index.php?route=api/login' - ); + ), $site_url . 'index.php?route=api/login'); + if (empty($api_login_response)) { return false; @@ -490,11 +488,10 @@ protected function _addhistory($order_id, $order_status_id, $comment) $this->_curlCall(array( 'order_status_id' => $order_status_id, - 'notify' => 1, - 'comment' => $comment - ), - $site_url . "index.php?route=api/order/history&token={$token}&order_id={$order_id}" - ); + 'notify' => 1, + 'comment' => $comment + ), $site_url . "index.php?route=api/order/history&token={$token}&order_id={$order_id}"); + return true; } @@ -503,14 +500,12 @@ protected function _addhistory($order_id, $order_status_id, $comment) * Get site url * */ - public function getSiteUrl() - { + public function getSiteUrl() { if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { $site_url = HTTPS_CATALOG; } else { $site_url = HTTP_CATALOG; } - return $site_url; } @@ -518,10 +513,9 @@ public function getSiteUrl() * Curl call to add history api calls * */ - protected function _curlCall($postFieldsArray, $apiUrl = null) - { - $fields_string = null; + private function _curlCall($postFieldsArray, $apiUrl = null) { + $fields_string = null; if (!empty($postFieldsArray)) { $fields_string = http_build_query($postFieldsArray); } @@ -530,14 +524,14 @@ protected function _curlCall($postFieldsArray, $apiUrl = null) curl_setopt($ch, CURLOPT_URL, $apiUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_POST, count($postFieldsArray)); + curl_setopt($ch, CURLOPT_POST, count($postFieldsArray)); if (!is_null($fields_string)) { curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); } - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); $response = curl_exec($ch); @@ -545,4 +539,18 @@ protected function _curlCall($postFieldsArray, $apiUrl = null) return $response; } + + + public function getBaseUrl() + { + $mode = $this->config->get('iyzico_checkout_form_test'); + + if (isset($mode) && $mode == 1) { + $url = "https://sandbox-api.iyzipay.com"; + } else { + $url = "https://api.iyzipay.com"; + } + + return $url; + } } diff --git a/Payments/iyzico/upload/admin/language/en-GB/payment/iyzico_checkout_form.php b/Payments/iyzico/upload/admin/language/en-GB/payment/iyzico_checkout_form.php new file mode 100644 index 0000000..79e9b95 --- /dev/null +++ b/Payments/iyzico/upload/admin/language/en-GB/payment/iyzico_checkout_form.php @@ -0,0 +1,68 @@ +iyzico'; +$_['text_iyzico_checkout_form_info'] = 'You can get your API ID and Secret Key values from https://merchant.iyzipay.com/settings'; +// Entry +$_['entry_api_id_live'] = 'Live API ID'; +$_['entry_secret_key_live'] = 'Live Secret Key'; +$_['entry_total'] = 'Total'; +$_['entry_order_status'] = 'Order Status'; +$_['entry_status'] = 'Status'; +$_['entry_sort_order'] = 'Sort Order'; +$_['entry_class'] = "Form Class "; +$_['entry_class_popup'] = "Popup"; +$_['entry_class_responsive'] = "Responsive"; +$_['entry_test'] = "Test Mode"; +$_['entry_cancel_order_status'] = "Cancel Order Status"; + +// Error +$_['error_permission'] = 'You are not authorized!'; +$_['error_api_id_live'] = 'API ID required!'; +$_['error_secret_key_live'] = 'Secret key required!'; +$_['error_invalid_order'] = 'Invalid Order'; + +$_['iyzico_single_keys_must_configured'] = "You must configure iyzico single payment keys to activate this plugin."; +$_['Token Expired.'] = 'Token Expired.'; +$_['Token is expired. Please try again.'] = 'Token is expired. Please try again.'; +$_['Invalid call.'] = 'Invalid call.'; + +// Details +$_['payment_transaction_type'] = 'Payment Transaction'; +$_['cancel_transaction_type'] = 'Cancel'; +$_['refund_transaction_type'] = 'Refund'; +$_['cancel_done_success'] = 'Your order has been canceled successfully.'; + +$_['request_amount_not_greater_than'] = 'Requested amount should not be greater than %s.'; +$_['refund_done_success'] = 'Refund done successfully. Item Id: %s, Item Name: %s, Amount: %s'; + +$_['order_status_after_payment_tooltip'] = 'Order status after successful payment'; +$_['order_status_after_cancel_tooltip'] = 'Order status after successful cancel'; +$_['test_tooltip'] = 'Use the live or testing (sandbox) gateway server to process transactions'; +$_['total_tooltip'] = 'The checkout total the order must reach before this payment method becomes active'; + +$_['text_payment_cancel'] = 'Payment Cancel'; +$_['text_order_cancel'] = 'Cancel Full Order'; +$_['text_items'] = 'Item(s)'; +$_['text_transactions'] = 'Transaction(s)'; +$_['text_processing'] = 'Processing...'; +$_['text_item_name'] = 'Item Name'; +$_['text_paid_price'] = 'Paid Price'; +$_['text_total_refunded_amount'] = 'Total Refunded Amount'; +$_['text_action'] = 'Action'; +$_['text_refund'] = 'Refund'; +$_['text_date_added'] = 'Date Added'; +$_['text_type'] = 'Type'; +$_['text_status'] = 'Status'; +$_['text_note'] = 'Note'; +$_['text_are_you_sure'] = 'Are you sure?'; +$_['text_please_enter_amount'] = 'Please Enter Amount.'; + +$_['text_enabled'] = 'Enabled'; +$_['text_disabled'] = 'Disabled'; \ No newline at end of file diff --git a/Payments/iyzico/upload/admin/language/en-GB/payment/iyzico_checkout_installment.php b/Payments/iyzico/upload/admin/language/en-GB/payment/iyzico_checkout_installment.php deleted file mode 100644 index 072d01b..0000000 --- a/Payments/iyzico/upload/admin/language/en-GB/payment/iyzico_checkout_installment.php +++ /dev/null @@ -1,71 +0,0 @@ -iyzico'; -$_['text_iyzico_checkout_installment_info'] = 'You can get your API ID and Secret Key values from https://merchant.iyzipay.com/settings'; -// Entry -$_['entry_api_id_live'] = 'Live Api Id'; -$_['entry_secret_key_live'] = 'Live Secret Key'; -$_['entry_order_status'] = 'Order Status'; -$_['entry_status'] = 'Status'; -$_['entry_sort_order'] = 'Sort Order'; -$_['entry_class'] = "Form Class "; -$_['entry_class_popup'] = "Popup"; -$_['entry_class_responsive'] = "Responsive"; -$_['entry_cancel_order_status'] = "Cancel Order Status"; -$_['entry_test_tooltip'] = 'Use the live or testing (sandbox) gateway server to process transactions'; - -// Error -$_['error_permission'] = 'You are not authorized!'; -$_['error_api_id_live'] = 'API ID required!'; -$_['error_secret_key_live'] = 'Secret key required!'; -$_['error_invalid_order'] = 'Invalid Order'; - -$_['iyzico_single_keys_must_configured'] = "You must configure iyzico single payment keys to activate this plugin."; -$_['Token Expired.'] = 'Token Expired.'; -$_['Token is expired. Please try again.'] = 'Token is expired. Please try again.'; -$_['Invalid call.'] = 'Invalid call.'; - -// Details -$_['payment_transaction_type'] = 'Payment Transaction'; -$_['cancel_transaction_type'] = 'Cancel'; -$_['refund_transaction_type'] = 'Refund'; -$_['cancel_done_success'] = 'Your order has been canceled successfully.'; - -$_['request_amount_not_greater_than'] = 'Requested amount should not be greater than %s.'; -$_['refund_done_success'] = 'Refund done successfully. Item Id: %s, Item Name: %s, Amount: %s'; - -$_['order_status_after_payment_tooltip'] = 'Order status after successful payment'; -$_['order_status_after_cancel_tooltip'] = 'Order status after successful cancel'; - -$_['text_payment_cancel'] = 'Payment Cancel'; -$_['text_order_cancel'] = 'Cancel Full Order'; -$_['text_items'] = 'Item(s)'; -$_['text_transactions'] = 'Transaction(s)'; -$_['text_processing'] = 'Processing...'; -$_['text_item_name'] = 'Item Name'; -$_['text_paid_price'] = 'Paid Price'; -$_['text_total_refunded_amount'] = 'Total Refunded Amount'; -$_['text_action'] = 'Action'; -$_['text_refund'] = 'Refund'; -$_['text_date_added'] = 'Date Added'; -$_['text_type'] = 'Type'; -$_['text_status'] = 'Status'; -$_['text_note'] = 'Note'; -$_['text_are_you_sure'] = 'Are you sure?'; -$_['text_please_enter_amount'] = 'Please Enter Amount.'; - -$_['text_enabled'] = 'Enabled'; -$_['text_disabled'] = 'Disabled'; \ No newline at end of file diff --git a/Payments/iyzico/upload/admin/language/tr-TR/payment/iyzico_checkout_form.php b/Payments/iyzico/upload/admin/language/tr-TR/payment/iyzico_checkout_form.php new file mode 100644 index 0000000..d847480 --- /dev/null +++ b/Payments/iyzico/upload/admin/language/tr-TR/payment/iyzico_checkout_form.php @@ -0,0 +1,68 @@ +iyzico'; +$_['text_iyzico_checkout_form_info'] = "Apı Id ve Secret Key anahtarlarınızı https://merchant.iyzipay.com/settings 'dan alabilirsiniz."; +// Entry +$_['entry_api_id_live'] = 'Live Api Id'; +$_['entry_secret_key_live'] = 'Live Secret Key'; +$_['entry_total'] = 'Tutar'; +$_['entry_order_status'] = 'Satın sonrası al Durum'; +$_['entry_status'] = 'Durumu'; +$_['entry_sort_order'] = 'Sıralama Türü'; +$_['entry_class'] = "Form Gösterimi"; +$_['entry_class_popup'] = "PopUp"; +$_['entry_class_responsive'] = "Responsive"; +$_['entry_cancel_order_status'] = "İptal"; +$_['entry_test'] = "Test Modu"; + +// Error +$_['error_permission'] = 'Sen yetkiniz yok!'; +$_['error_api_id_live'] = 'Canlı API ID gereklidir!'; +$_['error_secret_key_live'] = 'Canlı Gizli anahtarı gereklidir!'; +$_['error_invalid_order'] = 'Geçersiz Sipariş'; + +$_['iyzico_single_keys_must_configured'] = "Bu eklenti etkinleştirmek için iyzico tek ödeme anahtarlarını yapılandırmanız gerekir."; +$_['Token Expired.'] = 'Token süresi doldu.'; +$_['Token is expired. Please try again.'] = 'Simge süresi dolmuş. Lütfen tekrar deneyiniz.'; +$_['Invalid call.'] = 'Geçersiz arayın.'; + +// Details +$_['payment_transaction_type'] = 'Ödeme İşlemi'; +$_['cancel_transaction_type'] = 'İptal'; +$_['refund_transaction_type'] = 'İade'; +$_['cancel_done_success'] = 'Siparişiniz iptal edilmiştir.'; + +$_['request_amount_not_greater_than'] = "Sipariş tutarı %s 'dan büyük olamaz"; +$_['refund_done_success'] = 'İade işlemi başarılı. Ürün no: %s, Ürün Adı:%s, Tutar: %s'; + +$_['order_status_after_payment_tooltip'] = 'Başarılı ödeme sornası sipariş durumu'; +$_['order_status_after_cancel_tooltip'] = 'Başarılı iptal sonrası sipariş durumu'; +$_['test_tooltip'] = 'Işlemleri gerçekleştirmek için Test veya canlı detay kullanın'; +$_['total_tooltip'] = 'Bu ödeme metodun aktif olması için ulaşılması gereken sepet tutarı'; + +$_['text_payment_cancel'] = 'Ödeme İptal Edildi.'; +$_['text_order_cancel'] = 'İşlemi İptal Et.'; +$_['text_items'] = 'Ürünler'; +$_['text_transactions'] = 'Ürünler'; +$_['text_processing'] = 'İşlem Sürüyor.'; +$_['text_item_name'] = 'Ürün Adı'; +$_['text_paid_price'] = 'Tahsil Edilen Tutar'; +$_['text_total_refunded_amount'] = 'İade Edilen Tutar.'; +$_['text_action'] = 'Aksiyon'; +$_['text_refund'] = 'İade'; +$_['text_date_added'] = 'Eklenme Tarihi'; +$_['text_type'] = 'Tip'; +$_['text_status'] = 'Statu'; +$_['text_note'] = 'Not'; +$_['text_are_you_sure'] = 'Emin misiniz?'; +$_['text_please_enter_amount'] = 'Lütfen Tutar Giriniz.'; + +$_['text_enabled'] = 'Enabled'; +$_['text_disabled'] = 'Disabled'; diff --git a/Payments/iyzico/upload/admin/language/tr-TR/payment/iyzico_checkout_installment.php b/Payments/iyzico/upload/admin/language/tr-TR/payment/iyzico_checkout_installment.php deleted file mode 100644 index 12d2fb9..0000000 --- a/Payments/iyzico/upload/admin/language/tr-TR/payment/iyzico_checkout_installment.php +++ /dev/null @@ -1,71 +0,0 @@ -iyzico'; -$_['text_iyzico_checkout_installment_info'] = "Apı Id ve Secret Key anahtarlarınızı https://merchant.iyzipay.com/settings 'dan alabilirsiniz."; -// Entry -$_['entry_api_id_live'] = 'Live Api Id'; -$_['entry_secret_key_live'] = 'Live Secret Key'; -$_['entry_order_status'] = 'Satın sonrası al Durum'; -$_['entry_status'] = 'Durumu'; -$_['entry_sort_order'] = 'Sıralama Türü'; -$_['entry_class'] = "Form Gösterimi"; -$_['entry_class_popup'] = "PopUp"; -$_['entry_class_responsive'] = "Responsive"; -$_['entry_cancel_order_status'] = "İptal"; -$_['entry_test_tooltip'] = 'Işlemleri gerçekleştirmek için Test veya canlı detay kullanın'; - -// Error -$_['error_permission'] = 'Sen yetkiniz yok!'; -$_['error_api_id_live'] = 'Canlı API ID gereklidir!'; -$_['error_secret_key_live'] = 'Canlı Gizli anahtarı gereklidir!'; -$_['error_invalid_order'] = 'Geçersiz Sipariş'; - -$_['iyzico_single_keys_must_configured'] = "Bu eklenti etkinleştirmek için iyzico tek ödeme anahtarlarını yapılandırmanız gerekir."; -$_['Token Expired.'] = 'Token süresi doldu.'; -$_['Token is expired. Please try again.'] = 'Simge süresi dolmuş. Lütfen tekrar deneyiniz.'; -$_['Invalid call.'] = 'Geçersiz arayın.'; - -// Details -$_['payment_transaction_type'] = 'Ödeme İşlemi'; -$_['cancel_transaction_type'] = 'İptal'; -$_['refund_transaction_type'] = 'İade'; -$_['cancel_done_success'] = 'Siparişiniz iptal edilmiştir.'; - -$_['request_amount_not_greater_than'] = "Sipariş tutarı %s 'dan büyük olamaz"; -$_['refund_done_success'] = 'İade işlemi başarılı. Ürün no: %s, Ürün Adı:%s, Tutar: %s'; - -$_['order_status_after_payment_tooltip'] = 'Başarılı ödeme sornası sipariş durumu'; -$_['order_status_after_cancel_tooltip'] = 'Başarılı iptal sonrası sipariş durumu'; - -$_['text_payment_cancel'] = 'Ödeme İptal Edildi.'; -$_['text_order_cancel'] = 'İşlemi İptal Et.'; -$_['text_items'] = 'Ürünler'; -$_['text_transactions'] = 'Ürünler'; -$_['text_processing'] = 'İşlem Sürüyor.'; -$_['text_item_name'] = 'Ürün Adı'; -$_['text_paid_price'] = 'Tahsil Edilen Tutar'; -$_['text_total_refunded_amount'] = 'İade Edilen Tutar.'; -$_['text_action'] = 'Aksiyon'; -$_['text_refund'] = 'İade'; -$_['text_date_added'] = 'Eklenme Tarihi'; -$_['text_type'] = 'Tip'; -$_['text_status'] = 'Statu'; -$_['text_note'] = 'Not'; -$_['text_are_you_sure'] = 'Emin misiniz?'; -$_['text_please_enter_amount'] = 'Lütfen Tutar Giriniz.'; - -$_['text_enabled'] = 'Enabled'; -$_['text_disabled'] = 'Disabled'; diff --git a/Payments/iyzico/upload/admin/model/payment/iyzico_checkout_form.php b/Payments/iyzico/upload/admin/model/payment/iyzico_checkout_form.php new file mode 100644 index 0000000..85cc5a7 --- /dev/null +++ b/Payments/iyzico/upload/admin/model/payment/iyzico_checkout_form.php @@ -0,0 +1,89 @@ +db->query(" + CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "iyzico_order` ( + `iyzico_order_id` INT(11) NOT NULL AUTO_INCREMENT, + `order_id` INT(11) NOT NULL, + `item_id` INT(11) NOT NULL DEFAULT 0, + `transaction_status` VARCHAR(50), + `date_created` DATETIME NOT NULL, + `date_modified` DATETIME NOT NULL, + `processing_timestamp` DATETIME NOT NULL, + `api_request` TEXT, + `api_response` TEXT, + `request_type` VARCHAR(50), + `note` TEXT, + PRIMARY KEY (`iyzico_order_id`) + ) ENGINE=MyISAM DEFAULT COLLATE=utf8_general_ci;"); + + $this->db->query(" + CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "iyzico_order_refunds` ( + `iyzico_order_refunds_id` INT(11) NOT NULL AUTO_INCREMENT, + `order_id` INT(11) NOT NULL, + `item_id` INT(11) NOT NULL, + `payment_transaction_id` INT(11) NOT NULL, + `paid_price` VARCHAR(50), + `total_refunded` VARCHAR(50), + PRIMARY KEY (`iyzico_order_refunds_id`) + ) ENGINE=MyISAM DEFAULT COLLATE=utf8_general_ci;"); + } + + /** + * Drop tables + */ + public function uninstall() { + $this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "iyzico_order`;"); + $this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "iyzico_order_refunds`;"); + } + + /** + * Log + * + */ + public function logger($message) { + $log = new Log('iyzico_checkout_form.log'); + $log->write($message); + } + + /** + * Create order entry for iyzico transactions + * + */ + public function createOrderEntry($data) { + + $query_string = "INSERT INTO " . DB_PREFIX . "iyzico_order SET"; + $data_array = array(); + foreach ($data as $key => $value) { + $data_array[] = "`$key` = '" . $this->db->escape($value) . "'"; + } + $data_string = implode(", ", $data_array); + $query_string .= $data_string; + $query_string .= ";"; + $this->db->query($query_string); + return $this->db->getLastId(); + } + + /** + * Update order details for iyzico transactions + * + */ + public function updateOrderEntry($data, $id) { + + $query_string = "UPDATE " . DB_PREFIX . "iyzico_order SET"; + $data_array = array(); + foreach ($data as $key => $value) { + $data_array[] = "`$key` = '" . $this->db->escape($value) . "'"; + } + $data_string = implode(", ", $data_array); + $query_string .= $data_string; + $query_string .= " WHERE `iyzico_order_id` = {$id};"; + return $this->db->query($query_string); + } + +} diff --git a/Payments/iyzico/upload/admin/model/payment/iyzico_checkout_installment.php b/Payments/iyzico/upload/admin/model/payment/iyzico_checkout_installment.php deleted file mode 100644 index dbbeaed..0000000 --- a/Payments/iyzico/upload/admin/model/payment/iyzico_checkout_installment.php +++ /dev/null @@ -1,106 +0,0 @@ -db->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "iyzico_order` ( - `iyzico_order_id` INT(11) NOT NULL AUTO_INCREMENT, - `order_id` INT(11) NOT NULL, - `item_id` INT(11) NOT NULL DEFAULT 0, - `transaction_status` VARCHAR(50), - `date_created` DATETIME NOT NULL, - `date_modified` DATETIME NOT NULL, - `processing_timestamp` DATETIME NOT NULL, - `api_request` TEXT, - `api_response` TEXT, - `request_type` VARCHAR(50), - `note` TEXT, - PRIMARY KEY (`iyzico_order_id`) - ) ENGINE=MyISAM DEFAULT COLLATE=utf8_general_ci;"); - - $this->db->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "iyzico_order_refunds` ( - `iyzico_order_refunds_id` INT(11) NOT NULL AUTO_INCREMENT, - `order_id` INT(11) NOT NULL, - `item_id` INT(11) NOT NULL, - `payment_transaction_id` INT(11) NOT NULL, - `paid_price` VARCHAR(50), - `total_refunded` VARCHAR(50), - PRIMARY KEY (`iyzico_order_refunds_id`) - ) ENGINE=MyISAM DEFAULT COLLATE=utf8_general_ci;"); - } - - /** - * Drop tables - */ - public function uninstall() - { - $this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "iyzico_order`;"); - $this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "iyzico_order_refunds`;"); - } - - /** - * Log - * - */ - public function logger($message) - { - $log = new Log('iyzico_checkout_installment.log'); - - $log->write($message); - } - - /** - * Create order entry for iyzico transactions - * - */ - public function createOrderEntry($data) - { - $query_string = "INSERT INTO " . DB_PREFIX . "iyzico_order SET"; - - $data_array = array(); - - foreach ($data as $key => $value) { - $data_array[] = "`$key` = '" . $this->db->escape($value) . "'"; - } - - $data_string = implode(", ", $data_array); - - $query_string .= $data_string; - $query_string .= ";"; - - $this->db->query($query_string); - - return $this->db->getLastId(); - } - - /** - * Update order details for iyzico transactions - * - */ - public function updateOrderEntry($data, $id) - { - $query_string = "UPDATE " . DB_PREFIX . "iyzico_order SET"; - - $data_array = array(); - - foreach ($data as $key => $value) { - $data_array[] = "`$key` = '" . $this->db->escape($value) . "'"; - } - - $data_string = implode(", ", $data_array); - - $query_string .= $data_string; - $query_string .= " WHERE `iyzico_order_id` = {$id};"; - - return $this->db->query($query_string); - } -} diff --git a/Payments/iyzico/upload/admin/view/template/payment/iyzico_checkout_installment.tpl b/Payments/iyzico/upload/admin/view/template/payment/iyzico_checkout_form.tpl similarity index 54% rename from Payments/iyzico/upload/admin/view/template/payment/iyzico_checkout_installment.tpl rename to Payments/iyzico/upload/admin/view/template/payment/iyzico_checkout_form.tpl index edfbcc6..41938c7 100644 --- a/Payments/iyzico/upload/admin/view/template/payment/iyzico_checkout_installment.tpl +++ b/Payments/iyzico/upload/admin/view/template/payment/iyzico_checkout_form.tpl @@ -3,73 +3,68 @@
-
+
+ + +
+ + +
- +

-
-
- + +
+
- +
-
- +
+
- +
- +
- +
- +
- + + + + +
@@ -81,9 +76,9 @@
- - + @@ -95,13 +90,41 @@
- - - + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+
@@ -109,23 +132,23 @@
- +
-
+
+
+
diff --git a/Payments/iyzico/upload/admin/view/template/payment/iyzico_checkout_installment_order.tpl b/Payments/iyzico/upload/admin/view/template/payment/iyzico_checkout_form_order.tpl similarity index 63% rename from Payments/iyzico/upload/admin/view/template/payment/iyzico_checkout_installment_order.tpl rename to Payments/iyzico/upload/admin/view/template/payment/iyzico_checkout_form_order.tpl index 703e374..5a67a23 100644 --- a/Payments/iyzico/upload/admin/view/template/payment/iyzico_checkout_installment_order.tpl +++ b/Payments/iyzico/upload/admin/view/template/payment/iyzico_checkout_form_order.tpl @@ -1,15 +1,20 @@ - - + - - 0) { ?> + 0){ ?> - $refund_data) { ?> + $refund_data){ + ?> @@ -45,9 +52,11 @@
+
@@ -23,7 +28,9 @@
- - - 0) ||(is_string($iyzico_transactions) && $iyzico_transactions != 'false')) { ?> + 0) ||(is_string($iyzico_transactions) && $iyzico_transactions != 'false')) { + ?> @@ -61,7 +70,9 @@ - + @@ -75,16 +86,18 @@ - \ No newline at end of file + } + ?> + \ No newline at end of file diff --git a/Payments/iyzico/upload/catalog/controller/payment/iyzico_checkout_installment.php b/Payments/iyzico/upload/catalog/controller/payment/iyzico_checkout_form.php similarity index 55% rename from Payments/iyzico/upload/catalog/controller/payment/iyzico_checkout_installment.php rename to Payments/iyzico/upload/catalog/controller/payment/iyzico_checkout_form.php index 9049f41..ce95a2a 100644 --- a/Payments/iyzico/upload/catalog/controller/payment/iyzico_checkout_installment.php +++ b/Payments/iyzico/upload/catalog/controller/payment/iyzico_checkout_form.php @@ -1,16 +1,11 @@ load->language('payment/iyzico_checkout_installment'); - - $data = $this->language->all(); - - $data['form_class'] = $this->config->get('iyzico_checkout_installment_form_class'); - - $data['continue'] = $this->url->link('checkout/success', '', 'SSL'); - - if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/iyzico_checkout_installment.tpl')) { - return $this->load->view($this->config->get('config_template') . '/template/payment/iyzico_checkout_installment.tpl', $data); + $this->load->language('payment/iyzico_checkout_form'); + $data['code'] = $this->language->get('code'); + $data['form_class'] = $this->config->get('iyzico_checkout_form_form_class'); + $data['text_credit_card'] = $this->language->get('text_credit_card'); + $data['text_wait'] = $this->language->get('text_wait'); + $data['button_confirm'] = $this->language->get('button_confirm'); + $data['continue'] = $this->url->link('checkout/success'); + + if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/iyzico_checkout_form.tpl')) { + return $this->load->view($this->config->get('config_template') . '/template/payment/iyzico_checkout_form.tpl', $data); } else { - return $this->load->view('default/template/payment/iyzico_checkout_installment.tpl', $data); + return $this->load->view('default/template/payment/iyzico_checkout_form.tpl', $data); } } @@ -44,34 +39,32 @@ public function gettoken() try { IyzipayBootstrap::init(); - $data['checkout_form_content'] = ''; - $data['error'] = ''; - $data['form_class'] = $this->config->get('iyzico_checkout_installment_form_class'); - $data['continue'] = $this->url->link('checkout/success', '', 'SSL'); + $data['checkout_form_content'] = ''; + $data['error'] = ''; + $data['form_class'] = $this->config->get('iyzico_checkout_form_form_class'); + $data['continue'] = $this->url->link('checkout/success'); $data['display_direct_confirm'] = 'no'; - $callback_url = $this->getSiteUrl() . 'index.php?route=payment/iyzico_checkout_installment/callback'; + $route_url = 'payment/iyzico_checkout_form/callback'; + $callback_url = $this->getSiteUrl() . 'index.php?route=' . $route_url; - $order_id = $this->session->data['order_id']; + $order_id = $this->session->data['order_id']; $unique_conversation_id = uniqid($this->order_prefix) . "_" . $order_id; - $merchant_api_id = $this->config->get('iyzico_checkout_installment_api_id_live'); - $merchant_secret_key = $this->config->get('iyzico_checkout_installment_secret_key_live'); - - $configuration = new \Iyzipay\Client\Configuration\ClientConfiguration(); + $merchant_api_id = $this->config->get('iyzico_checkout_form_api_id_live'); + $merchant_secret_key = $this->config->get('iyzico_checkout_form_secret_key_live'); - $configuration->setApiKey($merchant_api_id); - $configuration->setSecretKey($merchant_secret_key); - $configuration->setBaseUrl($this->base_url); + $options = new \Iyzipay\Options(); + $options->setApiKey($merchant_api_id); + $options->setSecretKey($merchant_secret_key); + $options->setBaseUrl($this->getBaseUrl()); - $client = \Iyzipay\Client\Service\EcomCheckoutFormServiceClient::fromConfiguration($configuration); + $this->load->language('payment/iyzico_checkout_form'); - $this->load->language('payment/iyzico_checkout_installment'); - - if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/iyzico_checkout_installment.tpl')) { - $this->template = $this->config->get('config_template') . '/template/payment/iyzico_checkout_installment.tpl'; + if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/iyzico_checkout_form.tpl')) { + $this->template = $this->config->get('config_template') . '/template/payment/iyzico_checkout_form.tpl'; } else { - $this->template = 'default/template/payment/iyzico_checkout_installment.tpl'; + $this->template = 'default/template/payment/iyzico_checkout_form.tpl'; } $this->load->model('checkout/order'); @@ -81,99 +74,85 @@ public function gettoken() $order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']); - if ($order_info['currency_code'] != 'TRY') { - throw new \Exception($this->language->get('error_invalid_currency')); - } - $cart_total_amount = round($order_info['total'] * $order_info['currency_value'], 2); if ($cart_total_amount == 0) { $data['display_direct_confirm'] = 'yes'; - $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($data)); - return true; } - $request = new \Iyzipay\Client\Ecom\Payment\Request\EcomPaymentCheckoutFormInitializeRequest(); - - $request->setLocale(\Iyzipay\Client\RequestLocaleType::TR); + $request = new \Iyzipay\Request\CreateCheckoutFormInitializeRequest(); + $request->setLocale($this->config->get('config_language')); $request->setConversationId($unique_conversation_id); $request->setPaidPrice($cart_total_amount); $request->setBasketId($unique_conversation_id); - $request->setPaymentGroup(\Iyzipay\Client\Ecom\Payment\Enumtype\PaymentGroupRequestType::PRODUCT); - $request->setPaymentSource(\Iyzipay\Client\Ecom\Payment\Enumtype\PaymentSourceRequestType::ARASTTA); + $request->setPaymentGroup(\Iyzipay\Model\PaymentGroup::PRODUCT); + $request->setPaymentSource('ARASTTA'); $request->setCallbackUrl($callback_url); + $request->setCurrency($this->getCurrencyConstant($order_info['currency_code'])); $customer_address = trim($order_info['payment_address_1'] . " " . $order_info['payment_address_2']); $customer_address = !empty($customer_address) ? $customer_address : "NOT PROVIDED"; - $buyer = new \Iyzipay\Client\Ecom\Payment\Dto\EcomPaymentBuyerDto(); + $buyer = new \Iyzipay\Model\Buyer(); $buyer->setId($order_info['customer_id']); $order_info_firstname = !empty($order_info['firstname']) ? $order_info['firstname'] : "NOT PROVIDED"; - $order_info_lastname = !empty($order_info['lastname']) ? $order_info['lastname'] : "NOT PROVIDED"; + $order_info_lastname = !empty($order_info['lastname']) ? $order_info['lastname'] : "NOT PROVIDED"; $order_info_telephone = !empty($order_info['telephone']) ? $order_info['telephone'] : "NOT PROVIDED"; - $order_info_email = !empty($order_info['email']) ? $order_info['email'] : "NOT PROVIDED"; - + $order_info_email = !empty($order_info['email']) ? $order_info['email'] : "NOT PROVIDED"; $buyer->setName($order_info_firstname); $buyer->setSurname($order_info_lastname); $buyer->setGsmNumber($order_info_telephone); $buyer->setEmail($order_info_email); $buyer->setRegistrationAddress($customer_address); - $order_info_payment_zone = !empty($order_info['payment_zone']) ? $order_info['payment_zone'] : "NOT PROVIDED"; - $order_info_payment_city = !empty($order_info['payment_city']) ? $order_info['payment_city'] : $order_info_payment_zone; - $order_info_payment_country = !empty($order_info['payment_country']) ? $order_info['payment_country'] : "NOT PROVIDED"; + $order_info_payment_zone = !empty($order_info['payment_zone']) ? $order_info['payment_zone'] : "NOT PROVIDED"; + $order_info_payment_city = !empty($order_info['payment_city']) ? $order_info['payment_city'] : $order_info_payment_zone; + $order_info_payment_country = !empty($order_info['payment_country']) ? $order_info['payment_country'] : "NOT PROVIDED"; $order_info_payment_postcode = !empty($order_info['payment_postcode']) ? $order_info['payment_postcode'] : "NOT PROVIDED"; - $order_info_ip = !empty($order_info['ip']) ? $order_info['ip'] : "NOT PROVIDED"; - + $order_info_ip = !empty($order_info['ip']) ? $order_info['ip'] : "NOT PROVIDED"; $buyer->setCity($order_info_payment_city); $buyer->setCountry($order_info_payment_country); $buyer->setZipCode($order_info_payment_postcode); $buyer->setIp($order_info_ip); $customer_identity_number = str_pad($order_info['customer_id'], 11, '0', STR_PAD_LEFT); - $buyer->setIdentityNumber($customer_identity_number); if ($order_info['customer_id'] > 0) { $customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE customer_id = '" . (int) $this->session->data['customer_id'] . "' AND status = '1'"); - $added_date = !empty($customer_query->row['date_added']) ? $customer_query->row['date_added'] : "NOT PROVIDED"; - + $added_date = !empty($customer_query->row['date_added']) ? $customer_query->row['date_added'] : "NOT PROVIDED"; $buyer->setRegistrationDate($added_date); } - $request->setBuyer($buyer); - $billing_address = new \Iyzipay\Client\Ecom\Payment\Dto\EcomPaymentBillingAddressDto(); + $billing_address = new \Iyzipay\Model\Address(); $billing_address->setContactName($order_info_firstname); $billing_address->setCity($order_info_payment_city); $billing_address->setCountry($order_info_payment_country); $billing_address->setAddress($customer_address); $billing_address->setZipCode($order_info_payment_postcode); - $request->setBillingAddress($billing_address); $customer_shipping_address1 = !empty($order_info['shipping_address_1']) ? $order_info['shipping_address_1'] : $order_info['payment_address_1']; $customer_shipping_address2 = !empty($order_info['shipping_address_2']) ? $order_info['shipping_address_2'] : $order_info['payment_address_2']; - $customer_shipping_address = trim($customer_shipping_address1 . " " . $customer_shipping_address2); - $customer_shipping_address = !empty($customer_shipping_address) ? $customer_shipping_address : "NOT PROVIDED"; - - $shipping_name = !empty($order_info['shipping_firstname']) ? $order_info['shipping_firstname'] : $order_info_firstname; - $shipping_zone = !empty($order_info['shipping_zone']) ? $order_info['shipping_zone'] : $order_info_payment_zone; - $shipping_city = !empty($order_info['shipping_city']) ? $order_info['shipping_city'] : $shipping_zone; - $shipping_country = !empty($order_info['shipping_country']) ? $order_info['shipping_country'] : $order_info_payment_country; + $customer_shipping_address = trim($customer_shipping_address1 . " " . $customer_shipping_address2); + $customer_shipping_address = !empty($customer_shipping_address) ? $customer_shipping_address : "NOT PROVIDED"; + $shipping_name = !empty($order_info['shipping_firstname']) ? $order_info['shipping_firstname'] : $order_info_firstname; + $shipping_zone = !empty($order_info['shipping_zone']) ? $order_info['shipping_zone'] : $order_info_payment_zone; + $shipping_city = !empty($order_info['shipping_city']) ? $order_info['shipping_city'] : $shipping_zone; + $shipping_country = !empty($order_info['shipping_country']) ? $order_info['shipping_country'] : $order_info_payment_country; $shipping_zip_code = !empty($order_info['shipping_postcode']) ? $order_info['shipping_postcode'] : $order_info_payment_postcode; - $shipping_address = new \Iyzipay\Client\Ecom\Payment\Dto\EcomPaymentShippingAddressDto(); + $shipping_address = new \Iyzipay\Model\Address(); $shipping_address->setContactName($shipping_name); $shipping_address->setCity($shipping_city); $shipping_address->setCountry($shipping_country); $shipping_address->setAddress($customer_shipping_address); $shipping_address->setZipCode($shipping_zip_code); - $request->setShippingAddress($shipping_address); $results = $this->model_extension_extension->getExtensions('total'); @@ -183,14 +162,12 @@ public function gettoken() } array_multisort($sort_order, SORT_ASC, $results); - $allowed_order_total_extensions = array( 'reward', 'shipping', 'coupon', 'voucher' ); - $allowed_order_total_extensions_sort = array(); foreach ($results as $result) { @@ -199,14 +176,12 @@ public function gettoken() } } - $items = array(); + $items = array(); $products = $this->cart->getProducts(); - - $product_prices = $total_discounts = $voucher_amount = $voucher_per_item = $applied_voucher_amount = 0; + $product_prices = $total_discounts = $voucher_amount = $voucher_per_item = $applied_voucher_amount = 0; $shipping_amount = $total_shipping_charge = $points_total = 0; - $has_coupon = $has_voucher = $has_rewards = $has_shipping = false; - $coupon_info = $voucher_info = $shipping_info = array(); - + $has_coupon = $has_voucher = $has_rewards = $has_shipping = false; + $coupon_info = $voucher_info = $shipping_info = array(); $purchase_voucher_amount = 0; $sub_total = $this->cart->getSubTotal(); @@ -214,11 +189,9 @@ public function gettoken() //get coupon detail if (isset($this->session->data['coupon'])) { $has_coupon = true; - $coupon = $this->session->data['coupon']; $this->load->model('checkout/coupon'); - $coupon_info = $this->model_checkout_coupon->getCoupon($coupon); if ($coupon_info['type'] == 'F') { @@ -231,9 +204,7 @@ public function gettoken() $has_voucher = true; $voucher = $this->session->data['voucher']; - $this->load->model('checkout/voucher'); - $voucher_info = $this->model_checkout_voucher->getVoucher($voucher); $voucher_info['amount'] = min($voucher_info['amount'], $sub_total); @@ -244,7 +215,6 @@ public function gettoken() if (isset($this->session->data['reward']) && $this->session->data['reward'] <= $points) { $has_rewards = true; - foreach ($this->cart->getProducts() as $product) { if ($product['points']) { $points_total += $product['points']; @@ -254,29 +224,25 @@ public function gettoken() //get shipping detail if ($this->cart->hasShipping() && isset($this->session->data['shipping_method'])) { - $has_shipping = true; - $shipping_info = $this->session->data['shipping_method']; + $has_shipping = true; + $shipping_info = $this->session->data['shipping_method']; $shipping_amount = $shipping_info['cost']; - if ($shipping_info['tax_class_id']) { $shipping_info['tax'] = $this->tax->getRates($shipping_info['cost'], $shipping_info['tax_class_id']); } + } foreach ($products as $product) { $discount = 0; - - $item = new \Iyzipay\Client\Ecom\Payment\Dto\EcomPaymentBasketItemDto(); - - $product_id = !empty($product['product_id']) ? $product['product_id'] : 0; + $item = new \Iyzipay\Model\BasketItem(); + $product_id = !empty($product['product_id']) ? $product['product_id'] : 0; $product_name = !empty($product['name']) ? $product['name'] : "NOT PROVIDED"; - $item->setId($product_id); $item->setName($product_name); - $item->setItemType(\Iyzipay\Client\Ecom\Payment\Enumtype\BasketItemRequestType::PHYSICAL); + $item->setItemType(\Iyzipay\Model\BasketItemType::PHYSICAL); $product_tax = $this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')); - $total_product_price = $product_tax * $product['quantity']; foreach ($allowed_order_total_extensions_sort as $key => $code) { @@ -310,84 +276,59 @@ public function gettoken() } $total_product_price -= $discount; - $total_discounts += $discount; - } else { - if ($code == "voucher" && $has_voucher) { //process voucher - $discount = $voucher_info['amount'] * ($product['total'] / $sub_total); - - $total_product_price -= $discount; - - $total_discounts += $discount; - } else { - if ($code == "reward" && $has_rewards && !empty($product['points'])) { //process reward points - $discount = $product['total'] * ($this->session->data['reward'] / $points_total); + } else if ($code == "voucher" && $has_voucher) { //process voucher + $discount = $voucher_info['amount'] * ( $product['total'] / $sub_total); + $total_product_price -= $discount; + $total_discounts += $discount; + } else if ($code == "reward" && $has_rewards && !empty($product['points'])) { //process reward points + $discount = $product['total'] * ($this->session->data['reward'] / $points_total); - if ($product['tax_class_id']) { - $tax_rates = $this->tax->getRates($product['total'] - ($product['total'] - $discount), $product['tax_class_id']); + if ($product['tax_class_id']) { + $tax_rates = $this->tax->getRates($product['total'] - ($product['total'] - $discount), $product['tax_class_id']); - foreach ($tax_rates as $tax_rate) { - if ($tax_rate['type'] == 'P') { - $discount += $tax_rate['amount']; - } - } + foreach ($tax_rates as $tax_rate) { + if ($tax_rate['type'] == 'P') { + $discount += $tax_rate['amount']; } + } + } - $total_product_price -= $discount; - - $total_discounts += $discount; - } else { - if ($code == "shipping" && $has_shipping) { //process shipping charges - $per_item_shipping = $shipping_amount * ($product['total'] / $sub_total); - - $total_product_price += $per_item_shipping; - - $total_shipping_charge += $per_item_shipping; - - if ($shipping_info['tax_class_id']) { - $tax_rates = $shipping_info['tax']; - - foreach ($tax_rates as $tax_rate) { - $shipping_tax_amount = 0; - - if ($tax_rate['type'] == 'F') { - $shipping_tax_amount = $tax_rate['rate'] * ($product['total'] / $sub_total); - } elseif ($tax_rate['type'] == 'P') { - $shipping_tax_amount = $per_item_shipping / 100 * $tax_rate['rate']; - } - - $total_product_price += $shipping_tax_amount; - $total_shipping_charge += $shipping_tax_amount; - } - } + $total_product_price -= $discount; + $total_discounts += $discount; + } else if ($code == "shipping" && $has_shipping) { //process shipping charges + $per_item_shipping = $shipping_amount * ($product['total'] / $sub_total); + $total_product_price += $per_item_shipping; + $total_shipping_charge += $per_item_shipping; + if ($shipping_info['tax_class_id']) { + $tax_rates = $shipping_info['tax']; + foreach ($tax_rates as $tax_rate) { + $shipping_tax_amount = 0; + if ($tax_rate['type'] == 'F') { + $shipping_tax_amount = $tax_rate['rate'] * ($product['total'] / $sub_total); + } elseif ($tax_rate['type'] == 'P') { + $shipping_tax_amount = $per_item_shipping / 100 * $tax_rate['rate']; } + $total_product_price += $shipping_tax_amount; + $total_shipping_charge += $shipping_tax_amount; } } } } $total_product_price *= $order_info['currency_value']; - $total_product_price = round($total_product_price, 2); - $product_prices += $total_product_price; - $item->setPrice($total_product_price); - $product_categories = $this->model_catalog_product->getCategories($product['product_id']); - if ($product_categories) { foreach ($product_categories as $key => $product_category_data) { if ($key > 1) { break; } - $category_info = $this->model_catalog_category->getCategory($product_category_data['category_id']); - $set_category = 'setCategory' . ($key + 1); - $category_name = !empty($category_info['name']) ? $category_info['name'] : "NOT PROVIDED"; - $item->$set_category($category_name); } } else { @@ -399,11 +340,10 @@ public function gettoken() } } - $exchange_rate = $this->currency->getValue('TRY'); + $exchange_rate = $this->currency->getValue($order_info['currency_code']); $tax_total = $this->cart->getTaxes(); - - foreach ($tax_total as $value) { + foreach($tax_total as $value){ $sub_total += $value; } @@ -414,18 +354,14 @@ public function gettoken() //adjust sub total and product prices if ($sub_total != $product_prices) { - $last_item_index = end(array_keys($items)); + $last_item_index = end(array_keys($items)); $last_item_object = $items[$last_item_index]; - $item_price = $last_item_object->getPrice(); + $item_price = $last_item_object->getPrice(); $amount_difference = $sub_total - $product_prices; - $new_price = $item_price + $amount_difference; - $last_item_object->setPrice($new_price); - $items[$last_item_index] = $last_item_object; - if ($new_price <= 0) { unset($items[$last_item_index]); } @@ -433,19 +369,15 @@ public function gettoken() //adjust final payable amount and product prices if ($cart_total_amount != $sub_total) { - $last_item_index = end(array_keys($items)); + $last_item_index = end(array_keys($items)); $last_item_object = $items[$last_item_index]; - $item_price = $last_item_object->getPrice(); + $item_price = $last_item_object->getPrice(); $amount_difference = $cart_total_amount - $sub_total; - $new_price = $item_price + $amount_difference; - + $new_price = $item_price + $amount_difference; $sub_total += $amount_difference; - $last_item_object->setPrice($new_price); - $items[$last_item_index] = $last_item_object; - if ($new_price <= 0) { unset($items[$last_item_index]); } @@ -458,33 +390,29 @@ public function gettoken() $request->setBasketItems($items); if (function_exists('curl_version')) { - - $this->load->model('payment/iyzico_checkout_installment'); - + $this->load->model('payment/iyzico_checkout_form'); $save_data_array = array( - 'order_id' => $order_id, - 'item_id' => 0, + 'order_id' => $order_id, + 'item_id' => 0, 'transaction_status' => 'in process', - 'date_created' => date('Y-m-d H:i:s'), - 'date_modified' => date('Y-m-d H:i:s'), - 'api_request' => $request->toJsonString(), - 'api_response' => '', - 'request_type' => 'payment_form_initialization', - 'note' => '' + 'date_created' => date('Y-m-d H:i:s'), + 'date_modified' => date('Y-m-d H:i:s'), + 'api_request' => $request->toJsonString(), + 'api_response' => '', + 'request_type' => 'payment_form_initialization', + 'note' => '' ); + $create_order_entry_id = $this->model_payment_iyzico_checkout_form->createOrderEntry($save_data_array); - $create_order_entry_id = $this->model_payment_iyzico_checkout_installment->createOrderEntry($save_data_array); - - $response = $client->initializeCheckoutForm($request); + $response = \Iyzipay\Model\CheckoutFormInitialize::create($request, $options); $update_data_array = array( - 'date_modified' => date('Y-m-d H:i:s'), - 'api_response' => $response->getRawResult(), - 'transaction_status' => $response->getStatus(), + 'date_modified' => date('Y-m-d H:i:s'), + 'api_response' => $response->getRawResult(), + 'transaction_status' => $response->getStatus(), 'processing_timestamp' => date('Y-m-d H:i:s', $response->getSystemTime() / 1000) ); - - $this->model_payment_iyzico_checkout_installment->updateOrderEntry($update_data_array, $create_order_entry_id); + $this->model_payment_iyzico_checkout_form->updateOrderEntry($update_data_array, $create_order_entry_id); $data['siteUrl'] = $this->getSiteUrl(); @@ -508,14 +436,12 @@ public function gettoken() * Get site url * */ - public function getSiteUrl() - { + public function getSiteUrl() { if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { $site_url = HTTPS_SERVER; } else { $site_url = HTTP_SERVER; } - return $site_url; } @@ -523,8 +449,7 @@ public function getSiteUrl() * Get valid slug * */ - public function getServerConnectionSlug() - { + public function getServerConnectionSlug() { if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) { $connection = 'SSL'; } else { @@ -538,84 +463,75 @@ public function getServerConnectionSlug() * Callback url for iyzico transaction response * */ - public function callback() - { + public function callback() { error_reporting(0); - $server_conn_slug = $this->getServerConnectionSlug(); - - $this->load->language('payment/iyzico_checkout_installment'); - $this->load->model('payment/iyzico_checkout_installment'); + $this->load->language('payment/iyzico_checkout_form'); + $this->load->model('payment/iyzico_checkout_form'); $this->load->model('checkout/order'); - - $postData = $this->request->post; - $message = ''; + $postData = $this->request->post; + $message = ''; $get_auth_table_id = 0; - try { + $save_data_array = array( - 'order_id' => 0, - 'transaction_status' => '', - 'date_created' => date('Y-m-d H:i:s'), - 'date_modified' => date('Y-m-d H:i:s'), - 'api_request' => '', - 'api_response' => json_encode($postData), - 'request_type' => 'post_callback', + 'order_id' => 0, + 'transaction_status' => '', + 'date_created' => date('Y-m-d H:i:s'), + 'date_modified' => date('Y-m-d H:i:s'), + 'api_request' => '', + 'api_response' => json_encode($postData), + 'request_type' => 'post_callback', 'processing_timestamp' => date('Y-m-d H:i:s'), - 'note' => '' + 'note' => '' ); - - $post_callback_id = $this->model_payment_iyzico_checkout_installment->createOrderEntry($save_data_array); + $post_callback_id = $this->model_payment_iyzico_checkout_form->createOrderEntry($save_data_array); if (empty($postData['token'])) { throw new \Exception($this->language->get('invalid_request')); } - $this->load->model('payment/iyzico_checkout_installment'); + $this->load->model('payment/iyzico_checkout_form'); $order_id = $this->session->data['order_id']; IyzipayBootstrap::init(); - $merchant_api_id = $this->config->get('iyzico_checkout_installment_api_id_live'); - $merchant_secret_key = $this->config->get('iyzico_checkout_installment_secret_key_live'); - - $configuration = new \Iyzipay\Client\Configuration\ClientConfiguration(); + $merchant_api_id = $this->config->get('iyzico_checkout_form_api_id_live'); + $merchant_secret_key = $this->config->get('iyzico_checkout_form_secret_key_live'); - $configuration->setApiKey($merchant_api_id); - $configuration->setSecretKey($merchant_secret_key); - $configuration->setBaseUrl($this->base_url); + $options = new \Iyzipay\Options(); + $options->setApiKey($merchant_api_id); + $options->setSecretKey($merchant_secret_key); + $options->setBaseUrl($this->getBaseUrl()); - $client = \Iyzipay\Client\Service\EcomCheckoutFormServiceClient::fromConfiguration($configuration); - - $request = new \Iyzipay\Client\Ecom\Payment\Request\EcomRetrievePaymentCheckoutFormAuthRequest(); - $request->setLocale(\Iyzipay\Client\RequestLocaleType::TR); + $request = new \Iyzipay\Request\RetrieveCheckoutFormRequest(); + $request->setLocale($this->config->get('config_language')); $request->setToken($postData['token']); $save_data_array = array( - 'order_id' => 0, - 'item_id' => 0, + 'order_id' => 0, + 'item_id' => 0, 'transaction_status' => 'in process', - 'date_created' => date('Y-m-d H:i:s'), - 'date_modified' => date('Y-m-d H:i:s'), - 'api_request' => $request->toJsonString(), - 'api_response' => '', - 'request_type' => 'get_auth', - 'note' => '' + 'date_created' => date('Y-m-d H:i:s'), + 'date_modified' => date('Y-m-d H:i:s'), + 'api_request' => $request->toJsonString(), + 'api_response' => '', + 'request_type' => 'get_auth', + 'note' => '' ); + $get_auth_table_id = $this->model_payment_iyzico_checkout_form->createOrderEntry($save_data_array); - $get_auth_table_id = $this->model_payment_iyzico_checkout_installment->createOrderEntry($save_data_array); - - $response = $client->getAuthResponse($request); + $response = \Iyzipay\Model\CheckoutForm::retrieve($request, $options); $update_data_array = array( - 'date_modified' => date('Y-m-d H:i:s'), - 'api_response' => $response->getRawResult(), - 'transaction_status' => $response->getStatus(), + 'date_modified' => date('Y-m-d H:i:s'), + 'api_response' => $response->getRawResult(), + 'transaction_status' => $response->getStatus(), 'processing_timestamp' => date('Y-m-d H:i:s', $response->getSystemTime() / 1000) ); + $this->model_payment_iyzico_checkout_form->updateOrderEntry($update_data_array, $get_auth_table_id); - $this->model_payment_iyzico_checkout_installment->updateOrderEntry($update_data_array, $get_auth_table_id); if ($response->getStatus() == "failure") { throw new \Exception($response->getErrorMessage()); @@ -625,7 +541,8 @@ public function callback() throw new \Exception($response->getErrorMessage()); } - $basketId = $response->getBasketId(); + + $basketId = $response->getBasketId(); $paymentId = $response->getPaymentId(); if (!empty($paymentId)) { @@ -636,13 +553,12 @@ public function callback() $response_order_id = end($explode_basket_id); $update_data_array = array( - 'order_id' => $response_order_id, - 'date_modified' => date('Y-m-d H:i:s'), + 'order_id' => $response_order_id, + 'date_modified' => date('Y-m-d H:i:s'), 'processing_timestamp' => date('Y-m-d H:i:s', $response->getSystemTime() / 1000) ); - - $this->model_payment_iyzico_checkout_installment->updateOrderEntry($update_data_array, $get_auth_table_id); - $this->model_payment_iyzico_checkout_installment->updateOrderEntry($update_data_array, $post_callback_id); + $this->model_payment_iyzico_checkout_form->updateOrderEntry($update_data_array, $get_auth_table_id); + $this->model_payment_iyzico_checkout_form->updateOrderEntry($update_data_array, $post_callback_id); if (empty($response_order_id) || $response_order_id != $order_id) { throw new \Exception($this->language->get('invalid_order')); @@ -655,22 +571,21 @@ public function callback() } $installment = $response->getInstallment(); - if ($installment > 1) { $this->load->model('checkout/order'); - $order_total = (array) $this->db->query("SELECT * FROM " . DB_PREFIX . "order_total WHERE order_id = '" . (int) $order_id . "' AND code = 'total' "); - $last_sort_value = $order_total['row']['sort_order'] - 1; - $exchange_rate = $this->currency->getValue('TRY'); - $new_amount = str_replace(',', '', $response->getPaidPrice()); - $old_amount = str_replace(',', '', $order_info['total'] * $order_info['currency_value']); + $order_total = (array) $this->db->query("SELECT * FROM " . DB_PREFIX . "order_total WHERE order_id = '" . (int) $order_id . "' AND code = 'total' "); + $last_sort_value = $order_total['row']['sort_order'] - 1; + $exchange_rate = $this->currency->getValue($order_info['currency_code']); + $new_amount = str_replace(',', '', $response->getPaidPrice()); + $old_amount = str_replace(',', '', $order_info['total'] * $order_info['currency_value']); $installment_fee_variation = ($new_amount - $old_amount) / $exchange_rate; - - $this->db->query("INSERT INTO " . DB_PREFIX . "order_total SET order_id = '" . (int)$order_id . "',code = '" . $this->db->escape('iyzico_checkout_installment_fee') . "', title = '" . $this->db->escape('Installment Charge') . "' , `value` = '" . + $this->db->query("INSERT INTO " . DB_PREFIX . "order_total SET order_id = '" . + (int) $order_id . "',code = '" . $this->db->escape('iyzico_checkout_form_fee') . + "', title = '" . $this->db->escape('Installment Charge') . "' , `value` = '" . (float) $installment_fee_variation . "', sort_order = '" . (int) $last_sort_value . "'"); $order_total_data = (array) $this->db->query("SELECT * FROM " . DB_PREFIX . "order_total WHERE order_id = '" . (int) $order_id . "' AND code != 'total' "); - $calculate_total = 0; - + $calculate_total = 0; foreach ($order_total_data['rows'] as $row) { $calculate_total += $row['value']; } @@ -679,47 +594,40 @@ public function callback() $this->db->query("UPDATE `" . DB_PREFIX . "order` SET total = '" . $calculate_total . "' WHERE order_id = '" . (int) $order_id . "'"); - $this->model_checkout_order->addOrderHistory($this->session->data['order_id'], $this->config->get('iyzico_checkout_installment_order_status_id'), $message, false); - + $this->model_checkout_order->addOrderHistory($this->session->data['order_id'], $this->config->get('iyzico_checkout_form_order_status_id'), $message, false); $comment = $response->getCardFamily() . ' - ' . $response->getInstallment() . ' Taksit'; - $this->db->query("INSERT INTO " . DB_PREFIX . "order_history SET order_id = '" . (int) $order_id . "', order_status_id = '" . - $this->config->get('iyzico_checkout_installment_order_status_id') . "', notify = '0', comment = '" . + $this->config->get('iyzico_checkout_form_order_status_id') . "', notify = '0', comment = '" . $this->db->escape($comment) . "', date_added = NOW()"); } else { - $this->model_checkout_order->addOrderHistory($response_order_id, $this->config->get('iyzico_checkout_installment_order_status_id'), $message, false); + $this->model_checkout_order->addOrderHistory($response_order_id, $this->config->get('iyzico_checkout_form_order_status_id'), $message, false); } - $item_transactions = $response->getItemTransactions(); - + $item_transactions = $response->getPaymentItems(); foreach ($item_transactions as $item_transaction) { $item_data_array = array( - 'order_id' => $order_id, - 'paid_price' => $item_transaction->getPaidPrice(), - 'item_id' => $item_transaction->getItemId(), + 'order_id' => $order_id, + 'paid_price' => $item_transaction->getPaidPrice(), + 'item_id' => $item_transaction->getItemId(), 'payment_transaction_id' => $item_transaction->getPaymentTransactionId(), - 'total_refunded' => 0 + 'total_refunded' => 0 ); - - $this->model_payment_iyzico_checkout_installment->createRefundItemEntry($item_data_array); + $this->model_payment_iyzico_checkout_form->createRefundItemEntry($item_data_array); } - $this->response->redirect($this->url->link('checkout/success', '', 'SSL')); + $this->response->redirect($this->url->link('checkout/success')); } catch (\Exception $ex) { $resp_msg = $ex->getMessage(); $resp_msg = !empty($resp_msg) ? $resp_msg : $this->language->get('invalid_request'); - if (!empty($get_auth_table_id)) { $update_data_array = array( - 'note' => $resp_msg, + 'note' => $resp_msg, 'date_modified' => date('Y-m-d H:i:s'), ); - - $this->model_payment_iyzico_checkout_installment->updateOrderEntry($update_data_array, $get_auth_table_id); + $this->model_payment_iyzico_checkout_form->updateOrderEntry($update_data_array, $get_auth_table_id); } $this->session->data['error'] = $resp_msg; - $this->response->redirect($this->url->link('checkout/checkout', '', $server_conn_slug)); } @@ -730,102 +638,103 @@ public function callback() * Handle error from callback * */ - public function error() - { - $this->language->load('payment/iyzico_checkout_installment'); + public function error() { + + $this->language->load('payment/iyzico_checkout_form'); $this->document->setTitle($this->language->get('heading_title')); $data['breadcrumbs'] = array(); $data['breadcrumbs'][] = array( - 'text' => $this->language->get('text_home'), - 'href' => $this->url->link('common/home', '', 'SSL'), + 'text' => $this->language->get('text_home'), + 'href' => $this->url->link('common/home'), 'separator' => false ); if (isset($this->request->get['route'])) { $data = $this->request->get; - unset($data['_route_']); - $route = $data['route']; - unset($data['route']); - $url = ''; - if ($data) { $url = '&' . urldecode(http_build_query($data, '', '&')); } $connection = $this->getServerConnectionSlug(); - $data['breadcrumbs'][] = array( - 'text' => $this->language->get('heading_title'), - 'href' => $this->url->link($route, $url, $connection), + 'text' => $this->language->get('heading_title'), + 'href' => $this->url->link($route, $url, $connection), 'separator' => $this->language->get('text_separator') ); } if (!empty($error['response']['state']) && $error['response']['state'] == 'failed') { $data['heading_title'] = "Payment error..."; - $data['text_error'] = $error['response']['error_message']; + $data['text_error'] = $error['response']['error_message']; } $data['button_continue'] = $this->language->get('button_continue'); - $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found'); - - $data['continue'] = $this->url->link('checkout/checkout', '', 'SSL'); - - $data['column_left'] = $this->load->controller('common/column_left'); - $data['column_right'] = $this->load->controller('common/column_right'); - $data['content_top'] = $this->load->controller('common/content_top'); - $data['content_bottom'] = $this->load->controller('common/content_bottom'); - $data['footer'] = $this->load->controller('common/footer'); - $data['header'] = $this->load->controller('common/header'); + $data['continue'] = $this->url->link('checkout/checkout'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) { - $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/error/not_found.tpl', $data)); + $template_url = $this->config->get('config_template') . '/template/error/not_found.tpl'; } else { - $this->response->setOutput($this->load->view('default/template/error/not_found.tpl', $data)); + $template_url = 'default/template/error/not_found.tpl'; } + + $this->children = array( + 'common/column_left', + 'common/column_right', + 'common/content_top', + 'common/content_bottom', + 'common/footer', + 'common/header' + ); + + $this->response->setOutput($this->load->view($template_url, $data)); } /** - * Confirm order if cart total = 0 - * + * Get currency constant by currency code + * @param $currencyCode + * @return string */ - public function confirm() - { - if ($this->session->data['payment_method']['code'] == 'iyzico_checkout_installment') { - $this->load->model('checkout/order'); - $this->load->model('payment/iyzico_checkout_installment'); - - $order_id = $this->session->data['order_id']; - - $order_info = $this->model_checkout_order->getOrder($order_id); - - if (!empty($order_info['order_status_id']) && $order_info['order_status'] != null) { - throw new \Exception($this->language->get('order_already_exists')); - } + private function getCurrencyConstant($currencyCode){ + $currency = \Iyzipay\Model\Currency::TL; + + switch($currencyCode){ + case "TRY": + $currency = \Iyzipay\Model\Currency::TL; + break; + case "USD": + $currency = \Iyzipay\Model\Currency::USD; + break; + case "GBP": + $currency = \Iyzipay\Model\Currency::GBP; + break; + case "EUR": + $currency = \Iyzipay\Model\Currency::EUR; + break; + case "IRR": + $currency = \Iyzipay\Model\Currency::IRR; + break; + } - $save_data_array = array( - 'order_id' => $order_id, - 'item_id' => 0, - 'transaction_status' => 'success', - 'date_created' => date('Y-m-d H:i:s'), - 'date_modified' => date('Y-m-d H:i:s'), - 'processing_timestamp' => date('Y-m-d H:i:s'), - 'api_request' => '', - 'api_response' => '', - 'request_type' => 'get_auth', - 'note' => '' - ); + return $currency; + } - $this->model_payment_iyzico_checkout_installment->createOrderEntry($save_data_array); + public function getBaseUrl() + { + $mode = $this->config->get('iyzico_checkout_form_test'); - $this->model_checkout_order->addOrderHistory($order_id, $this->config->get('iyzico_checkout_installment_order_status_id')); + if (isset($mode) && $mode == 1) { + $url = "https://sandbox-api.iyzipay.com"; + } else { + $url = "https://api.iyzipay.com"; } + + return $url; } } diff --git a/Payments/iyzico/upload/catalog/language/en-GB/payment/iyzico_checkout_form.php b/Payments/iyzico/upload/catalog/language/en-GB/payment/iyzico_checkout_form.php new file mode 100644 index 0000000..ec423b5 --- /dev/null +++ b/Payments/iyzico/upload/catalog/language/en-GB/payment/iyzico_checkout_form.php @@ -0,0 +1,22 @@ +load->language('payment/iyzico_checkout_form'); + + $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int) $this->config->get('iyzico_checkout_form_geo_zone_id') . "' AND country_id = '" . (int) $address['country_id'] . "' AND (zone_id = '" . (int) $address['zone_id'] . "' OR zone_id = '0')"); + + if ($this->config->get('iyzico_checkout_form_total') > 0 && $this->config->get('iyzico_checkout_form_total') > $total) { + $status = false; + } elseif (!$this->config->get('iyzico_checkout_form_geo_zone_id')) { + $status = true; + } elseif ($query->num_rows) { + $status = true; + } else { + $status = false; + } + + $method_data = array(); + + if ($status) { + $method_data = array( + 'code' => 'iyzico_checkout_form', + 'title' => $this->language->get('text_title'), + 'terms' => '', + 'sort_order' => $this->config->get('iyzico_checkout_form_sort_order') + ); + } + + return $method_data; + } + + /** + * Create refund item for iyzico transaction + * + */ + public function createRefundItemEntry($data) { + + $query_string = "INSERT INTO " . DB_PREFIX . "iyzico_order_refunds SET"; + $data_array = array(); + foreach ($data as $key => $value) { + $data_array[] = "`$key` = '" . $this->db->escape($value) . "'"; + } + $data_string = implode(", ", $data_array); + $query_string .= $data_string; + $query_string .= ";"; + $this->db->query($query_string); + return $this->db->getLastId(); + } + + /** + * Create order entry for iyzico transaction + * + */ + public function createOrderEntry($data) { + + $query_string = "INSERT INTO " . DB_PREFIX . "iyzico_order SET"; + $data_array = array(); + foreach ($data as $key => $value) { + $data_array[] = "`$key` = '" . $this->db->escape($value) . "'"; + } + $data_string = implode(", ", $data_array); + $query_string .= $data_string; + $query_string .= ";"; + $this->db->query($query_string); + return $this->db->getLastId(); + } + + /** + * Update order entry for iyzico transaction + * + */ + public function updateOrderEntry($data, $id) { + + $query_string = "UPDATE " . DB_PREFIX . "iyzico_order SET"; + $data_array = array(); + foreach ($data as $key => $value) { + $data_array[] = "`$key` = '" . $this->db->escape($value) . "'"; + } + $data_string = implode(", ", $data_array); + $query_string .= $data_string; + $query_string .= " WHERE `iyzico_order_id` = {$id};"; + return $this->db->query($query_string); + } + +} diff --git a/Payments/iyzico/upload/catalog/model/payment/iyzico_checkout_installment.php b/Payments/iyzico/upload/catalog/model/payment/iyzico_checkout_installment.php deleted file mode 100644 index e791743..0000000 --- a/Payments/iyzico/upload/catalog/model/payment/iyzico_checkout_installment.php +++ /dev/null @@ -1,116 +0,0 @@ -load->language('payment/iyzico_checkout_installment'); - - $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int) $this->config->get('iyzico_checkout_installment_geo_zone_id') . "' AND country_id = '" . (int) $address['country_id'] . "' AND (zone_id = '" . (int) $address['zone_id'] . "' OR zone_id = '0')"); - - if ($this->config->get('iyzico_checkout_installment_total') > 0 && $this->config->get('iyzico_checkout_installment_total') > $total) { - $status = false; - } elseif (!$this->config->get('iyzico_checkout_installment_geo_zone_id')) { - $status = true; - } elseif ($query->num_rows) { - $status = true; - } else { - $status = false; - } - - $method_data = array(); - - if ($status) { - $method_data = array( - 'code' => 'iyzico_checkout_installment', - 'title' => $this->language->get('text_title'), - 'terms' => '', - 'sort_order' => $this->config->get('iyzico_checkout_installment_sort_order') - ); - } - - return $method_data; - } - - /** - * Create refund item for iyzico transaction - * - */ - public function createRefundItemEntry($data) - { - $query_string = "INSERT INTO " . DB_PREFIX . "iyzico_order_refunds SET"; - - $data_array = array(); - - foreach ($data as $key => $value) { - $data_array[] = "`$key` = '" . $this->db->escape($value) . "'"; - } - - $data_string = implode(", ", $data_array); - - $query_string .= $data_string; - - $query_string .= ";"; - - $this->db->query($query_string); - - return $this->db->getLastId(); - } - - /** - * Create order entry for iyzico transaction - * - */ - public function createOrderEntry($data) - { - $query_string = "INSERT INTO " . DB_PREFIX . "iyzico_order SET"; - - $data_array = array(); - - foreach ($data as $key => $value) { - $data_array[] = "`$key` = '" . $this->db->escape($value) . "'"; - } - - $data_string = implode(", ", $data_array); - - $query_string .= $data_string; - - $query_string .= ";"; - - $this->db->query($query_string); - - return $this->db->getLastId(); - } - - /** - * Update order entry for iyzico transaction - * - */ - public function updateOrderEntry($data, $id) - { - $query_string = "UPDATE " . DB_PREFIX . "iyzico_order SET"; - - $data_array = array(); - - foreach ($data as $key => $value) { - $data_array[] = "`$key` = '" . $this->db->escape($value) . "'"; - } - - $data_string = implode(", ", $data_array); - - $query_string .= $data_string; - - $query_string .= " WHERE `iyzico_order_id` = {$id};"; - - return $this->db->query($query_string); - } -} diff --git a/Payments/iyzico/upload/catalog/model/total/iyzico_checkout_form_fee.php b/Payments/iyzico/upload/catalog/model/total/iyzico_checkout_form_fee.php new file mode 100644 index 0000000..098ddef --- /dev/null +++ b/Payments/iyzico/upload/catalog/model/total/iyzico_checkout_form_fee.php @@ -0,0 +1,12 @@ +
+
+

+
+
+
+ + \ No newline at end of file diff --git a/Payments/iyzico/upload/catalog/view/theme/default/template/payment/iyzico_checkout_installment.tpl b/Payments/iyzico/upload/catalog/view/theme/default/template/payment/iyzico_checkout_installment.tpl deleted file mode 100644 index 24af0ec..0000000 --- a/Payments/iyzico/upload/catalog/view/theme/default/template/payment/iyzico_checkout_installment.tpl +++ /dev/null @@ -1,69 +0,0 @@ -
- -
- -
-

-
-
-
- -
-
-
- -
-
-
- - \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/IyzipayBootstrap.php b/Payments/iyzico/upload/system/iyzico/IyzipayBootstrap.php similarity index 84% rename from Payments/iyzico/upload/system/library/iyzico/IyzipayBootstrap.php rename to Payments/iyzico/upload/system/iyzico/IyzipayBootstrap.php index a750797..a12c40a 100644 --- a/Payments/iyzico/upload/system/library/iyzico/IyzipayBootstrap.php +++ b/Payments/iyzico/upload/system/iyzico/IyzipayBootstrap.php @@ -7,8 +7,10 @@ */ class IyzipayBootstrap { + /** * Inits and registers classes. + * @param string $includePath */ public static function init($includePath = "src") { @@ -47,15 +49,15 @@ public static function init($includePath = "src") * $classLoader->register(); * * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @author Jonathan H. Wage - * @author Roman S. Borschel - * @author Matthew Weier O'Phinney - * @author Kris Wallsmith - * @author Fabien Potencier + * @author Jonathan H. Wage + * @author Roman S. Borschel + * @author Matthew Weier O'Phinney + * @author Kris Wallsmith + * @author Fabien Potencier */ class SplClassLoader { - private $_fileExtension = '.php'; + private $_fileExtension = '.php'; private $_namespace; private $_includePath; private $_namespaceSeparator = '\\'; @@ -66,10 +68,12 @@ class SplClassLoader * * @param string $ns * The namespace to use. + * @param string $includePath + * The base path. */ public function __construct($ns = null, $includePath = null) { - $this->_namespace = $ns; + $this->_namespace = $ns; $this->_includePath = $includePath; } @@ -85,9 +89,9 @@ public function setNamespaceSeparator($sep) } /** - * Gets the namespace seperator used by classes in the namespace of this class loader. + * Gets the namespace separator used by classes in the namespace of this class loader. * - * @return void + * @return string $_namespaceSeparator */ public function getNamespaceSeparator() { @@ -140,9 +144,9 @@ public function getFileExtension() public function register() { spl_autoload_register(array( - $this, - 'loadClass' - )); + $this, + 'loadClass' + )); } /** @@ -151,9 +155,9 @@ public function register() public function unregister() { spl_autoload_unregister(array( - $this, - 'loadClass' - )); + $this, + 'loadClass' + )); } /** @@ -166,20 +170,15 @@ public function unregister() public function loadClass($className) { if (null === $this->_namespace || $this->_namespace . $this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace . $this->_namespaceSeparator))) { - $fileName = ''; - $namespace = ''; - + $fileName = ''; if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) { $namespace = substr($className, 0, $lastNsPos); - $className = substr($className, $lastNsPos + 1); - - $fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; + $fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; } - $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension; require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName; } } -} +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/ApiResource.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/ApiResource.php new file mode 100644 index 0000000..df8b1fd --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/ApiResource.php @@ -0,0 +1,32 @@ +rawResult; + } + + public function setRawResult($rawResult) + { + $this->rawResult = $rawResult; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/RequestDto.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/BaseModel.php similarity index 53% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/RequestDto.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/BaseModel.php index dfa360d..5d5ae15 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/RequestDto.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/BaseModel.php @@ -1,8 +1,8 @@ curl = $curl; + } + + public static function create($curl = null) + { + return new DefaultHttpClient($curl); + } + + public function get($url) { - return $this->exchange($url, array( + return $this->curl->exec($url, array( CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_RETURNTRANSFER => true, CURLOPT_VERBOSE => false, - CURLOPT_HEADER => false, - CURLOPT_HTTPHEADER => $header + CURLOPT_HEADER => false )); } public function post($url, $header, $content) { - return $this->exchange($url, array( + return $this->curl->exec($url, array( CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POST => true, CURLOPT_POSTFIELDS => $content, CURLOPT_RETURNTRANSFER => true, CURLOPT_VERBOSE => false, CURLOPT_HEADER => false, + //CURLOPT_SSL_VERIFYPEER => false, CURLOPT_HTTPHEADER => $header )); } public function put($url, $header, $content) { - return $this->exchange($url, array( + return $this->curl->exec($url, array( CURLOPT_CUSTOMREQUEST => "PUT", CURLOPT_POSTFIELDS => $content, CURLOPT_RETURNTRANSFER => true, @@ -42,7 +57,7 @@ public function put($url, $header, $content) public function delete($url, $header, $content = null) { - return $this->exchange($url, array( + return $this->curl->exec($url, array( CURLOPT_CUSTOMREQUEST => "DELETE", CURLOPT_POSTFIELDS => $content, CURLOPT_RETURNTRANSFER => true, @@ -51,11 +66,4 @@ public function delete($url, $header, $content = null) CURLOPT_HTTPHEADER => $header )); } - - public function exchange($url, $options) - { - $ch = curl_init($url); - curl_setopt_array($ch, $options); - return curl_exec($ch); - } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/HashGenerator.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/HashGenerator.php new file mode 100644 index 0000000..b0d797a --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/HashGenerator.php @@ -0,0 +1,12 @@ +toPKIRequestString(); + return base64_encode(sha1($hashStr, true)); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/HttpClient.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/HttpClient.php new file mode 100644 index 0000000..66afb6b --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/HttpClient.php @@ -0,0 +1,14 @@ +rawResult; + $header = array( + "Accept: application/json", + "Content-type: application/json", + ); + + $rnd = uniqid(); + array_push($header, "Authorization: " . self::prepareAuthorizationString($request, $options, $rnd)); + array_push($header, "x-iyzi-rnd: " . $rnd); + return $header; } - public function setRawResult($rawResult) + protected static function prepareAuthorizationString(Request $request, Options $options, $rnd) { - $this->rawResult = $rawResult; + $hash = HashGenerator::generateHash($options->getApiKey(), $options->getSecretKey(), $rnd, $request); + return vsprintf("IYZWS %s:%s", array($options->getApiKey(), $hash)); } public function getStatus() @@ -92,9 +100,4 @@ public function setConversationId($conversationId) { $this->conversationId = $conversationId; } - - public function fromJson($jsonResult) - { - ResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/JsonBuilder.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/JsonBuilder.php similarity index 91% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/JsonBuilder.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/JsonBuilder.php index 9558fee..5af6dd1 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/JsonBuilder.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/JsonBuilder.php @@ -1,6 +1,6 @@ json = $json; } - public static function newInstance() + public static function create() { return new JsonBuilder(array()); } @@ -79,4 +79,9 @@ public static function jsonEncode($jsonObject) { return json_encode($jsonObject); } + + public static function jsonDecode($rawResult) + { + return json_decode($rawResult); + } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/JsonConvertible.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/JsonConvertible.php similarity index 81% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/JsonConvertible.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/JsonConvertible.php index 74ba883..9c5180f 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/JsonConvertible.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/JsonConvertible.php @@ -1,6 +1,6 @@ add("address", $this->getAddress()) ->add("zipCode", $this->getZipCode()) ->add("contactName", $this->getContactName()) @@ -77,7 +77,7 @@ public function getJsonObject() public function toPKIRequestString() { - return PKIRequestStringBuilder::newInstance() + return RequestStringBuilder::create() ->append("address", $this->getAddress()) ->append("zipCode", $this->getZipCode()) ->append("contactName", $this->getContactName()) diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/ApiTest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/ApiTest.php new file mode 100644 index 0000000..998a7aa --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/ApiTest.php @@ -0,0 +1,16 @@ +get($options->getBaseUrl() . "/payment/test"); + return IyzipayResourceMapper::create($rawResult)->jsonDecode()->mapResource(new IyzipayResource()); + } +} diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Approval.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Approval.php new file mode 100644 index 0000000..81b9d44 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Approval.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/payment/iyzipos/item/approve", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return ApprovalMapper::create($rawResult)->jsonDecode()->mapApproval(new Approval()); + } + + public function getPaymentTransactionId() + { + return $this->paymentTransactionId; + } + + public function setPaymentTransactionId($paymentTransactionId) + { + $this->paymentTransactionId = $paymentTransactionId; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Dto/BouncedRowDto.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BankTransfer.php similarity index 76% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Dto/BouncedRowDto.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BankTransfer.php index 5f1caa1..32c4c63 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Dto/BouncedRowDto.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BankTransfer.php @@ -1,15 +1,15 @@ legalCompanyTitle = $legalCompanyTitle; } - public function getMarketplaceSubmerchantType() + public function getMarketplaceSubMerchantType() { - return $this->marketplaceSubmerchantType; + return $this->marketplaceSubMerchantType; } - public function setMarketplaceSubmerchantType($marketplaceSubmerchantType) + public function setMarketplaceSubMerchantType($marketplaceSubMerchantType) { - $this->marketplaceSubmerchantType = $marketplaceSubmerchantType; + $this->marketplaceSubMerchantType = $marketplaceSubMerchantType; } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomRetrievePaymentCheckoutFormAuthResponse.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicBkm.php similarity index 55% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomRetrievePaymentCheckoutFormAuthResponse.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicBkm.php index 852d310..08f40c6 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomRetrievePaymentCheckoutFormAuthResponse.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicBkm.php @@ -1,15 +1,23 @@ post($options->getBaseUrl() . "/payment/bkm/auth/detail/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicBkmMapper::create($rawResult)->jsonDecode()->mapBasicBkm(new BasicBkm()); + } + public function getToken() { return $this->token; @@ -39,9 +47,4 @@ public function setPaymentStatus($paymentStatus) { $this->paymentStatus = $paymentStatus; } - - public function fromJson($jsonResult) - { - EcomRetrievePaymentCheckoutFormAuthResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicBkmInitialize.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicBkmInitialize.php new file mode 100644 index 0000000..e660a75 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicBkmInitialize.php @@ -0,0 +1,40 @@ +post($options->getBaseUrl() . "/payment/bkm/initialize/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicBkmInitializeMapper::create($rawResult)->jsonDecode()->mapBasicBkmInitialize(new BasicBkmInitialize()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicPayment.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicPayment.php new file mode 100644 index 0000000..622cbbd --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicPayment.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/auth/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicPaymentMapper::create($rawResult)->jsonDecode()->mapBasicPayment(new BasicPayment()); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicPaymentPostAuth.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicPaymentPostAuth.php new file mode 100644 index 0000000..5281379 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicPaymentPostAuth.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/postauth/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicPaymentPostAuthMapper::create($rawResult)->jsonDecode()->mapBasicPaymentPostAuth(new BasicPaymentPostAuth()); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicPaymentPreAuth.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicPaymentPreAuth.php new file mode 100644 index 0000000..a5bb787 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicPaymentPreAuth.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/preauth/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicPaymentPreAuthMapper::create($rawResult)->jsonDecode()->mapBasicPaymentPreAuth(new BasicPaymentPreAuth()); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/PaymentResponse.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicPaymentResource.php similarity index 82% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/PaymentResponse.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicPaymentResource.php index 3b830ba..cbab716 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/PaymentResponse.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicPaymentResource.php @@ -1,15 +1,15 @@ installment = $installment; } + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + public function getPaymentId() { return $this->paymentId; @@ -162,8 +174,23 @@ public function setPaymentTransactionId($paymentTransactionId) $this->paymentTransactionId = $paymentTransactionId; } - public function fromJson($jsonResult) + public function getAuthCode() + { + return $this->authCode; + } + + public function setAuthCode($authCode) + { + $this->authCode = $authCode; + } + + public function getConnectorName() + { + return $this->connectorName; + } + + public function setConnectorName($connectorName) { - PaymentResponseMapper::newInstance()->mapResponse($this, $jsonResult); + $this->connectorName = $connectorName; } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicThreedsInitialize.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicThreedsInitialize.php new file mode 100644 index 0000000..4e84230 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicThreedsInitialize.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/payment/3dsecure/initialize/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicThreedsInitializeMapper::create($rawResult)->jsonDecode()->mapBasicThreedsInitialize(new BasicThreedsInitialize()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicThreedsInitializePreAuth.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicThreedsInitializePreAuth.php new file mode 100644 index 0000000..84b4e39 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicThreedsInitializePreAuth.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/payment/3dsecure/initialize/preauth/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicThreedsInitializePreAuthMapper::create($rawResult)->jsonDecode()->mapBasicThreedsInitializePreAuth(new BasicThreedsInitializePreAuth()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicThreedsPayment.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicThreedsPayment.php new file mode 100644 index 0000000..de71bb8 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasicThreedsPayment.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/3dsecure/auth/basic", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BasicThreedsPaymentMapper::create($rawResult)->jsonDecode()->mapBasicThreedsPayment(new BasicThreedsPayment()); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Dto/EcomPaymentBasketItemDto.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasketItem.php similarity index 89% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Dto/EcomPaymentBasketItemDto.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasketItem.php index 6bad179..e1990ca 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Dto/EcomPaymentBasketItemDto.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasketItem.php @@ -1,12 +1,12 @@ add("id", $this->getId()) ->addPrice("price", $this->getPrice()) ->add("name", $this->getName()) @@ -113,7 +113,7 @@ public function getJsonObject() public function toPKIRequestString() { - return PKIRequestStringBuilder::newInstance() + return RequestStringBuilder::create() ->append("id", $this->getId()) ->appendPrice("price", $this->getPrice()) ->append("name", $this->getName()) diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasketItemType.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasketItemType.php new file mode 100644 index 0000000..08163ea --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BasketItemType.php @@ -0,0 +1,9 @@ +post($options->getBaseUrl() . "/payment/bin/check", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BinNumberMapper::create($rawResult)->jsonDecode()->mapBinNumber(new BinNumber()); + } + public function getBinNumber() { return $this->binNumber; @@ -73,9 +81,4 @@ public function setBankCode($bankCode) { $this->bankCode = $bankCode; } - - public function fromJson($jsonResult) - { - BinCheckResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Bkm.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Bkm.php new file mode 100644 index 0000000..87908a2 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Bkm.php @@ -0,0 +1,39 @@ +post($options->getBaseUrl() . "/payment/bkm/auth/detail", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BkmMapper::create($rawResult)->jsonDecode()->mapBkm(new Bkm()); + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BkmInitialize.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BkmInitialize.php new file mode 100644 index 0000000..4ec83d1 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BkmInitialize.php @@ -0,0 +1,40 @@ +post($options->getBaseUrl() . "/payment/bkm/initialize", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BkmInitializeMapper::create($rawResult)->jsonDecode()->mapBkmInitialize(new BkmInitialize()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } +} diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BkmInstallment.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BkmInstallment.php new file mode 100644 index 0000000..3b6accc --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BkmInstallment.php @@ -0,0 +1,49 @@ +bankId; + } + + public function setBankId($bankId) + { + $this->bankId = $bankId; + } + + public function getInstallmentPrices() + { + return $this->installmentPrices; + } + + public function setInstallmentPrices($installmentPrices) + { + $this->installmentPrices = $installmentPrices; + } + + public function getJsonObject() + { + return JsonBuilder::create() + ->add("bankId", $this->getBankId()) + ->addArray("installmentPrices", $this->getInstallmentPrices()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->append("bankId", $this->getBankId()) + ->appendArray("installmentPrices", $this->getInstallmentPrices()) + ->getRequestString(); + } +} diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BkmInstallmentPrice.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BkmInstallmentPrice.php new file mode 100644 index 0000000..de3a11b --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BkmInstallmentPrice.php @@ -0,0 +1,49 @@ +installmentNumber; + } + + public function setInstallmentNumber($installmentNumber) + { + $this->installmentNumber = $installmentNumber; + } + + public function getTotalPrice() + { + return $this->totalPrice; + } + + public function setTotalPrice($totalPrice) + { + $this->totalPrice = $totalPrice; + } + + public function getJsonObject() + { + return JsonBuilder::create() + ->add("installmentNumber", $this->getInstallmentNumber()) + ->addPrice("totalPrice", $this->getTotalPrice()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->append("installmentNumber", $this->getInstallmentNumber()) + ->appendPrice("totalPrice", $this->getTotalPrice()) + ->getRequestString(); + } +} diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BouncedBankTransferList.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BouncedBankTransferList.php new file mode 100644 index 0000000..fb0c34e --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/BouncedBankTransferList.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/reporting/settlement/bounced", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return BouncedBankTransferListMapper::create($rawResult)->jsonDecode()->mapBouncedBankTransferList(new BouncedBankTransferList()); + } + + public function getBankTransfers() + { + return $this->bankTransfers; + } + + public function setBankTransfers($bankTransfers) + { + $this->bankTransfers = $bankTransfers; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Dto/EcomPaymentBuyerDto.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Buyer.php similarity index 93% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Dto/EcomPaymentBuyerDto.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Buyer.php index 6fbee21..e62a043 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Dto/EcomPaymentBuyerDto.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Buyer.php @@ -1,12 +1,12 @@ add("id", $this->getId()) ->add("name", $this->getName()) ->add("surname", $this->getSurname()) @@ -173,7 +173,7 @@ public function getJsonObject() public function toPKIRequestString() { - return PKIRequestStringBuilder::newInstance() + return RequestStringBuilder::create() ->append("id", $this->getId()) ->append("name", $this->getName()) ->append("surname", $this->getSurname()) diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Cancel.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Cancel.php new file mode 100644 index 0000000..fe47c57 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Cancel.php @@ -0,0 +1,62 @@ +post($options->getBaseUrl() . "/payment/cancel", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CancelMapper::create($rawResult)->jsonDecode()->mapCancel(new Cancel()); + } + + public function getPaymentId() + { + return $this->paymentId; + } + + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getConnectorName() + { + return $this->connectorName; + } + + public function setConnectorName($connectorName) + { + $this->connectorName = $connectorName; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Dto/CardDetailDto.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Card.php similarity index 53% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Dto/CardDetailDto.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Card.php index 270f4c3..d8940ab 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Dto/CardDetailDto.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Card.php @@ -1,9 +1,18 @@ post($options->getBaseUrl() . "/cardstorage/card", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CardMapper::create($rawResult)->jsonDecode()->mapCard(new Card()); + } + + public static function delete(DeleteCardRequest $request, Options $options) + { + $rawResult = parent::httpClient()->delete($options->getBaseUrl() . "/cardstorage/card", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CardMapper::create($rawResult)->jsonDecode()->mapCard(new Card()); + } + + public function getExternalId() + { + return $this->externalId; + } + + public function setExternalId($externalId) + { + $this->externalId = $externalId; + } + + public function getEmail() + { + return $this->email; + } + + public function setEmail($email) + { + $this->email = $email; + } + + public function getCardUserKey() + { + return $this->cardUserKey; + } + + public function setCardUserKey($cardUserKey) + { + $this->cardUserKey = $cardUserKey; + } + public function getCardToken() { return $this->cardToken; @@ -92,4 +143,4 @@ public function setCardBankName($cardBankName) { $this->cardBankName = $cardBankName; } -} +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Dto/CardDto.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CardInformation.php similarity index 86% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Dto/CardDto.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CardInformation.php index 66959d8..3ad3747 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Dto/CardDto.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CardInformation.php @@ -1,12 +1,12 @@ add("cardAlias", $this->getCardAlias()) ->add("cardNumber", $this->getCardNumber()) ->add("expireYear", $this->getExpireYear()) @@ -77,7 +77,7 @@ public function getJsonObject() public function toPKIRequestString() { - return PKIRequestStringBuilder::newInstance() + return RequestStringBuilder::create() ->append("cardAlias", $this->getCardAlias()) ->append("cardNumber", $this->getCardNumber()) ->append("expireYear", $this->getExpireYear()) diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CardList.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CardList.php new file mode 100644 index 0000000..2434cc1 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CardList.php @@ -0,0 +1,40 @@ +post($options->getBaseUrl() . "/cardstorage/cards", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CardListMapper::create($rawResult)->jsonDecode()->mapCardList(new CardList()); + } + + public function getCardUserKey() + { + return $this->cardUserKey; + } + + public function setCardUserKey($cardUserKey) + { + $this->cardUserKey = $cardUserKey; + } + + public function getCardDetails() + { + return $this->cardDetails; + } + + public function setCardDetails($cardDetails) + { + $this->cardDetails = $cardDetails; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CheckoutForm.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CheckoutForm.php new file mode 100644 index 0000000..9216020 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CheckoutForm.php @@ -0,0 +1,39 @@ +post($options->getBaseUrl() . "/payment/iyzipos/checkoutform/auth/ecom/detail", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CheckoutFormMapper::create($rawResult)->jsonDecode()->mapCheckoutForm(new CheckoutForm()); + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CheckoutFormInitialize.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CheckoutFormInitialize.php new file mode 100644 index 0000000..9f50136 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CheckoutFormInitialize.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/iyzipos/checkoutform/initialize/auth/ecom", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CheckoutFormInitializeMapper::create($rawResult)->jsonDecode()->mapCheckoutFormInitialize(new CheckoutFormInitialize()); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CheckoutFormInitializePreAuth.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CheckoutFormInitializePreAuth.php new file mode 100644 index 0000000..af7dac1 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CheckoutFormInitializePreAuth.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/iyzipos/checkoutform/initialize/preauth/ecom", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CheckoutFormInitializePreAuthMapper::create($rawResult)->jsonDecode()->mapCheckoutFormInitializePreAuth(new CheckoutFormInitializePreAuth()); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentCheckoutFormInitializeResponse.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CheckoutFormInitializeResource.php similarity index 65% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentCheckoutFormInitializeResponse.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CheckoutFormInitializeResource.php index 3ef192b..47b6fbb 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentCheckoutFormInitializeResponse.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CheckoutFormInitializeResource.php @@ -1,15 +1,15 @@ tokenExpireTime = $tokenExpireTime; } - public function fromJson($jsonResult) + public function getPaymentPageUrl() { - EcomPaymentCheckoutFormInitializeResponseMapper::newInstance()->mapResponse($this, $jsonResult); + return $this->paymentPageUrl; + } + + public function setPaymentPageUrl($paymentPageUrl) + { + $this->paymentPageUrl = $paymentPageUrl; } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/ConvertedPayout.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/ConvertedPayout.php new file mode 100644 index 0000000..06bd8c3 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/ConvertedPayout.php @@ -0,0 +1,117 @@ +paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getIyziCommissionRateAmount() + { + return $this->iyziCommissionRateAmount; + } + + public function setIyziCommissionRateAmount($iyziCommissionRateAmount) + { + $this->iyziCommissionRateAmount = $iyziCommissionRateAmount; + } + + public function getIyziCommissionFee() + { + return $this->iyziCommissionFee; + } + + public function setIyziCommissionFee($iyziCommissionFee) + { + $this->iyziCommissionFee = $iyziCommissionFee; + } + + public function getBlockageRateAmountMerchant() + { + return $this->blockageRateAmountMerchant; + } + + public function setBlockageRateAmountMerchant($blockageRateAmountMerchant) + { + $this->blockageRateAmountMerchant = $blockageRateAmountMerchant; + } + + public function getBlockageRateAmountSubMerchant() + { + return $this->blockageRateAmountSubMerchant; + } + + public function setBlockageRateAmountSubMerchant($blockageRateAmountSubMerchant) + { + $this->blockageRateAmountSubMerchant = $blockageRateAmountSubMerchant; + } + + public function getSubMerchantPayoutAmount() + { + return $this->subMerchantPayoutAmount; + } + + public function setSubMerchantPayoutAmount($subMerchantPayoutAmount) + { + $this->subMerchantPayoutAmount = $subMerchantPayoutAmount; + } + + public function getMerchantPayoutAmount() + { + return $this->merchantPayoutAmount; + } + + public function setMerchantPayoutAmount($merchantPayoutAmount) + { + $this->merchantPayoutAmount = $merchantPayoutAmount; + } + + public function getIyziConversionRate() + { + return $this->iyziConversionRate; + } + + public function setIyziConversionRate($iyziConversionRate) + { + $this->iyziConversionRate = $iyziConversionRate; + } + + public function getIyziConversionRateAmount() + { + return $this->iyziConversionRateAmount; + } + + public function setIyziConversionRateAmount($iyziConversionRateAmount) + { + $this->iyziConversionRateAmount = $iyziConversionRateAmount; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CrossBookingFromSubMerchant.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CrossBookingFromSubMerchant.php new file mode 100644 index 0000000..ebd8f6c --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CrossBookingFromSubMerchant.php @@ -0,0 +1,17 @@ +post($options->getBaseUrl() . "/crossbooking/receive", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CrossBookingFromSubMerchantMapper::create($rawResult)->jsonDecode()->mapCrossBookingFromSubMerchant(new CrossBookingFromSubMerchant()); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CrossBookingToSubMerchant.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CrossBookingToSubMerchant.php new file mode 100644 index 0000000..6a1622d --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/CrossBookingToSubMerchant.php @@ -0,0 +1,17 @@ +post($options->getBaseUrl() . "/crossbooking/send", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return CrossBookingToSubMerchantMapper::create($rawResult)->jsonDecode()->mapCrossBookingToSubMerchant(new CrossBookingToSubMerchant()); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Currency.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Currency.php new file mode 100644 index 0000000..d410657 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Currency.php @@ -0,0 +1,12 @@ +post($options->getBaseUrl() . "/payment/iyzipos/item/disapprove", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return DisapprovalMapper::create($rawResult)->jsonDecode()->mapDisapproval(new Disapproval()); + } + + public function getPaymentTransactionId() + { + return $this->paymentTransactionId; + } + + public function setPaymentTransactionId($paymentTransactionId) + { + $this->paymentTransactionId = $paymentTransactionId; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Installment/Dto/InstallmentDetailDto.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/InstallmentDetail.php similarity index 88% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Installment/Dto/InstallmentDetailDto.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/InstallmentDetail.php index 081de0f..c6f8672 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Installment/Dto/InstallmentDetailDto.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/InstallmentDetail.php @@ -1,8 +1,8 @@ bankName = $bankName; } + public function getForceCvc() + { + return $this->forceCvc; + } + + public function setForceCvc($forceCvc) + { + $this->forceCvc = $forceCvc; + } + public function getInstallmentPrices() { return $this->installmentPrices; diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/InstallmentHtml.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/InstallmentHtml.php new file mode 100644 index 0000000..4fcae17 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/InstallmentHtml.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/payment/iyzipos/installment/html/horizontal", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return InstallmentHtmlMapper::create($rawResult)->jsonDecode()->mapInstallmentHtml(new InstallmentHtml()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } +} diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/InstallmentInfo.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/InstallmentInfo.php new file mode 100644 index 0000000..26b22cb --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/InstallmentInfo.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/payment/iyzipos/installment", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return InstallmentInfoMapper::create($rawResult)->jsonDecode()->mapInstallmentInfo(new InstallmentInfo()); + } + + public function getInstallmentDetails() + { + return $this->installmentDetails; + } + + public function setInstallmentDetails($installmentDetails) + { + $this->installmentDetails = $installmentDetails; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Installment/Dto/InstallmentPriceDto.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/InstallmentPrice.php similarity index 90% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Installment/Dto/InstallmentPriceDto.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/InstallmentPrice.php index 99abb34..d203e75 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Installment/Dto/InstallmentPriceDto.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/InstallmentPrice.php @@ -1,8 +1,8 @@ paymentTransactionId)) { + $approval->setPaymentTransactionId($jsonObject->paymentTransactionId); + } + return $approval; + } + + public function mapApproval(Approval $approval) + { + return $this->mapApprovalFrom($approval, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicBkmInitializeMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicBkmInitializeMapper.php new file mode 100644 index 0000000..827b181 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicBkmInitializeMapper.php @@ -0,0 +1,31 @@ +htmlContent)) { + $initialize->setHtmlContent(base64_decode($jsonObject->htmlContent)); + } + if (isset($jsonObject->token)) { + $initialize->setToken($jsonObject->token); + } + return $initialize; + } + + public function mapBasicBkmInitialize(BasicBkmInitialize $initialize) + { + return $this->mapBasicBkmInitializeFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicBkmMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicBkmMapper.php new file mode 100644 index 0000000..d2047f8 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicBkmMapper.php @@ -0,0 +1,34 @@ +token)) { + $auth->setToken($jsonObject->token); + } + if (isset($jsonObject->callbackUrl)) { + $auth->setCallbackUrl($jsonObject->callbackUrl); + } + if (isset($jsonObject->paymentStatus)) { + $auth->setPaymentStatus($jsonObject->paymentStatus); + } + return $auth; + } + + public function mapBasicBkm(BasicBkm $auth) + { + return $this->mapBasicBkmFrom($auth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicPaymentMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicPaymentMapper.php new file mode 100644 index 0000000..a607477 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicPaymentMapper.php @@ -0,0 +1,24 @@ +mapBasicPaymentFrom($payment, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicPaymentPostAuthMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicPaymentPostAuthMapper.php new file mode 100644 index 0000000..beeb8ef --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicPaymentPostAuthMapper.php @@ -0,0 +1,24 @@ +mapBasicPaymentPostAuthFrom($postAuth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicPaymentPreAuthMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicPaymentPreAuthMapper.php new file mode 100644 index 0000000..7b60c99 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicPaymentPreAuthMapper.php @@ -0,0 +1,24 @@ +mapBasicPaymentPreAuthFrom($preAuth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicPaymentResourceMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicPaymentResourceMapper.php new file mode 100644 index 0000000..ebdfc99 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicPaymentResourceMapper.php @@ -0,0 +1,76 @@ +price)) { + $payment->setPrice($jsonObject->price); + } + if (isset($jsonObject->paidPrice)) { + $payment->setPaidPrice($jsonObject->paidPrice); + } + if (isset($jsonObject->installment)) { + $payment->setInstallment($jsonObject->installment); + } + if (isset($jsonObject->paymentId)) { + $payment->setPaymentId($jsonObject->paymentId); + } + if (isset($jsonObject->merchantCommissionRate)) { + $payment->setMerchantCommissionRate($jsonObject->merchantCommissionRate); + } + if (isset($jsonObject->merchantCommissionRateAmount)) { + $payment->setMerchantCommissionRateAmount($jsonObject->merchantCommissionRateAmount); + } + if (isset($jsonObject->iyziCommissionFee)) { + $payment->setIyziCommissionFee($jsonObject->iyziCommissionFee); + } + if (isset($jsonObject->cardType)) { + $payment->setCardType($jsonObject->cardType); + } + if (isset($jsonObject->cardAssociation)) { + $payment->setCardAssociation($jsonObject->cardAssociation); + } + if (isset($jsonObject->cardFamily)) { + $payment->setCardFamily($jsonObject->cardFamily); + } + if (isset($jsonObject->cardToken)) { + $payment->setCardToken($jsonObject->cardToken); + } + if (isset($jsonObject->cardUserKey)) { + $payment->setCardUserKey($jsonObject->cardUserKey); + } + if (isset($jsonObject->binNumber)) { + $payment->setBinNumber($jsonObject->binNumber); + } + if (isset($jsonObject->paymentTransactionId)) { + $payment->setPaymentTransactionId($jsonObject->paymentTransactionId); + } + if (isset($jsonObject->authCode)) { + $payment->setAuthCode($jsonObject->authCode); + } + if (isset($jsonObject->connectorName)) { + $payment->setConnectorName($jsonObject->connectorName); + } + if (isset($jsonObject->currency)) { + $payment->setCurrency($jsonObject->currency); + } + return $payment; + } + + public function mapBasicPaymentResource(BasicPaymentResource $payment) + { + return $this->mapBasicPaymentResourceFrom($payment, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicThreedsInitializeMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicThreedsInitializeMapper.php new file mode 100644 index 0000000..bdca52e --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicThreedsInitializeMapper.php @@ -0,0 +1,28 @@ +threeDSHtmlContent)) { + $initialize->setHtmlContent(base64_decode($jsonObject->threeDSHtmlContent)); + } + return $initialize; + } + + public function mapBasicThreedsInitialize(BasicThreedsInitialize $initialize) + { + return $this->mapBasicThreedsInitializeFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicThreedsInitializePreAuthMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicThreedsInitializePreAuthMapper.php new file mode 100644 index 0000000..985cdc8 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicThreedsInitializePreAuthMapper.php @@ -0,0 +1,28 @@ +threeDSHtmlContent)) { + $initializePreAuth->setHtmlContent(base64_decode($jsonObject->threeDSHtmlContent)); + } + return $initializePreAuth; + } + + public function mapBasicThreedsInitializePreAuth(BasicThreedsInitializePreAuth $initializePreAuth) + { + return $this->mapBasicThreedsInitializePreAuthFrom($initializePreAuth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicThreedsPaymentMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicThreedsPaymentMapper.php new file mode 100644 index 0000000..24980ef --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BasicThreedsPaymentMapper.php @@ -0,0 +1,24 @@ +mapBasicThreedsPaymentFrom($auth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BinNumberMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BinNumberMapper.php new file mode 100644 index 0000000..5187aa2 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BinNumberMapper.php @@ -0,0 +1,43 @@ +binNumber)) { + $binNumber->setBinNumber($jsonObject->binNumber); + } + if (isset($jsonObject->cardType)) { + $binNumber->setCardType($jsonObject->cardType); + } + if (isset($jsonObject->cardAssociation)) { + $binNumber->setCardAssociation($jsonObject->cardAssociation); + } + if (isset($jsonObject->cardFamily)) { + $binNumber->setCardFamily($jsonObject->cardFamily); + } + if (isset($jsonObject->bankName)) { + $binNumber->setBankName($jsonObject->bankName); + } + if (isset($jsonObject->bankCode)) { + $binNumber->setBankCode($jsonObject->bankCode); + } + return $binNumber; + } + + public function mapBinNumber(BinNumber $binNumber) + { + return $this->mapBinNumberFrom($binNumber, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BkmInitializeMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BkmInitializeMapper.php new file mode 100644 index 0000000..37e146e --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BkmInitializeMapper.php @@ -0,0 +1,31 @@ +htmlContent)) { + $initialize->setHtmlContent(base64_decode($jsonObject->htmlContent)); + } + if (isset($jsonObject->token)) { + $initialize->setToken($jsonObject->token); + } + return $initialize; + } + + public function mapBkmInitialize(BkmInitialize $initialize) + { + return $this->mapBkmInitializeFrom($initialize, $this->jsonObject); + } +} diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BkmMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BkmMapper.php new file mode 100644 index 0000000..807fd03 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BkmMapper.php @@ -0,0 +1,31 @@ +token)) { + $auth->setToken($jsonObject->token); + } + if (isset($jsonObject->callbackUrl)) { + $auth->setCallbackUrl($jsonObject->callbackUrl); + } + return $auth; + } + + public function mapBkm(Bkm $auth) + { + return $this->mapBkmFrom($auth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BouncedBankTransferListMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BouncedBankTransferListMapper.php new file mode 100644 index 0000000..2dfe066 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/BouncedBankTransferListMapper.php @@ -0,0 +1,59 @@ +bouncedRows)) { + $transferList->setBankTransfers($this->mapBankTransfers($jsonObject->bouncedRows)); + } + return $transferList; + } + + public function mapBouncedBankTransferList(BouncedBankTransferList $transferList) + { + return $this->mapBouncedBankTransferListFrom($transferList, $this->jsonObject); + } + + private function mapBankTransfers($bouncedRows) + { + $bankTransfers = array(); + + foreach ($bouncedRows as $index => $bouncedRow) { + $bankTransfer = new BankTransfer(); + + if (isset($bouncedRow->subMerchantKey)) { + $bankTransfer->setSubMerchantKey($bouncedRow->subMerchantKey); + } + if (isset($bouncedRow->iban)) { + $bankTransfer->setIban($bouncedRow->iban); + } + if (isset($bouncedRow->contactName)) { + $bankTransfer->setContactName($bouncedRow->contactName); + } + if (isset($bouncedRow->contactSurname)) { + $bankTransfer->setContactSurname($bouncedRow->contactSurname); + } + if (isset($bouncedRow->legalCompanyTitle)) { + $bankTransfer->setLegalCompanyTitle($bouncedRow->legalCompanyTitle); + } + if (isset($bouncedRow->marketplaceSubmerchantType)) { + $bankTransfer->setMarketplaceSubMerchantType($bouncedRow->marketplaceSubmerchantType); + } + $bankTransfers[$index] = $bankTransfer; + } + return $bankTransfers; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CancelMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CancelMapper.php new file mode 100644 index 0000000..835344e --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CancelMapper.php @@ -0,0 +1,37 @@ +paymentId)) { + $cancel->setPaymentId($jsonObject->paymentId); + } + if (isset($jsonObject->price)) { + $cancel->setPrice($jsonObject->price); + } + if (isset($jsonObject->currency)) { + $cancel->setCurrency($jsonObject->currency); + } + if (isset($jsonObject->connectorName)) { + $cancel->setConnectorName($jsonObject->connectorName); + } + return $cancel; + } + + public function mapCancel(Cancel $cancel) + { + return $this->mapCancelFrom($cancel, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CardListMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CardListMapper.php new file mode 100644 index 0000000..e37588b --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CardListMapper.php @@ -0,0 +1,42 @@ +cardUserKey)) { + $cardList->setCardUserKey($jsonObject->cardUserKey); + } + if (isset($jsonObject->cardDetails)) { + $cardList->setCardDetails($this->mapCardDetails($jsonObject->cardDetails)); + } + return $cardList; + } + + public function mapCardList(CardList $cardList) + { + return $this->mapCardListFrom($cardList, $this->jsonObject); + } + + private function mapCardDetails($cardDetails) + { + $cards = array(); + + foreach ($cardDetails as $index => $cardDetail) { + $cards[$index] = CardMapper::create()->mapCardFrom(new Card(), $cardDetail); + } + return $cards; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CardMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CardMapper.php new file mode 100644 index 0000000..2a33280 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CardMapper.php @@ -0,0 +1,58 @@ +externalId)) { + $card->setExternalId($jsonObject->externalId); + } + if (isset($jsonObject->email)) { + $card->setEmail($jsonObject->email); + } + if (isset($jsonObject->cardUserKey)) { + $card->setCardUserKey($jsonObject->cardUserKey); + } + if (isset($jsonObject->cardToken)) { + $card->setCardToken($jsonObject->cardToken); + } + if (isset($jsonObject->cardAlias)) { + $card->setCardAlias($jsonObject->cardAlias); + } + if (isset($jsonObject->binNumber)) { + $card->setBinNumber($jsonObject->binNumber); + } + if (isset($jsonObject->cardType)) { + $card->setCardType($jsonObject->cardType); + } + if (isset($jsonObject->cardAssociation)) { + $card->setCardAssociation($jsonObject->cardAssociation); + } + if (isset($jsonObject->cardFamily)) { + $card->setCardFamily($jsonObject->cardFamily); + } + if (isset($jsonObject->cardBankCode)) { + $card->setCardBankCode($jsonObject->cardBankCode); + } + if (isset($jsonObject->cardBankName)) { + $card->setCardBankName($jsonObject->cardBankName); + } + return $card; + } + + public function mapCard(Card $card) + { + return $this->mapCardFrom($card, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CheckoutFormInitializeMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CheckoutFormInitializeMapper.php new file mode 100644 index 0000000..97bb630 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CheckoutFormInitializeMapper.php @@ -0,0 +1,24 @@ +mapCheckoutFormInitializeFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CheckoutFormInitializePreAuthMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CheckoutFormInitializePreAuthMapper.php new file mode 100644 index 0000000..a4d91bd --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CheckoutFormInitializePreAuthMapper.php @@ -0,0 +1,24 @@ +mapCheckoutFormInitializePreAuthFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CheckoutFormInitializeResourceMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CheckoutFormInitializeResourceMapper.php new file mode 100644 index 0000000..f2458ff --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CheckoutFormInitializeResourceMapper.php @@ -0,0 +1,37 @@ +token)) { + $initialize->setToken($jsonObject->token); + } + if (isset($jsonObject->checkoutFormContent)) { + $initialize->setCheckoutFormContent($jsonObject->checkoutFormContent); + } + if (isset($jsonObject->tokenExpireTime)) { + $initialize->setTokenExpireTime($jsonObject->tokenExpireTime); + } + if (isset($jsonObject->paymentPageUrl)) { + $initialize->setPaymentPageUrl($jsonObject->paymentPageUrl); + } + return $initialize; + } + + public function mapCheckoutFormInitializeResource(CheckoutFormInitializeResource $initialize) + { + return $this->mapCheckoutFormInitializeResourceFrom($initialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CheckoutFormMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CheckoutFormMapper.php new file mode 100644 index 0000000..92e34f0 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CheckoutFormMapper.php @@ -0,0 +1,31 @@ +token)) { + $auth->setToken($jsonObject->token); + } + if (isset($jsonObject->callbackUrl)) { + $auth->setCallbackUrl($jsonObject->callbackUrl); + } + return $auth; + } + + public function mapCheckoutForm(CheckoutForm $auth) + { + return $this->mapCheckoutFormFrom($auth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CrossBookingFromSubMerchantMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CrossBookingFromSubMerchantMapper.php new file mode 100644 index 0000000..9a86b0f --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CrossBookingFromSubMerchantMapper.php @@ -0,0 +1,24 @@ +mapCrossBookingFromSubMerchantFrom($booking, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CrossBookingToSubMerchantMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CrossBookingToSubMerchantMapper.php new file mode 100644 index 0000000..65ddcf0 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/CrossBookingToSubMerchantMapper.php @@ -0,0 +1,24 @@ +mapCrossBookingToSubMerchantFrom($booking, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/DisapprovalMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/DisapprovalMapper.php new file mode 100644 index 0000000..dd57ddd --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/DisapprovalMapper.php @@ -0,0 +1,28 @@ +paymentTransactionId)) { + $disapproval->setPaymentTransactionId($jsonObject->paymentTransactionId); + } + return $disapproval; + } + + public function mapDisapproval(Disapproval $disapproval) + { + return $this->mapDisapprovalFrom($disapproval, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/InstallmentHtmlMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/InstallmentHtmlMapper.php new file mode 100644 index 0000000..a3f648a --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/InstallmentHtmlMapper.php @@ -0,0 +1,28 @@ +htmlContent)) { + $installmentHtml->setHtmlContent($jsonObject->htmlContent); + } + return $installmentHtml; + } + + public function mapInstallmentHtml(InstallmentHtml $installmentHtml) + { + return $this->mapInstallmentHtmlFrom($installmentHtml, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/InstallmentInfoMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/InstallmentInfoMapper.php new file mode 100644 index 0000000..43c51d5 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/InstallmentInfoMapper.php @@ -0,0 +1,93 @@ +installmentDetails)) { + $installment->setInstallmentDetails($this->mapInstallmentDetails($jsonObject->installmentDetails)); + } + return $installment; + } + + public function mapInstallmentInfo(InstallmentInfo $installment) + { + return $this->mapInstallmentInfoFrom($installment, $this->jsonObject); + } + + private function mapInstallmentDetails($installmentDetails) + { + $details = array(); + + foreach ($installmentDetails as $index => $installmentDetail) { + $detail = new InstallmentDetail(); + + if (isset($installmentDetail->binNumber)) { + $detail->setBinNumber($installmentDetail->binNumber); + } + if (isset($installmentDetail->price)) { + $detail->setPrice($installmentDetail->price); + } + if (isset($installmentDetail->cardType)) { + $detail->setCardType($installmentDetail->cardType); + } + if (isset($installmentDetail->cardAssociation)) { + $detail->setCardAssociation($installmentDetail->cardAssociation); + } + if (isset($installmentDetail->cardFamilyName)) { + $detail->setCardFamilyName($installmentDetail->cardFamilyName); + } + if (isset($installmentDetail->force3ds)) { + $detail->setForce3ds($installmentDetail->force3ds); + } + if (isset($installmentDetail->bankCode)) { + $detail->setBankCode($installmentDetail->bankCode); + } + if (isset($installmentDetail->bankName)) { + $detail->setBankName($installmentDetail->bankName); + } + if (isset($installmentDetail->forceCvc)) { + $detail->setForceCvc($installmentDetail->forceCvc); + } + if (isset($installmentDetail->installmentPrices)) { + $detail->setInstallmentPrices($this->mapInstallmentPrices($installmentDetail->installmentPrices)); + } + $details[$index] = $detail; + } + return $details; + } + + private function mapInstallmentPrices($installmentPrices) + { + $prices = array(); + + foreach ($installmentPrices as $index => $installmentPrice) { + $price = new InstallmentPrice(); + + if (isset($installmentPrice->installmentPrice)) { + $price->setInstallmentPrice($installmentPrice->installmentPrice); + } + if (isset($installmentPrice->totalPrice)) { + $price->setTotalPrice($installmentPrice->totalPrice); + } + if (isset($installmentPrice->installmentNumber)) { + $price->setInstallmentNumber($installmentPrice->installmentNumber); + } + $prices[$index] = $price; + } + return $prices; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/IyzipayResourceMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/IyzipayResourceMapper.php new file mode 100644 index 0000000..9cdb02e --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/IyzipayResourceMapper.php @@ -0,0 +1,62 @@ +rawResult = $rawResult; + } + + public static function create($rawResult = null) + { + return new IyzipayResourceMapper($rawResult); + } + + public function jsonDecode() + { + $this->jsonObject = JsonBuilder::jsonDecode($this->rawResult); + return $this; + } + + public function mapResourceFrom(IyzipayResource $resource, $jsonObject) + { + if (isset($jsonObject->status)) { + $resource->setStatus($jsonObject->status); + } + if (isset($jsonObject->conversationId)) { + $resource->setConversationId($jsonObject->conversationId); + } + if (isset($jsonObject->errorCode)) { + $resource->setErrorCode($jsonObject->errorCode); + } + if (isset($jsonObject->errorMessage)) { + $resource->setErrorMessage($jsonObject->errorMessage); + } + if (isset($jsonObject->errorGroup)) { + $resource->setErrorGroup($jsonObject->errorGroup); + } + if (isset($jsonObject->locale)) { + $resource->setLocale($jsonObject->locale); + } + if (isset($jsonObject->systemTime)) { + $resource->setSystemTime($jsonObject->systemTime); + } + if (isset($this->rawResult)) { + $resource->setRawResult($this->rawResult); + } + return $resource; + } + + public function mapResource(IyzipayResource $resource) + { + return $this->mapResourceFrom($resource, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PaymentMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PaymentMapper.php new file mode 100644 index 0000000..9f201f9 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PaymentMapper.php @@ -0,0 +1,24 @@ +mapPaymentFrom($payment, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PaymentPostAuthMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PaymentPostAuthMapper.php new file mode 100644 index 0000000..0f9701b --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PaymentPostAuthMapper.php @@ -0,0 +1,24 @@ +mapPaymentPostAuthFrom($postAuth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PaymentPreAuthMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PaymentPreAuthMapper.php new file mode 100644 index 0000000..c491edd --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PaymentPreAuthMapper.php @@ -0,0 +1,24 @@ +mapPaymentPreAuthFrom($paymentPreAuth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PaymentResourceMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PaymentResourceMapper.php new file mode 100644 index 0000000..046922c --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PaymentResourceMapper.php @@ -0,0 +1,196 @@ +price)) { + $paymentResource->setPrice($jsonObject->price); + } + if (isset($jsonObject->paidPrice)) { + $paymentResource->setPaidPrice($jsonObject->paidPrice); + } + if (isset($jsonObject->installment)) { + $paymentResource->setInstallment($jsonObject->installment); + } + if (isset($jsonObject->paymentId)) { + $paymentResource->setPaymentId($jsonObject->paymentId); + } + if (isset($jsonObject->paymentStatus)) { + $paymentResource->setPaymentStatus($jsonObject->paymentStatus); + } + if (isset($jsonObject->fraudStatus)) { + $paymentResource->setFraudStatus($jsonObject->fraudStatus); + } + if (isset($jsonObject->merchantCommissionRate)) { + $paymentResource->setMerchantCommissionRate($jsonObject->merchantCommissionRate); + } + if (isset($jsonObject->merchantCommissionRateAmount)) { + $paymentResource->setMerchantCommissionRateAmount($jsonObject->merchantCommissionRateAmount); + } + if (isset($jsonObject->iyziCommissionRateAmount)) { + $paymentResource->setIyziCommissionRateAmount($jsonObject->iyziCommissionRateAmount); + } + if (isset($jsonObject->iyziCommissionFee)) { + $paymentResource->setIyziCommissionFee($jsonObject->iyziCommissionFee); + } + if (isset($jsonObject->cardType)) { + $paymentResource->setCardType($jsonObject->cardType); + } + if (isset($jsonObject->cardAssociation)) { + $paymentResource->setCardAssociation($jsonObject->cardAssociation); + } + if (isset($jsonObject->cardFamily)) { + $paymentResource->setCardFamily($jsonObject->cardFamily); + } + if (isset($jsonObject->cardUserKey)) { + $paymentResource->setCardUserKey($jsonObject->cardUserKey); + } + if (isset($jsonObject->cardToken)) { + $paymentResource->setCardToken($jsonObject->cardToken); + } + if (isset($jsonObject->binNumber)) { + $paymentResource->setBinNumber($jsonObject->binNumber); + } + if (isset($jsonObject->basketId)) { + $paymentResource->setBasketId($jsonObject->basketId); + } + if (isset($jsonObject->currency)) { + $paymentResource->setCurrency($jsonObject->currency); + } + if (isset($jsonObject->itemTransactions)) { + $paymentResource->setPaymentItems($this->mapPaymentItems($jsonObject->itemTransactions)); + } + if (isset($jsonObject->connectorName)) { + $paymentResource->setConnectorName($jsonObject->connectorName); + } + if (isset($jsonObject->authCode)) { + $paymentResource->setAuthCode($jsonObject->authCode); + } + return $paymentResource; + } + + public function mapPaymentResource(PaymentResource $paymentResource) + { + return $this->mapPaymentResourceFrom($paymentResource, $this->jsonObject); + } + + private function mapPaymentItems($itemTransactions) + { + $paymentItems = array(); + + foreach ($itemTransactions as $index => $itemTransaction) { + $paymentItem = new PaymentItem(); + + if (isset($itemTransaction->itemId)) { + $paymentItem->setItemId($itemTransaction->itemId); + } + if (isset($itemTransaction->paymentTransactionId)) { + $paymentItem->setPaymentTransactionId($itemTransaction->paymentTransactionId); + } + if (isset($itemTransaction->transactionStatus)) { + $paymentItem->setTransactionStatus($itemTransaction->transactionStatus); + } + if (isset($itemTransaction->price)) { + $paymentItem->setPrice($itemTransaction->price); + } + if (isset($itemTransaction->paidPrice)) { + $paymentItem->setPaidPrice($itemTransaction->paidPrice); + } + if (isset($itemTransaction->merchantCommissionRate)) { + $paymentItem->setMerchantCommissionRate($itemTransaction->merchantCommissionRate); + } + if (isset($itemTransaction->merchantCommissionRateAmount)) { + $paymentItem->setMerchantCommissionRateAmount($itemTransaction->merchantCommissionRateAmount); + } + if (isset($itemTransaction->iyziCommissionRateAmount)) { + $paymentItem->setIyziCommissionRateAmount($itemTransaction->iyziCommissionRateAmount); + } + if (isset($itemTransaction->iyziCommissionFee)) { + $paymentItem->setIyziCommissionFee($itemTransaction->iyziCommissionFee); + } + if (isset($itemTransaction->blockageRate)) { + $paymentItem->setBlockageRate($itemTransaction->blockageRate); + } + if (isset($itemTransaction->blockageRateAmountMerchant)) { + $paymentItem->setBlockageRateAmountMerchant($itemTransaction->blockageRateAmountMerchant); + } + if (isset($itemTransaction->blockageRateAmountSubMerchant)) { + $paymentItem->setBlockageRateAmountSubMerchant($itemTransaction->blockageRateAmountSubMerchant); + } + if (isset($itemTransaction->blockageResolvedDate)) { + $paymentItem->setBlockageResolvedDate($itemTransaction->blockageResolvedDate); + } + if (isset($itemTransaction->subMerchantKey)) { + $paymentItem->setSubMerchantKey($itemTransaction->subMerchantKey); + } + if (isset($itemTransaction->subMerchantPrice)) { + $paymentItem->setSubMerchantPrice($itemTransaction->subMerchantPrice); + } + if (isset($itemTransaction->subMerchantPayoutRate)) { + $paymentItem->setSubMerchantPayoutRate($itemTransaction->subMerchantPayoutRate); + } + if (isset($itemTransaction->subMerchantPayoutAmount)) { + $paymentItem->setSubMerchantPayoutAmount($itemTransaction->subMerchantPayoutAmount); + } + if (isset($itemTransaction->merchantPayoutAmount)) { + $paymentItem->setMerchantPayoutAmount($itemTransaction->merchantPayoutAmount); + } + if (isset($itemTransaction->convertedPayout)) { + $paymentItem->setConvertedPayout($this->mapConvertedPayout($itemTransaction->convertedPayout)); + } + $paymentItems[$index] = $paymentItem; + } + return $paymentItems; + } + + public function mapConvertedPayout($payout) + { + $convertedPayout = new ConvertedPayout(); + + if (isset($payout->paidPrice)) { + $convertedPayout->setPaidPrice($payout->paidPrice); + } + if (isset($payout->iyziCommissionRateAmount)) { + $convertedPayout->setIyziCommissionRateAmount($payout->iyziCommissionRateAmount); + } + if (isset($payout->iyziCommissionFee)) { + $convertedPayout->setIyziCommissionFee($payout->iyziCommissionFee); + } + if (isset($payout->blockageRateAmountMerchant)) { + $convertedPayout->setBlockageRateAmountMerchant($payout->blockageRateAmountMerchant); + } + if (isset($payout->blockageRateAmountSubMerchant)) { + $convertedPayout->setBlockageRateAmountSubMerchant($payout->blockageRateAmountSubMerchant); + } + if (isset($payout->subMerchantPayoutAmount)) { + $convertedPayout->setSubMerchantPayoutAmount($payout->subMerchantPayoutAmount); + } + if (isset($payout->merchantPayoutAmount)) { + $convertedPayout->setMerchantPayoutAmount($payout->merchantPayoutAmount); + } + if (isset($payout->iyziConversionRate)) { + $convertedPayout->setIyziConversionRate($payout->iyziConversionRate); + } + if (isset($payout->iyziConversionRateAmount)) { + $convertedPayout->setIyziConversionRateAmount($payout->iyziConversionRateAmount); + } + if (isset($payout->currency)) { + $convertedPayout->setCurrency($payout->currency); + } + return $convertedPayout; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PayoutCompletedTransactionListMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PayoutCompletedTransactionListMapper.php new file mode 100644 index 0000000..8d3d48f --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PayoutCompletedTransactionListMapper.php @@ -0,0 +1,56 @@ +payoutCompletedTransactions)) { + $transactionList->setPayoutCompletedTransactions($this->mapPayoutCompletedTransactions($jsonObject->payoutCompletedTransactions)); + } + return $transactionList; + } + + public function mapPayoutCompletedTransactionList(PayoutCompletedTransactionList $transactionList) + { + return $this->mapPayoutCompletedTransactionListFrom($transactionList, $this->jsonObject); + } + + private function mapPayoutCompletedTransactions($payoutCompletedTransactions) + { + $transactions = array(); + + foreach ($payoutCompletedTransactions as $index => $payoutCompletedTransaction) { + $transaction = new PayoutCompletedTransaction(); + + if (isset($payoutCompletedTransaction->paymentTransactionId)) { + $transaction->setPaymentTransactionId($payoutCompletedTransaction->paymentTransactionId); + } + if (isset($payoutCompletedTransaction->payoutAmount)) { + $transaction->setPayoutAmount($payoutCompletedTransaction->payoutAmount); + } + if (isset($payoutCompletedTransaction->payoutType)) { + $transaction->setPayoutType($payoutCompletedTransaction->payoutType); + } + if (isset($payoutCompletedTransaction->subMerchantKey)) { + $transaction->setSubMerchantKey($payoutCompletedTransaction->subMerchantKey); + } + if (isset($payoutCompletedTransaction->currency)) { + $transaction->setCurrency($payoutCompletedTransaction->currency); + } + $transactions[$index] = $transaction; + } + return $transactions; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PeccoInitializeMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PeccoInitializeMapper.php new file mode 100644 index 0000000..4bdbfa6 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PeccoInitializeMapper.php @@ -0,0 +1,37 @@ +token)) { + $peccoInitialize->setToken($jsonObject->token); + } + if (isset($jsonObject->htmlContent)) { + $peccoInitialize->setHtmlContent($jsonObject->htmlContent); + } + if (isset($jsonObject->tokenExpireTime)) { + $peccoInitialize->setTokenExpireTime($jsonObject->tokenExpireTime); + } + if (isset($jsonObject->redirectUrl)) { + $peccoInitialize->setRedirectUrl($jsonObject->redirectUrl); + } + return $peccoInitialize; + } + + public function mapPeccoInitialize(PeccoInitialize $peccoInitialize) + { + return $this->mapPeccoInitializeFrom($peccoInitialize, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PeccoPaymentMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PeccoPaymentMapper.php new file mode 100644 index 0000000..ebc9ff6 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/PeccoPaymentMapper.php @@ -0,0 +1,28 @@ +token)) { + $payment->setToken($jsonObject->token); + } + return $payment; + } + + public function mapPeccoPayment(PeccoPayment $auth) + { + return $this->mapPeccoPaymentFrom($auth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/RefundChargedFromMerchantMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/RefundChargedFromMerchantMapper.php new file mode 100644 index 0000000..414c585 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/RefundChargedFromMerchantMapper.php @@ -0,0 +1,24 @@ +mapRefundChargedFromMerchantFrom($refund, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/RefundMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/RefundMapper.php new file mode 100644 index 0000000..1e4b1d0 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/RefundMapper.php @@ -0,0 +1,24 @@ +mapRefundFrom($refund, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/RefundResourceMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/RefundResourceMapper.php new file mode 100644 index 0000000..379631f --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/RefundResourceMapper.php @@ -0,0 +1,40 @@ +paymentId)) { + $refundResource->setPaymentId($jsonObject->paymentId); + } + if (isset($jsonObject->paymentTransactionId)) { + $refundResource->setPaymentTransactionId($jsonObject->paymentTransactionId); + } + if (isset($jsonObject->price)) { + $refundResource->setPrice($jsonObject->price); + } + if (isset($jsonObject->currency)) { + $refundResource->setCurrency($jsonObject->currency); + } + if (isset($jsonObject->connectorName)) { + $refundResource->setConnectorName($jsonObject->connectorName); + } + return $refundResource; + } + + public function mapRefundResource(RefundResource $refundResource) + { + return $this->mapRefundResourceFrom($refundResource, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/SubMerchantMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/SubMerchantMapper.php new file mode 100644 index 0000000..23cbe86 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/SubMerchantMapper.php @@ -0,0 +1,73 @@ +name)) { + $subMerchant->setName($jsonObject->name); + } + if (isset($jsonObject->email)) { + $subMerchant->setEmail($jsonObject->email); + } + if (isset($jsonObject->gsmNumber)) { + $subMerchant->setGsmNumber($jsonObject->gsmNumber); + } + if (isset($jsonObject->address)) { + $subMerchant->setAddress($jsonObject->address); + } + if (isset($jsonObject->iban)) { + $subMerchant->setIban($jsonObject->iban); + } + if (isset($jsonObject->taxOffice)) { + $subMerchant->setTaxOffice($jsonObject->taxOffice); + } + if (isset($jsonObject->contactName)) { + $subMerchant->setContactName($jsonObject->contactName); + } + if (isset($jsonObject->contactSurname)) { + $subMerchant->setContactSurname($jsonObject->contactSurname); + } + if (isset($jsonObject->legalCompanyTitle)) { + $subMerchant->setLegalCompanyTitle($jsonObject->legalCompanyTitle); + } + if (isset($jsonObject->subMerchantExternalId)) { + $subMerchant->setSubMerchantExternalId($jsonObject->subMerchantExternalId); + } + if (isset($jsonObject->identityNumber)) { + $subMerchant->setIdentityNumber($jsonObject->identityNumber); + } + if (isset($jsonObject->taxNumber)) { + $subMerchant->setTaxNumber($jsonObject->taxNumber); + } + if (isset($jsonObject->subMerchantType)) { + $subMerchant->setSubMerchantType($jsonObject->subMerchantType); + } + if (isset($jsonObject->subMerchantKey)) { + $subMerchant->setSubMerchantKey($jsonObject->subMerchantKey); + } + if (isset($jsonObject->swiftCode)) { + $subMerchant->setSwiftCode($jsonObject->swiftCode); + } + if (isset($jsonObject->currency)) { + $subMerchant->setCurrency($jsonObject->currency); + } + return $subMerchant; + } + + public function mapSubMerchant(SubMerchant $subMerchant) + { + return $this->mapSubMerchantFrom($subMerchant, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/ThreedsInitializeMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/ThreedsInitializeMapper.php new file mode 100644 index 0000000..23fc045 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/ThreedsInitializeMapper.php @@ -0,0 +1,28 @@ +threeDSHtmlContent)) { + $initialize->setHtmlContent(base64_decode($jsonObject->threeDSHtmlContent)); + } + return $initialize; + } + + public function mapThreedsInitialize(ThreedsInitialize $initialize) + { + return $this->mapThreedsInitializeFrom($initialize, $this->jsonObject); + } +} diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/ThreedsInitializePreAuthMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/ThreedsInitializePreAuthMapper.php new file mode 100644 index 0000000..e979f28 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/ThreedsInitializePreAuthMapper.php @@ -0,0 +1,28 @@ +threeDSHtmlContent)) { + $initializePreAuth->setHtmlContent(base64_decode($jsonObject->threeDSHtmlContent)); + } + return $initializePreAuth; + } + + public function mapThreedsInitializePreAuth(ThreedsInitializePreAuth $initializePreAuth) + { + return $this->mapThreedsInitializePreAuthFrom($initializePreAuth, $this->jsonObject); + } +} diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/ThreedsPaymentMapper.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/ThreedsPaymentMapper.php new file mode 100644 index 0000000..a7ecd6c --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Mapper/ThreedsPaymentMapper.php @@ -0,0 +1,24 @@ +mapThreedsPaymentFrom($auth, $this->jsonObject); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Payment.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Payment.php new file mode 100644 index 0000000..d2c855e --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Payment.php @@ -0,0 +1,23 @@ +post($options->getBaseUrl() . "/payment/auth", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PaymentMapper::create($rawResult)->jsonDecode()->mapPayment(new Payment()); + } + + public static function retrieve(RetrievePaymentRequest $request, Options $options) + { + $rawResult = parent::httpClient()->post($options->getBaseUrl() . "/payment/detail", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PaymentMapper::create($rawResult)->jsonDecode()->mapPayment(new Payment()); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Dto/PaymentCardDto.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PaymentCard.php similarity index 91% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Dto/PaymentCardDto.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PaymentCard.php index a90f3d2..bc431f1 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Dto/PaymentCardDto.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PaymentCard.php @@ -1,12 +1,12 @@ add("cardHolderName", $this->getCardHolderName()) ->add("cardNumber", $this->getCardNumber()) ->add("expireYear", $this->getExpireYear()) @@ -125,7 +125,7 @@ public function getJsonObject() public function toPKIRequestString() { - return PKIRequestStringBuilder::newInstance() + return RequestStringBuilder::create() ->append("cardHolderName", $this->getCardHolderName()) ->append("cardNumber", $this->getCardNumber()) ->append("expireYear", $this->getExpireYear()) diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Enumtype/PaymentChannelRequestType.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PaymentChannel.php similarity index 79% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Enumtype/PaymentChannelRequestType.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PaymentChannel.php index c7becd7..0f1241f 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Enumtype/PaymentChannelRequestType.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PaymentChannel.php @@ -1,8 +1,8 @@ merchantPayoutAmount = $merchantPayoutAmount; } + + public function getConvertedPayout() + { + return $this->convertedPayout; + } + + public function setConvertedPayout($convertedPayout) + { + $this->convertedPayout = $convertedPayout; + } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PaymentPostAuth.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PaymentPostAuth.php new file mode 100644 index 0000000..24b7f9a --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PaymentPostAuth.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/postauth", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PaymentPostAuthMapper::create($rawResult)->jsonDecode()->mapPaymentPostAuth(new PaymentPostAuth()); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PaymentPreAuth.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PaymentPreAuth.php new file mode 100644 index 0000000..a1639d1 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PaymentPreAuth.php @@ -0,0 +1,23 @@ +post($options->getBaseUrl() . "/payment/preauth", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PaymentPreAuthMapper::create($rawResult)->jsonDecode()->mapPaymentPreAuth(new PaymentPreAuth()); + } + + public static function retrieve(RetrievePaymentRequest $request, Options $options) + { + $rawResult = parent::httpClient()->post($options->getBaseUrl() . "/payment/detail", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PaymentPreAuthMapper::create($rawResult)->jsonDecode()->mapPaymentPreAuth(new PaymentPreAuth()); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentResponse.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PaymentResource.php similarity index 76% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentResponse.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PaymentResource.php index 3305604..a63e1b1 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentResponse.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PaymentResource.php @@ -1,16 +1,17 @@ installment = $installment; } + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + public function getPaymentId() { return $this->paymentId; @@ -65,6 +78,16 @@ public function setPaymentId($paymentId) $this->paymentId = $paymentId; } + public function getPaymentStatus() + { + return $this->paymentStatus; + } + + public function setPaymentStatus($paymentStatus) + { + $this->paymentStatus = $paymentStatus; + } + public function getFraudStatus() { return $this->fraudStatus; @@ -185,18 +208,33 @@ public function setBasketId($basketId) $this->basketId = $basketId; } - public function getItemTransactions() + public function getPaymentItems() + { + return $this->paymentItems; + } + + public function setPaymentItems($paymentItems) + { + $this->paymentItems = $paymentItems; + } + + public function getConnectorName() + { + return $this->connectorName; + } + + public function setConnectorName($connectorName) { - return $this->itemTransactions; + $this->connectorName = $connectorName; } - public function setItemTransactions($itemTransactions) + public function getAuthCode() { - $this->itemTransactions = $itemTransactions; + return $this->authCode; } - public function fromJson($jsonResult) + public function setAuthCode($authCode) { - EcomPaymentResponseMapper::newInstance()->mapResponse($this, $jsonResult); + $this->authCode = $authCode; } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Dto/PayoutCompletedTxDto.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PayoutCompletedTransaction.php similarity index 79% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Dto/PayoutCompletedTxDto.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PayoutCompletedTransaction.php index 7bc8bba..eed8cb5 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Dto/PayoutCompletedTxDto.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PayoutCompletedTransaction.php @@ -1,13 +1,14 @@ subMerchantKey = $subMerchantKey; } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PayoutCompletedTransactionList.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PayoutCompletedTransactionList.php new file mode 100644 index 0000000..ba6fb87 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PayoutCompletedTransactionList.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/reporting/settlement/payoutcompleted", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PayoutCompletedTransactionListMapper::create($rawResult)->jsonDecode()->mapPayoutCompletedTransactionList(new PayoutCompletedTransactionList()); + } + + public function getPayoutCompletedTransactions() + { + return $this->payoutCompletedTransactions; + } + + public function setPayoutCompletedTransactions($payoutCompletedTransactions) + { + $this->payoutCompletedTransactions = $payoutCompletedTransactions; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PeccoInitialize.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PeccoInitialize.php new file mode 100644 index 0000000..0ed6cbb --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PeccoInitialize.php @@ -0,0 +1,62 @@ +post($options->getBaseUrl() . "/payment/pecco/initialize", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PeccoInitializeMapper::create($rawResult)->jsonDecode()->mapPeccoInitialize(new PeccoInitialize()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } + + public function getRedirectUrl() + { + return $this->redirectUrl; + } + + public function setRedirectUrl($redirectUrl) + { + $this->redirectUrl = $redirectUrl; + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getTokenExpireTime() + { + return $this->tokenExpireTime; + } + + public function setTokenExpireTime($tokenExpireTime) + { + $this->tokenExpireTime = $tokenExpireTime; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PeccoPayment.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PeccoPayment.php new file mode 100644 index 0000000..e1f18ec --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/PeccoPayment.php @@ -0,0 +1,28 @@ +post($options->getBaseUrl() . "/payment/pecco/auth", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return PeccoPaymentMapper::create($rawResult)->jsonDecode()->mapPeccoPayment(new PeccoPayment()); + } + + public function getToken() + { + return $this->token; + } + + public function setToken($token) + { + $this->token = $token; + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Refund.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Refund.php new file mode 100644 index 0000000..fb9a7be --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Refund.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/refund", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return RefundMapper::create($rawResult)->jsonDecode()->mapRefund(new Refund()); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/RefundChargedFromMerchant.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/RefundChargedFromMerchant.php new file mode 100644 index 0000000..7713bb4 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/RefundChargedFromMerchant.php @@ -0,0 +1,16 @@ +post($options->getBaseUrl() . "/payment/iyzipos/refund/merchant/charge", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return RefundChargedFromMerchantMapper::create($rawResult)->jsonDecode()->mapRefundChargedFromMerchant(new RefundChargedFromMerchant()); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/PaymentRefundResponse.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/RefundResource.php similarity index 57% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/PaymentRefundResponse.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/RefundResource.php index 0be71dc..6616f30 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/PaymentRefundResponse.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/RefundResource.php @@ -1,15 +1,16 @@ price = $price; } - public function fromJson($jsonResult) + public function getCurrency() { - PaymentRefundResponseMapper::newInstance()->mapResponse($this, $jsonResult); + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getConnectorName() + { + return $this->connectorName; + } + + public function setConnectorName($connectorName) + { + $this->connectorName = $connectorName; } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/ResponseStatusType.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Status.php similarity index 58% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/ResponseStatusType.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Status.php index 74b031a..0616a17 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/ResponseStatusType.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/Status.php @@ -1,8 +1,8 @@ post($options->getBaseUrl() . "/onboarding/submerchant", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return SubMerchantMapper::create($rawResult)->jsonDecode()->mapSubMerchant(new SubMerchant()); + } + + public static function update(UpdateSubMerchantRequest $request, Options $options) + { + $rawResult = parent::httpClient()->put($options->getBaseUrl() . "/onboarding/submerchant", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return SubMerchantMapper::create($rawResult)->jsonDecode()->mapSubMerchant(new SubMerchant()); + } + + public static function retrieve(RetrieveSubMerchantRequest $request, Options $options) + { + $rawResult = parent::httpClient()->post($options->getBaseUrl() . "/onboarding/submerchant/detail", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return SubMerchantMapper::create($rawResult)->jsonDecode()->mapSubMerchant(new SubMerchant()); + } + public function getName() { return $this->name; @@ -72,6 +96,26 @@ public function setIban($iban) $this->iban = $iban; } + public function getSwiftCode() + { + return $this->swiftCode; + } + + public function setSwiftCode($swiftCode) + { + $this->swiftCode = $swiftCode; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + public function getTaxOffice() { return $this->taxOffice; @@ -161,9 +205,4 @@ public function setSubMerchantKey($subMerchantKey) { $this->subMerchantKey = $subMerchantKey; } - - public function fromJson($jsonResult) - { - RetrieveSubMerchantResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Enumtype/SubMerchantRequestType.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/SubMerchantType.php similarity index 67% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Enumtype/SubMerchantRequestType.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/SubMerchantType.php index ab14331..0240d30 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Enumtype/SubMerchantRequestType.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/SubMerchantType.php @@ -1,8 +1,8 @@ post($options->getBaseUrl() . "/payment/3dsecure/initialize", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return ThreedsInitializeMapper::create($rawResult)->jsonDecode()->mapThreedsInitialize(new ThreedsInitialize()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } +} diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/ThreedsInitializePreAuth.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/ThreedsInitializePreAuth.php new file mode 100644 index 0000000..c90321b --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/ThreedsInitializePreAuth.php @@ -0,0 +1,29 @@ +post($options->getBaseUrl() . "/payment/3dsecure/initialize/preauth", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return ThreedsInitializePreAuthMapper::create($rawResult)->jsonDecode()->mapThreedsInitializePreAuth(new ThreedsInitializePreAuth()); + } + + public function getHtmlContent() + { + return $this->htmlContent; + } + + public function setHtmlContent($htmlContent) + { + $this->htmlContent = $htmlContent; + } +} diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/ThreedsPayment.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/ThreedsPayment.php new file mode 100644 index 0000000..11260c7 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Model/ThreedsPayment.php @@ -0,0 +1,23 @@ +post($options->getBaseUrl() . "/payment/3dsecure/auth", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return ThreedsPaymentMapper::create($rawResult)->jsonDecode()->mapThreedsPayment(new ThreedsPayment()); + } + + public static function retrieve(RetrievePaymentRequest $request, Options $options) + { + $rawResult = parent::httpClient()->post($options->getBaseUrl() . "/payment/detail", parent::getHttpHeaders($request, $options), $request->toJsonString()); + return ThreedsPaymentMapper::create($rawResult)->jsonDecode()->mapThreedsPayment(new ThreedsPayment()); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Configuration/ClientConfiguration.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Options.php similarity index 89% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Configuration/ClientConfiguration.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Options.php index 7698bc2..33ff578 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Configuration/ClientConfiguration.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Options.php @@ -1,8 +1,8 @@ add("locale", $this->getLocale()) ->add("conversationId", $this->getConversationId()) ->getObject(); @@ -37,7 +37,7 @@ public function getJsonObject() public function toPKIRequestString() { - return PKIRequestStringBuilder::newInstance() + return RequestStringBuilder::create() ->append("locale", $this->getLocale()) ->append("conversationId", $this->getConversationId()) ->getRequestString(); diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Approval/Request/ApprovalRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateApprovalRequest.php similarity index 75% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Approval/Request/ApprovalRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateApprovalRequest.php index 2ce80b3..81aa3dc 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Approval/Request/ApprovalRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateApprovalRequest.php @@ -1,12 +1,12 @@ appendSuper(parent::toPKIRequestString()) ->append("paymentTransactionId", $this->getPaymentTransactionId()) ->getRequestString(); diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateBasicBkmInitializeRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateBasicBkmInitializeRequest.php new file mode 100644 index 0000000..0584f37 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateBasicBkmInitializeRequest.php @@ -0,0 +1,128 @@ +connectorName; + } + + public function setConnectorName($connectorName) + { + $this->connectorName = $connectorName; + } + + public function getPrice() + { + return $this->price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getBuyerEmail() + { + return $this->buyerEmail; + } + + public function setBuyerEmail($buyerEmail) + { + $this->buyerEmail = $buyerEmail; + } + + public function getBuyerId() + { + return $this->buyerId; + } + + public function setBuyerId($buyerId) + { + $this->buyerId = $buyerId; + } + + public function getBuyerIp() + { + return $this->buyerIp; + } + + public function setBuyerIp($buyerIp) + { + $this->buyerIp = $buyerIp; + } + + public function getPosOrderId() + { + return $this->posOrderId; + } + + public function setPosOrderId($posOrderId) + { + $this->posOrderId = $posOrderId; + } + + public function getInstallmentDetails() + { + return $this->installmentDetails; + } + + public function setInstallmentDetails($installmentDetails) + { + $this->installmentDetails = $installmentDetails; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("connectorName", $this->getConnectorName()) + ->addPrice("price", $this->getPrice()) + ->add("callbackUrl", $this->getCallbackUrl()) + ->add("buyerEmail", $this->getBuyerEmail()) + ->add("buyerId", $this->getBuyerId()) + ->add("buyerIp", $this->getBuyerIp()) + ->add("posOrderId", $this->getPosOrderId()) + ->addArray("installmentDetails", $this->getInstallmentDetails()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("connectorName", $this->getConnectorName()) + ->appendPrice("price", $this->getPrice()) + ->append("callbackUrl", $this->getCallbackUrl()) + ->append("buyerEmail", $this->getBuyerEmail()) + ->append("buyerId", $this->getBuyerId()) + ->append("buyerIp", $this->getBuyerIp()) + ->append("posOrderId", $this->getPosOrderId()) + ->appendArray("installmentDetails", $this->getInstallmentDetails()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/PaymentRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateBasicPaymentRequest.php similarity index 59% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/PaymentRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateBasicPaymentRequest.php index 815f97e..80544ec 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/PaymentRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateBasicPaymentRequest.php @@ -1,20 +1,31 @@ setInstallment(CreateBasicPaymentRequest::SINGLE_INSTALLMENT); + } public function getPrice() { @@ -51,19 +62,16 @@ public function getBuyerEmail() return $this->buyerEmail; } - public function setBuyerEmail($buyerEmail) { $this->buyerEmail = $buyerEmail; } - public function getBuyerId() { return $this->buyerId; } - public function setBuyerId($buyerId) { $this->buyerId = $buyerId; @@ -79,6 +87,16 @@ public function setBuyerIp($buyerIp) $this->buyerIp = $buyerIp; } + public function getPosOrderId() + { + return $this->posOrderId; + } + + public function setPosOrderId($posOrderId) + { + $this->posOrderId = $posOrderId; + } + public function getPaymentCard() { return $this->paymentCard; @@ -89,6 +107,36 @@ public function setPaymentCard($paymentCard) $this->paymentCard = $paymentCard; } + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getConnectorName() + { + return $this->connectorName; + } + + public function setConnectorName($connectorName) + { + $this->connectorName = $connectorName; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + public function getJsonObject() { return JsonBuilder::fromJsonObject(parent::getJsonObject()) @@ -98,13 +146,17 @@ public function getJsonObject() ->add("buyerEmail", $this->getBuyerEmail()) ->add("buyerId", $this->getBuyerId()) ->add("buyerIp", $this->getBuyerIp()) + ->add("posOrderId", $this->getPosOrderId()) ->add("paymentCard", $this->getPaymentCard()) + ->add("currency", $this->getCurrency()) + ->add("connectorName", $this->getConnectorName()) + ->add("callbackUrl", $this->getCallbackUrl()) ->getObject(); } public function toPKIRequestString() { - return PKIRequestStringBuilder::newInstance() + return RequestStringBuilder::create() ->appendSuper(parent::toPKIRequestString()) ->appendPrice("price", $this->getPrice()) ->appendPrice("paidPrice", $this->getPaidPrice()) @@ -112,7 +164,11 @@ public function toPKIRequestString() ->append("buyerEmail", $this->getBuyerEmail()) ->append("buyerId", $this->getBuyerId()) ->append("buyerIp", $this->getBuyerIp()) + ->append("posOrderId", $this->getPosOrderId()) ->append("paymentCard", $this->getPaymentCard()) + ->append("currency", $this->getCurrency()) + ->append("connectorName", $this->getConnectorName()) + ->append("callbackUrl", $this->getCallbackUrl()) ->getRequestString(); } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomPaymentBKMInitializeRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateBkmInitializeRequest.php similarity index 83% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomPaymentBKMInitializeRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateBkmInitializeRequest.php index e6b3132..291e4f7 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomPaymentBKMInitializeRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateBkmInitializeRequest.php @@ -1,12 +1,12 @@ callbackUrl = $callbackUrl; } + public function getPaymentSource() + { + return $this->paymentSource; + } + + public function setPaymentSource($paymentSource) + { + $this->paymentSource = $paymentSource; + } + public function getJsonObject() { return JsonBuilder::fromJsonObject(parent::getJsonObject()) @@ -108,12 +119,13 @@ public function getJsonObject() ->add("billingAddress", $this->getBillingAddress()) ->addArray("basketItems", $this->getBasketItems()) ->add("callbackUrl", $this->getCallbackUrl()) + ->add("paymentSource", $this->getPaymentSource()) ->getObject(); } public function toPKIRequestString() { - return PKIRequestStringBuilder::newInstance() + return RequestStringBuilder::create() ->appendSuper(parent::toPKIRequestString()) ->appendPrice("price", $this->getPrice()) ->append("basketId", $this->getBasketId()) @@ -123,6 +135,7 @@ public function toPKIRequestString() ->append("billingAddress", $this->getBillingAddress()) ->appendArray("basketItems", $this->getBasketItems()) ->append("callbackUrl", $this->getCallbackUrl()) + ->append("paymentSource", $this->getPaymentSource()) ->getRequestString(); } -} \ No newline at end of file +} diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/PaymentCancelRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateCancelRequest.php similarity index 77% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/PaymentCancelRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateCancelRequest.php index d30da29..e0f2ffe 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/PaymentCancelRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateCancelRequest.php @@ -1,34 +1,34 @@ paymentId; + return $this->ip; } - public function setPaymentId($paymentId) + public function setIp($ip) { - $this->paymentId = $paymentId; + $this->ip = $ip; } - public function getIp() + public function getPaymentId() { - return $this->ip; + return $this->paymentId; } - public function setIp($ip) + public function setPaymentId($paymentId) { - $this->ip = $ip; + $this->paymentId = $paymentId; } public function getJsonObject() @@ -41,10 +41,10 @@ public function getJsonObject() public function toPKIRequestString() { - return PKIRequestStringBuilder::newInstance() + return RequestStringBuilder::create() ->appendSuper(parent::toPKIRequestString()) ->append("paymentId", $this->getPaymentId()) ->append("ip", $this->getIp()) ->getRequestString(); } -} \ No newline at end of file +} diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Request/CreateCardRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateCardRequest.php similarity index 88% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Request/CreateCardRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateCardRequest.php index aa0e0fc..a941ad1 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Request/CreateCardRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateCardRequest.php @@ -1,10 +1,10 @@ appendSuper(parent::toPKIRequestString()) ->append("externalId", $this->getExternalId()) ->append("email", $this->getEmail()) diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateCheckoutFormInitializeRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateCheckoutFormInitializeRequest.php new file mode 100644 index 0000000..5d64e62 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateCheckoutFormInitializeRequest.php @@ -0,0 +1,219 @@ +price; + } + + public function setPrice($price) + { + $this->price = $price; + } + + public function getPaidPrice() + { + return $this->paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getBasketId() + { + return $this->basketId; + } + + public function setBasketId($basketId) + { + $this->basketId = $basketId; + } + + public function getPaymentGroup() + { + return $this->paymentGroup; + } + + public function setPaymentGroup($paymentGroup) + { + $this->paymentGroup = $paymentGroup; + } + + public function getPaymentSource() + { + return $this->paymentSource; + } + + public function setPaymentSource($paymentSource) + { + $this->paymentSource = $paymentSource; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getBuyer() + { + return $this->buyer; + } + + public function setBuyer($buyer) + { + $this->buyer = $buyer; + } + + public function getShippingAddress() + { + return $this->shippingAddress; + } + + public function setShippingAddress($shippingAddress) + { + $this->shippingAddress = $shippingAddress; + } + + public function getBillingAddress() + { + return $this->billingAddress; + } + + public function setBillingAddress($billingAddress) + { + $this->billingAddress = $billingAddress; + } + + public function getBasketItems() + { + return $this->basketItems; + } + + public function setBasketItems($basketItems) + { + $this->basketItems = $basketItems; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + + public function getForceThreeDS() + { + return $this->forceThreeDS; + } + + public function setForceThreeDS($forceThreeDS) + { + $this->forceThreeDS = $forceThreeDS; + } + + public function getCardUserKey() + { + return $this->cardUserKey; + } + + public function setCardUserKey($cardUserKey) + { + $this->cardUserKey = $cardUserKey; + } + + public function getPosOrderId() + { + return $this->posOrderId; + } + + public function setPosOrderId($posOrderId) + { + $this->posOrderId = $posOrderId; + } + + public function setEnabledInstallments($enabledInstallments) + { + $this->enabledInstallments = $enabledInstallments; + } + + public function getEnabledInstallments() + { + return $this->enabledInstallments; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->addPrice("price", $this->getPrice()) + ->add("basketId", $this->getBasketId()) + ->add("paymentGroup", $this->getPaymentGroup()) + ->add("buyer", $this->getBuyer()) + ->add("shippingAddress", $this->getShippingAddress()) + ->add("billingAddress", $this->getBillingAddress()) + ->addArray("basketItems", $this->getBasketItems()) + ->add("callbackUrl", $this->getCallbackUrl()) + ->add("paymentSource", $this->getPaymentSource()) + ->add("currency", $this->getCurrency()) + ->add("posOrderId", $this->getPosOrderId()) + ->addPrice("paidPrice", $this->getPaidPrice()) + ->add("forceThreeDS", $this->getForceThreeDS()) + ->add("cardUserKey", $this->getCardUserKey()) + ->addArray("enabledInstallments", $this->getEnabledInstallments()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->appendPrice("price", $this->getPrice()) + ->append("basketId", $this->getBasketId()) + ->append("paymentGroup", $this->getPaymentGroup()) + ->append("buyer", $this->getBuyer()) + ->append("shippingAddress", $this->getShippingAddress()) + ->append("billingAddress", $this->getBillingAddress()) + ->appendArray("basketItems", $this->getBasketItems()) + ->append("callbackUrl", $this->getCallbackUrl()) + ->append("paymentSource", $this->getPaymentSource()) + ->append("currency", $this->getCurrency()) + ->append("posOrderId", $this->getPosOrderId()) + ->appendPrice("paidPrice", $this->getPaidPrice()) + ->append("forceThreeDS", $this->getForceThreeDS()) + ->append("cardUserKey", $this->getCardUserKey()) + ->appendArray("enabledInstallments", $this->getEnabledInstallments()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/CrossBooking/Request/CrossBookingRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateCrossBookingRequest.php similarity index 70% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/CrossBooking/Request/CrossBookingRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateCrossBookingRequest.php index e0a91e6..da0dedb 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/CrossBooking/Request/CrossBookingRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateCrossBookingRequest.php @@ -1,16 +1,17 @@ reason = $reason; } + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + public function getJsonObject() { return JsonBuilder::fromJsonObject(parent::getJsonObject()) ->add("subMerchantKey", $this->getSubMerchantKey()) ->addPrice("price", $this->getPrice()) ->add("reason", $this->getReason()) + ->add("currency", $this->getCurrency()) ->getObject(); } public function toPKIRequestString() { - return PKIRequestStringBuilder::newInstance() + return RequestStringBuilder::create() ->appendSuper(parent::toPKIRequestString()) ->append("subMerchantKey", $this->getSubMerchantKey()) ->appendPrice("price", $this->getPrice()) ->append("reason", $this->getReason()) + ->append("currency", $this->getCurrency()) ->getRequestString(); } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreatePaymentPostAuthRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreatePaymentPostAuthRequest.php new file mode 100644 index 0000000..4f7405a --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreatePaymentPostAuthRequest.php @@ -0,0 +1,76 @@ +paymentId; + } + + public function setPaymentId($paymentId) + { + $this->paymentId = $paymentId; + } + + public function getPaidPrice() + { + return $this->paidPrice; + } + + public function setPaidPrice($paidPrice) + { + $this->paidPrice = $paidPrice; + } + + public function getIp() + { + return $this->ip; + } + + public function setIp($ip) + { + $this->ip = $ip; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("paymentId", $this->getPaymentId()) + ->add("ip", $this->getIp()) + ->addPrice("paidPrice", $this->getPaidPrice()) + ->add("currency", $this->getCurrency()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("paymentId", $this->getPaymentId()) + ->append("ip", $this->getIp()) + ->appendPrice("paidPrice", $this->getPaidPrice()) + ->append("currency", $this->getCurrency()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomPaymentRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreatePaymentRequest.php similarity index 72% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomPaymentRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreatePaymentRequest.php index 3ccea36..db66acb 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomPaymentRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreatePaymentRequest.php @@ -1,25 +1,36 @@ setInstallment(CreatePaymentRequest::SINGLE_INSTALLMENT); + } public function getPrice() { @@ -81,16 +92,6 @@ public function setPaymentGroup($paymentGroup) $this->paymentGroup = $paymentGroup; } - public function getPaymentSource() - { - return $this->paymentSource; - } - - public function setPaymentSource($paymentSource) - { - $this->paymentSource = $paymentSource; - } - public function getPaymentCard() { return $this->paymentCard; @@ -141,6 +142,56 @@ public function setBasketItems($basketItems) $this->basketItems = $basketItems; } + public function getPaymentSource() + { + return $this->paymentSource; + } + + public function setPaymentSource($paymentSource) + { + $this->paymentSource = $paymentSource; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getPosOrderId() + { + return $this->posOrderId; + } + + public function setPosOrderId($posOrderId) + { + $this->posOrderId = $posOrderId; + } + + public function getConnectorName() + { + return $this->connectorName; + } + + public function setConnectorName($connectorName) + { + $this->connectorName = $connectorName; + } + + public function getCallbackUrl() + { + return $this->callbackUrl; + } + + public function setCallbackUrl($callbackUrl) + { + $this->callbackUrl = $callbackUrl; + } + public function getJsonObject() { return JsonBuilder::fromJsonObject(parent::getJsonObject()) @@ -156,12 +207,16 @@ public function getJsonObject() ->add("billingAddress", $this->getBillingAddress()) ->addArray("basketItems", $this->getBasketItems()) ->add("paymentSource", $this->getPaymentSource()) + ->add("currency", $this->getCurrency()) + ->add("posOrderId", $this->getPosOrderId()) + ->add("connectorName", $this->getConnectorName()) + ->add("callbackUrl", $this->getCallbackUrl()) ->getObject(); } public function toPKIRequestString() { - return PKIRequestStringBuilder::newInstance() + return RequestStringBuilder::create() ->appendSuper(parent::toPKIRequestString()) ->appendPrice("price", $this->getPrice()) ->appendPrice("paidPrice", $this->getPaidPrice()) @@ -175,6 +230,10 @@ public function toPKIRequestString() ->append("billingAddress", $this->getBillingAddress()) ->appendArray("basketItems", $this->getBasketItems()) ->append("paymentSource", $this->getPaymentSource()) + ->append("currency", $this->getCurrency()) + ->append("posOrderId", $this->getPosOrderId()) + ->append("connectorName", $this->getConnectorName()) + ->append("callbackUrl", $this->getCallbackUrl()) ->getRequestString(); } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomPaymentCheckoutFormInitializeRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreatePeccoInitializeRequest.php similarity index 87% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomPaymentCheckoutFormInitializeRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreatePeccoInitializeRequest.php index bfcf126..581dd6c 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomPaymentCheckoutFormInitializeRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreatePeccoInitializeRequest.php @@ -1,42 +1,43 @@ paidPrice; + return $this->price; } - public function setPaidPrice($paidPrice) + public function setPrice($price) { - $this->paidPrice = $paidPrice; + $this->price = $price; } - private $callbackUrl; - public function getPrice() + public function getPaidPrice() { - return $this->price; + return $this->paidPrice; } - public function setPrice($price) + public function setPaidPrice($paidPrice) { - $this->price = $price; + $this->paidPrice = $paidPrice; } public function getBasketId() @@ -69,6 +70,16 @@ public function setPaymentSource($paymentSource) $this->paymentSource = $paymentSource; } + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + public function getBuyer() { return $this->buyer; @@ -131,13 +142,14 @@ public function getJsonObject() ->addArray("basketItems", $this->getBasketItems()) ->add("callbackUrl", $this->getCallbackUrl()) ->add("paymentSource", $this->getPaymentSource()) + ->add("currency", $this->getCurrency()) ->addPrice("paidPrice", $this->getPaidPrice()) ->getObject(); } public function toPKIRequestString() { - return PKIRequestStringBuilder::newInstance() + return RequestStringBuilder::create() ->appendSuper(parent::toPKIRequestString()) ->appendPrice("price", $this->getPrice()) ->append("basketId", $this->getBasketId()) @@ -148,6 +160,7 @@ public function toPKIRequestString() ->appendArray("basketItems", $this->getBasketItems()) ->append("callbackUrl", $this->getCallbackUrl()) ->append("paymentSource", $this->getPaymentSource()) + ->append("currency", $this->getCurrency()) ->appendPrice("paidPrice", $this->getPaidPrice()) ->getRequestString(); } diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomRetrievePaymentBKMAuthRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreatePeccoPaymentRequest.php similarity index 69% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomRetrievePaymentBKMAuthRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreatePeccoPaymentRequest.php index 49284cb..06c5429 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomRetrievePaymentBKMAuthRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreatePeccoPaymentRequest.php @@ -1,12 +1,12 @@ appendSuper(parent::toPKIRequestString()) ->append("token", $this->getToken()) ->getRequestString(); } - } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/PaymentRefundRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateRefundRequest.php similarity index 71% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/PaymentRefundRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateRefundRequest.php index 73c8f5b..ef0900f 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/PaymentRefundRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateRefundRequest.php @@ -1,16 +1,17 @@ ip = $ip; } + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + public function getJsonObject() { return JsonBuilder::fromJsonObject(parent::getJsonObject()) ->add("paymentTransactionId", $this->getPaymentTransactionId()) ->addPrice("price", $this->getPrice()) ->add("ip", $this->getIp()) + ->add("currency", $this->getCurrency()) ->getObject(); } public function toPKIRequestString() { - return PKIRequestStringBuilder::newInstance() + return RequestStringBuilder::create() ->appendSuper(parent::toPKIRequestString()) ->append("paymentTransactionId", $this->getPaymentTransactionId()) ->appendPrice("price", $this->getPrice()) ->append("ip", $this->getIp()) + ->append("currency", $this->getCurrency()) ->getRequestString(); } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateSubMerchantRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateSubMerchantRequest.php new file mode 100644 index 0000000..c5de983 --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateSubMerchantRequest.php @@ -0,0 +1,219 @@ +name; + } + + public function setName($name) + { + $this->name = $name; + } + + public function getEmail() + { + return $this->email; + } + + public function setEmail($email) + { + $this->email = $email; + } + + public function getGsmNumber() + { + return $this->gsmNumber; + } + + public function setGsmNumber($gsmNumber) + { + $this->gsmNumber = $gsmNumber; + } + + public function getAddress() + { + return $this->address; + } + + public function setAddress($address) + { + $this->address = $address; + } + + public function getIban() + { + return $this->iban; + } + + public function setIban($iban) + { + $this->iban = $iban; + } + + public function getTaxOffice() + { + return $this->taxOffice; + } + + public function setTaxOffice($taxOffice) + { + $this->taxOffice = $taxOffice; + } + + public function getContactName() + { + return $this->contactName; + } + + public function setContactName($contactName) + { + $this->contactName = $contactName; + } + + public function getContactSurname() + { + return $this->contactSurname; + } + + public function setContactSurname($contactSurname) + { + $this->contactSurname = $contactSurname; + } + + public function getLegalCompanyTitle() + { + return $this->legalCompanyTitle; + } + + public function setLegalCompanyTitle($legalCompanyTitle) + { + $this->legalCompanyTitle = $legalCompanyTitle; + } + + public function getSubMerchantExternalId() + { + return $this->subMerchantExternalId; + } + + public function setSubMerchantExternalId($subMerchantExternalId) + { + $this->subMerchantExternalId = $subMerchantExternalId; + } + + public function getIdentityNumber() + { + return $this->identityNumber; + } + + public function setIdentityNumber($identityNumber) + { + $this->identityNumber = $identityNumber; + } + + public function getTaxNumber() + { + return $this->taxNumber; + } + + public function setTaxNumber($taxNumber) + { + $this->taxNumber = $taxNumber; + } + + public function getSubMerchantType() + { + return $this->subMerchantType; + } + + public function setSubMerchantType($subMerchantType) + { + $this->subMerchantType = $subMerchantType; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getSwiftCode() + { + return $this->swiftCode; + } + + public function setSwiftCode($swiftCode) + { + $this->swiftCode = $swiftCode; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("name", $this->getName()) + ->add("email", $this->getEmail()) + ->add("gsmNumber", $this->getGsmNumber()) + ->add("address", $this->getAddress()) + ->add("iban", $this->getIban()) + ->add("taxOffice", $this->getTaxOffice()) + ->add("contactName", $this->getContactName()) + ->add("contactSurname", $this->getContactSurname()) + ->add("legalCompanyTitle", $this->getLegalCompanyTitle()) + ->add("swiftCode", $this->getSwiftCode()) + ->add("currency", $this->getCurrency()) + ->add("subMerchantExternalId", $this->getSubMerchantExternalId()) + ->add("identityNumber", $this->getIdentityNumber()) + ->add("taxNumber", $this->getTaxNumber()) + ->add("subMerchantType", $this->getSubMerchantType()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("name", $this->getName()) + ->append("email", $this->getEmail()) + ->append("gsmNumber", $this->getGsmNumber()) + ->append("address", $this->getAddress()) + ->append("iban", $this->getIban()) + ->append("taxOffice", $this->getTaxOffice()) + ->append("contactName", $this->getContactName()) + ->append("contactSurname", $this->getContactSurname()) + ->append("legalCompanyTitle", $this->getLegalCompanyTitle()) + ->append("swiftCode", $this->getSwiftCode()) + ->append("currency", $this->getCurrency()) + ->append("subMerchantExternalId", $this->getSubMerchantExternalId()) + ->append("identityNumber", $this->getIdentityNumber()) + ->append("taxNumber", $this->getTaxNumber()) + ->append("subMerchantType", $this->getSubMerchantType()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/PaymentThreeDSRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateThreedsPaymentRequest.php similarity index 80% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/PaymentThreeDSRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateThreedsPaymentRequest.php index ca6b228..4e920de 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/PaymentThreeDSRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/CreateThreedsPaymentRequest.php @@ -1,12 +1,12 @@ appendSuper(parent::toPKIRequestString()) ->append("paymentId", $this->getPaymentId()) ->append("conversationData", $this->getConversationData()) diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Request/DeleteCardRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/DeleteCardRequest.php similarity index 82% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Request/DeleteCardRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/DeleteCardRequest.php index d47f2d4..8dabd73 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Request/DeleteCardRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/DeleteCardRequest.php @@ -1,10 +1,10 @@ appendSuper(parent::toPKIRequestString()) ->append("cardUserKey", $this->getCardUserKey()) ->append("cardToken", $this->getCardToken()) diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Bin/Request/BinCheckRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveBinNumberRequest.php similarity index 71% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Bin/Request/BinCheckRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveBinNumberRequest.php index 73d1aeb..b3db568 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Bin/Request/BinCheckRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveBinNumberRequest.php @@ -1,12 +1,12 @@ appendSuper(parent::toPKIRequestString()) ->append("binNumber", $this->getBinNumber()) ->getRequestString(); diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomRetrievePaymentCheckoutFormAuthRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveBkmRequest.php similarity index 67% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomRetrievePaymentCheckoutFormAuthRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveBkmRequest.php index b6a7a0a..94c1b8c 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomRetrievePaymentCheckoutFormAuthRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveBkmRequest.php @@ -1,12 +1,12 @@ appendSuper(parent::toPKIRequestString()) ->append("token", $this->getToken()) ->getRequestString(); diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Request/RetrieveCardListRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveCardListRequest.php similarity index 76% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Request/RetrieveCardListRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveCardListRequest.php index c536c8b..d1fc231 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Request/RetrieveCardListRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveCardListRequest.php @@ -1,10 +1,10 @@ appendSuper(parent::toPKIRequestString()) ->append("cardUserKey", $this->getCardUserKey()) ->getRequestString(); diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveCheckoutFormRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveCheckoutFormRequest.php new file mode 100644 index 0000000..d62681f --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveCheckoutFormRequest.php @@ -0,0 +1,37 @@ +token; + } + + public function setToken($token) + { + $this->token = $token; + } + + public function getJsonObject() + { + return JsonBuilder::fromJsonObject(parent::getJsonObject()) + ->add("token", $this->getToken()) + ->getObject(); + } + + public function toPKIRequestString() + { + return RequestStringBuilder::create() + ->appendSuper(parent::toPKIRequestString()) + ->append("token", $this->getToken()) + ->getRequestString(); + } +} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Installment/Request/InstallmentInfoRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveInstallmentInfoRequest.php similarity index 77% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Installment/Request/InstallmentInfoRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveInstallmentInfoRequest.php index b1ce549..e9e42f6 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Installment/Request/InstallmentInfoRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveInstallmentInfoRequest.php @@ -1,12 +1,12 @@ appendSuper(parent::toPKIRequestString()) ->append("binNumber", $this->getBinNumber()) ->appendPrice("price", $this->getPrice()) diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/PaymentPostAuthRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrievePaymentRequest.php similarity index 50% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/PaymentPostAuthRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrievePaymentRequest.php index dfef23f..e5982fd 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/PaymentPostAuthRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrievePaymentRequest.php @@ -1,15 +1,15 @@ paymentId = $paymentId; } - public function getIp() + public function getPaymentConversationId() { - return $this->ip; + return $this->paymentConversationId; } - public function setIp($ip) + public function setPaymentConversationId($paymentConversationId) { - $this->ip = $ip; + $this->paymentConversationId = $paymentConversationId; } public function getJsonObject() { return JsonBuilder::fromJsonObject(parent::getJsonObject()) ->add("paymentId", $this->getPaymentId()) - ->add("ip", $this->getIp()) + ->add("paymentConversationId", $this->getPaymentConversationId()) ->getObject(); } public function toPKIRequestString() { - return PKIRequestStringBuilder::newInstance() + return RequestStringBuilder::create() ->appendSuper(parent::toPKIRequestString()) ->append("paymentId", $this->getPaymentId()) - ->append("ip", $this->getIp()) + ->append("paymentConversationId", $this->getPaymentConversationId()) ->getRequestString(); } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Request/RetrieveSubMerchantRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveSubMerchantRequest.php similarity index 79% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Request/RetrieveSubMerchantRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveSubMerchantRequest.php index 7f247ca..c71a9d6 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Request/RetrieveSubMerchantRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveSubMerchantRequest.php @@ -1,10 +1,10 @@ appendSuper(parent::toPKIRequestString()) ->append("subMerchantExternalId", $this->getSubMerchantExternalId()) ->getRequestString(); diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Request/BouncedRowRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveTransactionsRequest.php similarity index 69% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Request/BouncedRowRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveTransactionsRequest.php index 3ce8413..1b71289 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Request/BouncedRowRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/RetrieveTransactionsRequest.php @@ -1,12 +1,12 @@ appendSuper(parent::toPKIRequestString()) ->append("date", $this->getDate()) ->getRequestString(); diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Request/SubMerchantRequest.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/UpdateSubMerchantRequest.php similarity index 62% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Request/SubMerchantRequest.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/UpdateSubMerchantRequest.php index 6d559cf..7e5eb47 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Request/SubMerchantRequest.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/Request/UpdateSubMerchantRequest.php @@ -1,12 +1,12 @@ legalCompanyTitle = $legalCompanyTitle; } + public function getSubMerchantKey() + { + return $this->subMerchantKey; + } + + public function setSubMerchantKey($subMerchantKey) + { + $this->subMerchantKey = $subMerchantKey; + } + + public function getIdentityNumber() + { + return $this->identityNumber; + } + + public function setIdentityNumber($identityNumber) + { + $this->identityNumber = $identityNumber; + } + + public function getTaxNumber() + { + return $this->taxNumber; + } + + public function setTaxNumber($taxNumber) + { + $this->taxNumber = $taxNumber; + } + + public function getCurrency() + { + return $this->currency; + } + + public function setCurrency($currency) + { + $this->currency = $currency; + } + + public function getSwiftCode() + { + return $this->swiftCode; + } + + public function setSwiftCode($swiftCode) + { + $this->swiftCode = $swiftCode; + } + public function getJsonObject() { return JsonBuilder::fromJsonObject(parent::getJsonObject()) @@ -120,12 +175,17 @@ public function getJsonObject() ->add("contactName", $this->getContactName()) ->add("contactSurname", $this->getContactSurname()) ->add("legalCompanyTitle", $this->getLegalCompanyTitle()) + ->add("swiftCode", $this->getSwiftCode()) + ->add("currency", $this->getCurrency()) + ->add("subMerchantKey", $this->getSubMerchantKey()) + ->add("identityNumber", $this->getIdentityNumber()) + ->add("taxNumber", $this->getTaxNumber()) ->getObject(); } public function toPKIRequestString() { - return PKIRequestStringBuilder::newInstance() + return RequestStringBuilder::create() ->appendSuper(parent::toPKIRequestString()) ->append("name", $this->getName()) ->append("email", $this->getEmail()) @@ -136,6 +196,11 @@ public function toPKIRequestString() ->append("contactName", $this->getContactName()) ->append("contactSurname", $this->getContactSurname()) ->append("legalCompanyTitle", $this->getLegalCompanyTitle()) + ->append("swiftCode", $this->getSwiftCode()) + ->append("currency", $this->getCurrency()) + ->append("subMerchantKey", $this->getSubMerchantKey()) + ->append("identityNumber", $this->getIdentityNumber()) + ->append("taxNumber", $this->getTaxNumber()) ->getRequestString(); } } \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/RequestFormatter.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/RequestFormatter.php similarity index 96% rename from Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/RequestFormatter.php rename to Payments/iyzico/upload/system/iyzico/src/Iyzipay/RequestFormatter.php index 0fb8d9b..ac13123 100644 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/RequestFormatter.php +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/RequestFormatter.php @@ -1,6 +1,6 @@ requestString = $requestString; } - public static function newInstance() + public static function create() { - return new PKIRequestStringBuilder(""); - } - - public static function fromRequestString($requestString) - { - return new PKIRequestStringBuilder($requestString); + return new RequestStringBuilder(""); } /** * @param $superRequestString - * @return PKIRequestStringBuilder + * @return RequestStringBuilder */ public function appendSuper($superRequestString) { @@ -41,12 +36,12 @@ public function appendSuper($superRequestString) /** * @param $key * @param $value - * @return PKIRequestStringBuilder + * @return RequestStringBuilder */ public function append($key, $value = null) { if (isset($value)) { - if ($value instanceof PKIRequestStringConvertible) { + if ($value instanceof RequestStringConvertible) { $this->appendKeyValue($key, $value->toPKIRequestString()); } else { $this->appendKeyValue($key, $value); @@ -58,7 +53,7 @@ public function append($key, $value = null) /** * @param $key * @param $value - * @return PKIRequestStringBuilder + * @return RequestStringBuilder */ public function appendPrice($key, $value = null) { @@ -71,14 +66,14 @@ public function appendPrice($key, $value = null) /** * @param $key * @param array $array - * @return PKIRequestStringBuilder + * @return RequestStringBuilder */ public function appendArray($key, array $array = null) { if (isset($array)) { $appendedValue = ""; foreach ($array as $value) { - if ($value instanceof PKIRequestStringConvertible) { + if ($value instanceof RequestStringConvertible) { $appendedValue = $appendedValue . $value->toPKIRequestString(); } else { $appendedValue = $appendedValue . $value; @@ -93,7 +88,7 @@ public function appendArray($key, array $array = null) /** * @param $key * @param $value - * @return PKIRequestStringBuilder + * @return RequestStringBuilder */ private function appendKeyValue($key, $value) { @@ -106,7 +101,7 @@ private function appendKeyValue($key, $value) /** * @param $key * @param $value - * @return PKIRequestStringBuilder + * @return RequestStringBuilder */ private function appendKeyValueArray($key, $value) { @@ -118,7 +113,7 @@ private function appendKeyValueArray($key, $value) } /** - * @return PKIRequestStringBuilder + * @return RequestStringBuilder */ private function appendPrefix() { @@ -127,7 +122,7 @@ private function appendPrefix() } /** - * @return PKIRequestStringBuilder + * @return RequestStringBuilder */ private function removeTrailingComma() { diff --git a/Payments/iyzico/upload/system/iyzico/src/Iyzipay/RequestStringConvertible.php b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/RequestStringConvertible.php new file mode 100644 index 0000000..b72da3f --- /dev/null +++ b/Payments/iyzico/upload/system/iyzico/src/Iyzipay/RequestStringConvertible.php @@ -0,0 +1,8 @@ +binNumber)) { - $response->setBinNumber($jsonResult->binNumber); - } - if (isset($jsonResult->cardType)) { - $response->setCardType($jsonResult->cardType); - } - if (isset($jsonResult->cardAssociation)) { - $response->setCardAssociation($jsonResult->cardAssociation); - } - if (isset($jsonResult->cardFamily)) { - $response->setCardFamily($jsonResult->cardFamily); - } - if (isset($jsonResult->bankName)) { - $response->setBankName($jsonResult->bankName); - } - if (isset($jsonResult->bankCode)) { - $response->setBankCode($jsonResult->bankCode); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Installment/Response/InstallmentInfoResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Installment/Response/InstallmentInfoResponse.php deleted file mode 100644 index 15d092e..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Installment/Response/InstallmentInfoResponse.php +++ /dev/null @@ -1,26 +0,0 @@ -installmentDetails; - } - - public function setInstallmentDetails($installmentDetails) - { - $this->installmentDetails = $installmentDetails; - } - - public function fromJson($jsonResult) - { - InstallmentInfoResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Installment/Response/Mapper/InstallmentInfoResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Installment/Response/Mapper/InstallmentInfoResponseMapper.php deleted file mode 100644 index bbc8492..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Installment/Response/Mapper/InstallmentInfoResponseMapper.php +++ /dev/null @@ -1,85 +0,0 @@ -installmentDetails)) { - $response->setInstallmentDetails($this->mapInstallmentDetails($jsonResult->installmentDetails)); - } - } - - private function mapInstallmentDetails($installmentDetails) - { - $installmentDetailDtoArray = array(); - - foreach ($installmentDetails as $index => $installmentDetail) { - $installmentDetailDto = new InstallmentDetailDto(); - if (isset($installmentDetail->binNumber)) { - $installmentDetailDto->setBinNumber($installmentDetail->binNumber); - } - if (isset($installmentDetail->price)) { - $installmentDetailDto->setPrice($installmentDetail->price); - } - if (isset($installmentDetail->cardType)) { - $installmentDetailDto->setCardType($installmentDetail->cardType); - } - if (isset($installmentDetail->cardAssociation)) { - $installmentDetailDto->setCardAssociation($installmentDetail->cardAssociation); - } - if (isset($installmentDetail->cardFamilyName)) { - $installmentDetailDto->setCardFamilyName($installmentDetail->cardFamilyName); - } - if (isset($installmentDetail->force3ds)) { - $installmentDetailDto->setForce3ds($installmentDetail->force3ds); - } - if (isset($installmentDetail->bankCode)) { - $installmentDetailDto->setBankCode($installmentDetail->bankCode); - } - if (isset($installmentDetail->bankName)) { - $installmentDetailDto->setBankName($installmentDetail->bankName); - } - if (isset($installmentDetail->installmentPrices)) { - $installmentDetailDto->setInstallmentPrices($this->mapInstallmentPrices($installmentDetail->installmentPrices)); - } - $installmentDetailDtoArray[$index] = $installmentDetailDto; - } - - return $installmentDetailDtoArray; - } - - private function mapInstallmentPrices($installmentPrices) - { - $installmentPriceDtoArray = array(); - - foreach ($installmentPrices as $index => $installmentPrice) { - $installmentPriceDto = new InstallmentPriceDto(); - if (isset($installmentPrice->installmentPrice)) { - $installmentPriceDto->setInstallmentPrice($installmentPrice->installmentPrice); - } - if (isset($installmentPrice->totalPrice)) { - $installmentPriceDto->setTotalPrice($installmentPrice->totalPrice); - } - if (isset($installmentPrice->installmentNumber)) { - $installmentPriceDto->setInstallmentNumber($installmentPrice->installmentNumber); - } - $installmentPriceDtoArray[$index] = $installmentPriceDto; - } - - return $installmentPriceDtoArray; - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/ConnectPaymentAuthRequest.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/ConnectPaymentAuthRequest.php deleted file mode 100644 index 0559d3a..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/ConnectPaymentAuthRequest.php +++ /dev/null @@ -1,8 +0,0 @@ -connectorName; - } - - public function setConnectorName($connectorName) - { - $this->connectorName = $connectorName; - } - - public function getJsonObject() - { - return JsonBuilder::fromJsonObject(parent::getJsonObject()) - ->add("connectorName", $this->getConnectorName()) - ->getObject(); - } - - public function toPKIRequestString() - { - return PKIRequestStringBuilder::newInstance() - ->appendSuper(parent::toPKIRequestString()) - ->append("connectorName", $this->getConnectorName()) - ->getRequestString(); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/ConnectPaymentThreeDSInitializeRequest.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/ConnectPaymentThreeDSInitializeRequest.php deleted file mode 100644 index 8d431e9..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/ConnectPaymentThreeDSInitializeRequest.php +++ /dev/null @@ -1,36 +0,0 @@ -callbackUrl; - } - - public function setCallbackUrl($callbackUrl) - { - $this->callbackUrl = $callbackUrl; - } - - public function getJsonObject() - { - return JsonBuilder::fromJsonObject(parent::getJsonObject()) - ->add("callbackUrl", $this->getCallbackUrl()) - ->getObject(); - } - - public function toPKIRequestString() - { - return PKIRequestStringBuilder::newInstance() - ->appendSuper(parent::toPKIRequestString()) - ->append("callbackUrl", $this->getCallbackUrl()) - ->getRequestString(); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/ConnectPaymentThreeDSRequest.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/ConnectPaymentThreeDSRequest.php deleted file mode 100644 index a54a9d5..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Request/ConnectPaymentThreeDSRequest.php +++ /dev/null @@ -1,8 +0,0 @@ -mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentCancelResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentCancelResponse.php deleted file mode 100644 index 4c5c79d..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentCancelResponse.php +++ /dev/null @@ -1,25 +0,0 @@ -connectorName; - } - - public function setConnectorName($connectorName) - { - $this->connectorName = $connectorName; - } - - public function fromJson($jsonResult) - { - ConnectPaymentCancelResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentPostAuthResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentPostAuthResponse.php deleted file mode 100644 index c35ed35..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentPostAuthResponse.php +++ /dev/null @@ -1,25 +0,0 @@ -connectorName; - } - - public function setConnectorName($connectorName) - { - $this->connectorName = $connectorName; - } - - public function fromJson($jsonResult) - { - ConnectPaymentPostAuthResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentPreAuthResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentPreAuthResponse.php deleted file mode 100644 index b8cd779..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentPreAuthResponse.php +++ /dev/null @@ -1,13 +0,0 @@ -mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentRefundResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentRefundResponse.php deleted file mode 100644 index 5aebb33..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentRefundResponse.php +++ /dev/null @@ -1,25 +0,0 @@ -connectorName; - } - - public function setConnectorName($connectorName) - { - $this->connectorName = $connectorName; - } - - public function fromJson($jsonResult) - { - ConnectPaymentRefundResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentResponse.php deleted file mode 100644 index 87cde04..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentResponse.php +++ /dev/null @@ -1,25 +0,0 @@ -connectorName; - } - - public function setConnectorName($connectorName) - { - $this->connectorName = $connectorName; - } - - public function fromJson($jsonResult) - { - ConnectPaymentResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentThreeDSInitializeResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentThreeDSInitializeResponse.php deleted file mode 100644 index 276c103..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentThreeDSInitializeResponse.php +++ /dev/null @@ -1,13 +0,0 @@ -mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentThreeDSResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentThreeDSResponse.php deleted file mode 100644 index b678634..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/ConnectPaymentThreeDSResponse.php +++ /dev/null @@ -1,13 +0,0 @@ -mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/ConnectPaymentAuthResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/ConnectPaymentAuthResponseMapper.php deleted file mode 100644 index 8dd3081..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/ConnectPaymentAuthResponseMapper.php +++ /dev/null @@ -1,19 +0,0 @@ -connectorName)) { - $response->setConnectorName($jsonResult->connectorName); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/ConnectPaymentPostAuthResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/ConnectPaymentPostAuthResponseMapper.php deleted file mode 100644 index 571d8fa..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/ConnectPaymentPostAuthResponseMapper.php +++ /dev/null @@ -1,22 +0,0 @@ -connectorName)) { - $response->setConnectorName($jsonResult->connectorName); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/ConnectPaymentPreAuthResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/ConnectPaymentPreAuthResponseMapper.php deleted file mode 100644 index fa936ba..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/ConnectPaymentPreAuthResponseMapper.php +++ /dev/null @@ -1,18 +0,0 @@ -connectorName)) { - $response->setConnectorName($jsonResult->connectorName); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/ConnectPaymentResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/ConnectPaymentResponseMapper.php deleted file mode 100644 index 031436e..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/ConnectPaymentResponseMapper.php +++ /dev/null @@ -1,23 +0,0 @@ -connectorName)) { - $response->setConnectorName($jsonResult->connectorName); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/ConnectPaymentThreeDSInitializeResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/ConnectPaymentThreeDSInitializeResponseMapper.php deleted file mode 100644 index fb5a9c1..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/ConnectPaymentThreeDSInitializeResponseMapper.php +++ /dev/null @@ -1,18 +0,0 @@ -paymentId)) { - $response->setPaymentId($jsonResult->paymentId); - } - if (isset($jsonResult->price)) { - $response->setPrice($jsonResult->price); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/PaymentPostAuthResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/PaymentPostAuthResponseMapper.php deleted file mode 100644 index 4ac1877..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/PaymentPostAuthResponseMapper.php +++ /dev/null @@ -1,26 +0,0 @@ -paymentId)) { - $response->setPaymentId($jsonResult->paymentId); - } - if (isset($jsonResult->price)) { - $response->setPrice($jsonResult->price); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/PaymentRefundResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/PaymentRefundResponseMapper.php deleted file mode 100644 index f74962c..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/PaymentRefundResponseMapper.php +++ /dev/null @@ -1,29 +0,0 @@ -paymentId)) { - $response->setPaymentId($jsonResult->paymentId); - } - if (isset($jsonResult->paymentTransactionId)) { - $response->setPaymentTransactionId($jsonResult->paymentTransactionId); - } - if (isset($jsonResult->price)) { - $response->setPrice($jsonResult->price); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/PaymentResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/PaymentResponseMapper.php deleted file mode 100644 index fbacb86..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/PaymentResponseMapper.php +++ /dev/null @@ -1,62 +0,0 @@ -price)) { - $response->setPrice($jsonResult->price); - } - if (isset($jsonResult->paidPrice)) { - $response->setPaidPrice($jsonResult->paidPrice); - } - if (isset($jsonResult->installment)) { - $response->setInstallment($jsonResult->installment); - } - if (isset($jsonResult->paymentId)) { - $response->setPaymentId($jsonResult->paymentId); - } - if (isset($jsonResult->merchantCommissionRate)) { - $response->setMerchantCommissionRate($jsonResult->merchantCommissionRate); - } - if (isset($jsonResult->merchantCommissionRateAmount)) { - $response->setMerchantCommissionRateAmount($jsonResult->merchantCommissionRateAmount); - } - if (isset($jsonResult->iyziCommissionFee)) { - $response->setIyziCommissionFee($jsonResult->iyziCommissionFee); - } - if (isset($jsonResult->cardType)) { - $response->setCardType($jsonResult->cardType); - } - if (isset($jsonResult->cardAssociation)) { - $response->setCardAssociation($jsonResult->cardAssociation); - } - if (isset($jsonResult->cardFamily)) { - $response->setCardFamily($jsonResult->cardFamily); - } - if (isset($jsonResult->cardToken)) { - $response->setCardToken($jsonResult->cardToken); - } - if (isset($jsonResult->cardUserKey)) { - $response->setCardUserKey($jsonResult->cardUserKey); - } - if (isset($jsonResult->binNumber)) { - $response->setBinNumber($jsonResult->binNumber); - } - if (isset($jsonResult->paymentTransactionId)) { - $response->setPaymentTransactionId($jsonResult->paymentTransactionId); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/PaymentThreeDSInitializeResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/PaymentThreeDSInitializeResponseMapper.php deleted file mode 100644 index da1a09c..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/Mapper/PaymentThreeDSInitializeResponseMapper.php +++ /dev/null @@ -1,23 +0,0 @@ -threeDSHtmlContent)) { - $response->setThreeDSHtmlContent(base64_decode($jsonResult->threeDSHtmlContent)); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/PaymentCancelResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/PaymentCancelResponse.php deleted file mode 100644 index e9d89e0..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/PaymentCancelResponse.php +++ /dev/null @@ -1,38 +0,0 @@ -paymentId; - } - - public function setPaymentId($paymentId) - { - $this->paymentId = $paymentId; - } - - public function getPrice() - { - return $this->price; - } - - public function setPrice($price) - { - $this->price = $price; - } - - public function fromJson($jsonResult) - { - PaymentCancelResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } - -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/PaymentPostAuthResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/PaymentPostAuthResponse.php deleted file mode 100644 index 7a65ce2..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/PaymentPostAuthResponse.php +++ /dev/null @@ -1,37 +0,0 @@ -paymentId; - } - - public function setPaymentId($paymentId) - { - $this->paymentId = $paymentId; - } - - public function getPrice() - { - return $this->price; - } - - public function setPrice($price) - { - $this->price = $price; - } - - public function fromJson($jsonResult) - { - PaymentPostAuthResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/PaymentThreeDSInitializeResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/PaymentThreeDSInitializeResponse.php deleted file mode 100644 index 9ac7427..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Payment/Response/PaymentThreeDSInitializeResponse.php +++ /dev/null @@ -1,26 +0,0 @@ -threeDSHtmlContent; - } - - public function setThreeDSHtmlContent($threeDSHtmlContent) - { - $this->threeDSHtmlContent = $threeDSHtmlContent; - } - - public function fromJson($jsonResult) - { - PaymentThreeDSInitializeResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Request/PayoutCompletedRequest.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Request/PayoutCompletedRequest.php deleted file mode 100644 index 6e5598e..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Request/PayoutCompletedRequest.php +++ /dev/null @@ -1,37 +0,0 @@ -date; - } - - public function setDate($date) - { - $this->date = $date; - } - - public function getJsonObject() - { - return JsonBuilder::fromJsonObject(parent::getJsonObject()) - ->add("date", $this->getDate()) - ->getObject(); - } - - public function toPKIRequestString() - { - return PKIRequestStringBuilder::newInstance() - ->appendSuper(parent::toPKIRequestString()) - ->append("date", $this->getDate()) - ->getRequestString(); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Response/BouncedRowResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Response/BouncedRowResponse.php deleted file mode 100644 index 4cad14f..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Response/BouncedRowResponse.php +++ /dev/null @@ -1,26 +0,0 @@ -bouncedRows; - } - - public function setBouncedRows($bouncedRows) - { - $this->bouncedRows = $bouncedRows; - } - - public function fromJson($jsonResult) - { - BouncedRowResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Response/Mapper/BouncedRowResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Response/Mapper/BouncedRowResponseMapper.php deleted file mode 100644 index 35519bd..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Response/Mapper/BouncedRowResponseMapper.php +++ /dev/null @@ -1,54 +0,0 @@ -bouncedRows)) { - $response->setBouncedRows($this->mapBouncedRows($jsonResult->bouncedRows)); - } - } - - private function mapBouncedRows($bouncedRows) - { - $bouncedRowDtoArray = array(); - - foreach ($bouncedRows as $index => $bouncedRow) { - $bouncedRowDto = new BouncedRowDto(); - if (isset($bouncedRows->subMerchantKey)) { - $bouncedRowDto->setSubMerchantKey($bouncedRow->submerchantKey); - } - if (isset($bouncedRows->iban)) { - $bouncedRowDto->setIban($bouncedRow->iban); - } - if (isset($bouncedRows->contactName)) { - $bouncedRowDto->setContactName($bouncedRow->contactName); - } - if (isset($bouncedRows->contactSurname)) { - $bouncedRowDto->setContactSurname($bouncedRow->contactSurname); - } - if (isset($bouncedRows->legalCompanyTitle)) { - $bouncedRowDto->setLegalCompanyTitle($bouncedRow->legalCompanyTitle); - } - if (isset($bouncedRows->marketplaceSubmerchantType)) { - $bouncedRowDto->setMarketplaceSubmerchantType($bouncedRow->marketplaceSubmerchantType); - } - $bouncedRowDtoArray[$index] = $bouncedRowDto; - } - - return $bouncedRowDtoArray; - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Response/Mapper/PayoutCompletedResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Response/Mapper/PayoutCompletedResponseMapper.php deleted file mode 100644 index 00ed142..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Response/Mapper/PayoutCompletedResponseMapper.php +++ /dev/null @@ -1,48 +0,0 @@ -payoutCompletedTransactions)) { - $response->setPayoutCompletedTransactions($this->mapPayoutCompletedTransactions($jsonResult->payoutCompletedTransactions)); - } - } - - private function mapPayoutCompletedTransactions($payoutCompletedTransactions) - { - $payoutCompletedTransactionDtoArray = array(); - - foreach ($payoutCompletedTransactions as $index => $payoutCompletedTransaction) { - $payoutCompletedTransactionDto = new PayoutCompletedTxDto(); - if (isset($payoutCompletedTransaction->paymentTransactionId)) { - $payoutCompletedTransactionDto->setPaymentTransactionId($payoutCompletedTransaction->paymentTransactionId); - } - if (isset($payoutCompletedTransaction->payoutAmount)) { - $payoutCompletedTransactionDto->setPayoutAmount($payoutCompletedTransaction->payoutAmount); - } - if (isset($payoutCompletedTransaction->payoutType)) { - $payoutCompletedTransactionDto->setPayoutType($payoutCompletedTransaction->payoutType); - } - if (isset($payoutCompletedTransaction->subMerchantKey)) { - $payoutCompletedTransactionDto->setSubMerchantKey($payoutCompletedTransaction->subMerchantKey); - } - $payoutCompletedTransactionDtoArray[$index] = $payoutCompletedTransactionDto; - } - - return $payoutCompletedTransactionDtoArray; - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Response/PayoutCompletedResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Response/PayoutCompletedResponse.php deleted file mode 100644 index c83d600..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Basic/Reporting/Response/PayoutCompletedResponse.php +++ /dev/null @@ -1,26 +0,0 @@ -payoutCompletedTransactions; - } - - public function setPayoutCompletedTransactions($payoutCompletedTransactions) - { - $this->payoutCompletedTransactions = $payoutCompletedTransactions; - } - - public function fromJson($jsonResult) - { - PayoutCompletedResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Response/CreateCardResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Response/CreateCardResponse.php deleted file mode 100644 index 5b3e989..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Response/CreateCardResponse.php +++ /dev/null @@ -1,59 +0,0 @@ -externalId; - } - - public function setExternalId($externalId) - { - $this->externalId = $externalId; - } - - public function getEmail() - { - return $this->email; - } - - public function setEmail($email) - { - $this->email = $email; - } - - public function getCardUserKey() - { - return $this->cardUserKey; - } - - public function setCardUserKey($cardUserKey) - { - $this->cardUserKey = $cardUserKey; - } - - public function getCardToken() - { - return $this->cardToken; - } - - public function setCardToken($cardToken) - { - $this->cardToken = $cardToken; - } - - public function fromJson($jsonResult) - { - CreateCardResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Response/DeleteCardResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Response/DeleteCardResponse.php deleted file mode 100644 index 6b88b73..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Response/DeleteCardResponse.php +++ /dev/null @@ -1,14 +0,0 @@ -mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Response/Mapper/CreateCardResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Response/Mapper/CreateCardResponseMapper.php deleted file mode 100644 index bb1c4f8..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Response/Mapper/CreateCardResponseMapper.php +++ /dev/null @@ -1,32 +0,0 @@ -externalId)) { - $response->setExternalId($jsonResult->externalId); - } - if (isset($jsonResult->email)) { - $response->setEmail($jsonResult->email); - } - if (isset($jsonResult->cardUserKey)) { - $response->setCardUserKey($jsonResult->cardUserKey); - } - if (isset($jsonResult->cardToken)) { - $response->setCardToken($jsonResult->cardToken); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Response/Mapper/DeleteCardResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Response/Mapper/DeleteCardResponseMapper.php deleted file mode 100644 index 1406668..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Response/Mapper/DeleteCardResponseMapper.php +++ /dev/null @@ -1,19 +0,0 @@ -cardUserKey)) { - $response->setCardUserKey($jsonResult->cardUserKey); - } - if (isset($jsonResult->cardDetails)) { - $response->setCardDetails($this->mapCardDetails($jsonResult->cardDetails)); - } - } - - public function mapCardDetails($cardDetails) - { - $cardDetailDtoArray = array(); - - foreach ($cardDetails as $index => $cardDetail) { - $cardDetailDto = new CardDetailDto(); - if (isset($cardDetail->cardToken)) { - $cardDetailDto->setCardToken($cardDetail->cardToken); - } - if (isset($cardDetail->cardAlias)) { - $cardDetailDto->setCardAlias($cardDetail->cardAlias); - } - if (isset($cardDetail->binNumber)) { - $cardDetailDto->setBinNumber($cardDetail->binNumber); - } - if (isset($cardDetail->cardType)) { - $cardDetailDto->setCardType($cardDetail->cardType); - } - if (isset($cardDetail->cardAssociation)) { - $cardDetailDto->setCardAssociation($cardDetail->cardAssociation); - } - if (isset($cardDetail->cardFamily)) { - $cardDetailDto->setCardFamily($cardDetail->cardFamily); - } - if (isset($cardDetail->cardBankCode)) { - $cardDetailDto->setCardBankCode($cardDetail->cardBankCode); - } - if (isset($cardDetail->cardBankName)) { - $cardDetailDto->setCardBankName($cardDetail->cardBankName); - } - $cardDetailDtoArray[$index] = $cardDetailDto; - } - - return $cardDetailDtoArray; - } -} diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Response/RetrieveCardListResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Response/RetrieveCardListResponse.php deleted file mode 100644 index 5925d7f..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/CardStorage/Response/RetrieveCardListResponse.php +++ /dev/null @@ -1,37 +0,0 @@ -cardUserKey; - } - - public function setCardUserKey($cardUserKey) - { - $this->cardUserKey = $cardUserKey; - } - - public function getCardDetails() - { - return $this->cardDetails; - } - - public function setCardDetails($cardDetails) - { - $this->cardDetails = $cardDetails; - } - - public function fromJson($jsonResult) - { - RetrieveCardListResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Digest.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Digest.php deleted file mode 100644 index 8af69cd..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Digest.php +++ /dev/null @@ -1,11 +0,0 @@ -paymentTransactionId; - } - - public function setPaymentTransactionId($paymentTransactionId) - { - $this->paymentTransactionId = $paymentTransactionId; - } - - public function fromJson($jsonResult) - { - ApprovalResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Approval/Response/Mapper/ApprovalResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Approval/Response/Mapper/ApprovalResponseMapper.php deleted file mode 100644 index 1a8967d..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Approval/Response/Mapper/ApprovalResponseMapper.php +++ /dev/null @@ -1,23 +0,0 @@ -paymentTransactionId)) { - $response->setPaymentTransactionId($jsonResult->paymentTransactionId); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/CrossBooking/Response/CrossBookingResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/CrossBooking/Response/CrossBookingResponse.php deleted file mode 100644 index a568570..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/CrossBooking/Response/CrossBookingResponse.php +++ /dev/null @@ -1,10 +0,0 @@ -subMerchantExternalId; - } - - public function setSubMerchantExternalId($subMerchantExternalId) - { - $this->subMerchantExternalId = $subMerchantExternalId; - } - - public function getIdentityNumber() - { - return $this->identityNumber; - } - - public function setIdentityNumber($identityNumber) - { - $this->identityNumber = $identityNumber; - } - - public function getTaxNumber() - { - return $this->taxNumber; - } - - public function setTaxNumber($taxNumber) - { - $this->taxNumber = $taxNumber; - } - - public function getSubMerchantType() - { - return $this->subMerchantType; - } - - public function setSubMerchantType($subMerchantType) - { - $this->subMerchantType = $subMerchantType; - } - - public function getJsonObject() - { - return JsonBuilder::fromJsonObject(parent::getJsonObject()) - ->add("subMerchantExternalId", $this->getSubMerchantExternalId()) - ->add("identityNumber", $this->getIdentityNumber()) - ->add("taxNumber", $this->getTaxNumber()) - ->add("subMerchantType", $this->getSubMerchantType()) - ->getObject(); - } - - public function toPKIRequestString() - { - return PKIRequestStringBuilder::newInstance() - ->appendSuper(parent::toPKIRequestString()) - ->append("subMerchantExternalId", $this->getSubMerchantExternalId()) - ->append("identityNumber", $this->getIdentityNumber()) - ->append("taxNumber", $this->getTaxNumber()) - ->append("subMerchantType", $this->getSubMerchantType()) - ->getRequestString(); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Request/UpdateSubMerchantRequest.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Request/UpdateSubMerchantRequest.php deleted file mode 100644 index 7f5fdd7..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Request/UpdateSubMerchantRequest.php +++ /dev/null @@ -1,62 +0,0 @@ -subMerchantKey; - } - - public function setSubMerchantKey($subMerchantKey) - { - $this->subMerchantKey = $subMerchantKey; - } - - public function getIdentityNumber() - { - return $this->identityNumber; - } - - public function setIdentityNumber($identityNumber) - { - $this->identityNumber = $identityNumber; - } - - public function getTaxNumber() - { - return $this->taxNumber; - } - - public function setTaxNumber($taxNumber) - { - $this->taxNumber = $taxNumber; - } - - public function getJsonObject() - { - return JsonBuilder::fromJsonObject(parent::getJsonObject()) - ->add("subMerchantKey", $this->getSubMerchantKey()) - ->add("identityNumber", $this->getIdentityNumber()) - ->add("taxNumber", $this->getTaxNumber()) - ->getObject(); - } - - public function toPKIRequestString() - { - return PKIRequestStringBuilder::newInstance() - ->appendSuper(parent::toPKIRequestString()) - ->append("subMerchantKey", $this->getSubMerchantKey()) - ->append("identityNumber", $this->getIdentityNumber()) - ->append("taxNumber", $this->getTaxNumber()) - ->getRequestString(); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Response/CreateSubMerchantResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Response/CreateSubMerchantResponse.php deleted file mode 100644 index fbb27de..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Response/CreateSubMerchantResponse.php +++ /dev/null @@ -1,26 +0,0 @@ -subMerchantKey; - } - - public function setSubMerchantKey($subMerchantKey) - { - $this->subMerchantKey = $subMerchantKey; - } - - public function fromJson($jsonResult) - { - CreateSubMerchantResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Response/Mapper/CreateSubMerchantResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Response/Mapper/CreateSubMerchantResponseMapper.php deleted file mode 100644 index 97aaf31..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Response/Mapper/CreateSubMerchantResponseMapper.php +++ /dev/null @@ -1,23 +0,0 @@ -subMerchantKey)) { - $response->setSubMerchantKey($jsonResult->subMerchantKey); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Response/Mapper/RetrieveSubMerchantResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Response/Mapper/RetrieveSubMerchantResponseMapper.php deleted file mode 100644 index 761d798..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Response/Mapper/RetrieveSubMerchantResponseMapper.php +++ /dev/null @@ -1,62 +0,0 @@ -name)) { - $response->setName($jsonResult->name); - } - if (isset($jsonResult->email)) { - $response->setEmail($jsonResult->email); - } - if (isset($jsonResult->gsmNumber)) { - $response->setGsmNumber($jsonResult->gsmNumber); - } - if (isset($jsonResult->address)) { - $response->setAddress($jsonResult->address); - } - if (isset($jsonResult->iban)) { - $response->setIban($jsonResult->iban); - } - if (isset($jsonResult->taxOffice)) { - $response->setTaxOffice($jsonResult->taxOffice); - } - if (isset($jsonResult->contactName)) { - $response->setContactName($jsonResult->contactName); - } - if (isset($jsonResult->contactSurname)) { - $response->setContactSurname($jsonResult->contactSurname); - } - if (isset($jsonResult->legalCompanyTitle)) { - $response->setLegalCompanyTitle($jsonResult->legalCompanyTitle); - } - if (isset($jsonResult->subMerchantExternalId)) { - $response->setSubMerchantExternalId($jsonResult->subMerchantExternalId); - } - if (isset($jsonResult->identityNumber)) { - $response->setIdentityNumber($jsonResult->identityNumber); - } - if (isset($jsonResult->taxNumber)) { - $response->setTaxNumber($jsonResult->taxNumber); - } - if (isset($jsonResult->subMerchantType)) { - $response->setSubMerchantType($jsonResult->subMerchantType); - } - if (isset($jsonResult->subMerchantKey)) { - $response->setSubMerchantKey($jsonResult->subMerchantKey); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Response/Mapper/UpdateSubMerchantResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Response/Mapper/UpdateSubMerchantResponseMapper.php deleted file mode 100644 index 345dbda..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Onboarding/Response/Mapper/UpdateSubMerchantResponseMapper.php +++ /dev/null @@ -1,19 +0,0 @@ -mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Dto/EcomPaymentBillingAddressDto.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Dto/EcomPaymentBillingAddressDto.php deleted file mode 100644 index 85736bb..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Dto/EcomPaymentBillingAddressDto.php +++ /dev/null @@ -1,8 +0,0 @@ -cardHolderName; - } - - public function setCardHolderName($cardHolderName) - { - $this->cardHolderName = $cardHolderName; - } - - public function getCardNumber() - { - return $this->cardNumber; - } - - public function setCardNumber($cardNumber) - { - $this->cardNumber = $cardNumber; - } - - public function getExpireYear() - { - return $this->expireYear; - } - - public function setExpireYear($expireYear) - { - $this->expireYear = $expireYear; - } - - public function getExpireMonth() - { - return $this->expireMonth; - } - - public function setExpireMonth($expireMonth) - { - $this->expireMonth = $expireMonth; - } - - public function getCvc() - { - return $this->cvc; - } - - public function setCvc($cvc) - { - $this->cvc = $cvc; - } - - public function getRegisterCard() - { - return $this->registerCard; - } - - public function setRegisterCard($registerCard) - { - $this->registerCard = $registerCard; - } - - public function getCardAlias() - { - return $this->cardAlias; - } - - public function setCardAlias($cardAlias) - { - $this->cardAlias = $cardAlias; - } - - public function getCardToken() - { - return $this->cardToken; - } - - public function setCardToken($cardToken) - { - $this->cardToken = $cardToken; - } - - public function getCardUserKey() - { - return $this->cardUserKey; - } - - public function setCardUserKey($cardUserKey) - { - $this->cardUserKey = $cardUserKey; - } - - public function getJsonObject() - { - return JsonBuilder::newInstance() - ->add("cardHolderName", $this->getCardHolderName()) - ->add("cardNumber", $this->getCardNumber()) - ->add("expireYear", $this->getExpireYear()) - ->add("expireMonth", $this->getExpireMonth()) - ->add("cvc", $this->getCvc()) - ->add("registerCard", $this->getRegisterCard()) - ->add("cardAlias", $this->getCardAlias()) - ->add("cardToken", $this->getCardToken()) - ->add("cardUserKey", $this->getCardUserKey()) - ->getObject(); - } - - public function toPKIRequestString() - { - return PKIRequestStringBuilder::newInstance() - ->append("cardHolderName", $this->getCardHolderName()) - ->append("cardNumber", $this->getCardNumber()) - ->append("expireYear", $this->getExpireYear()) - ->append("expireMonth", $this->getExpireMonth()) - ->append("cvc", $this->getCvc()) - ->append("registerCard", $this->getRegisterCard()) - ->append("cardAlias", $this->getCardAlias()) - ->append("cardToken", $this->getCardToken()) - ->append("cardUserKey", $this->getCardUserKey()) - ->getRequestString(); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Dto/EcomPaymentShippingAddressDto.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Dto/EcomPaymentShippingAddressDto.php deleted file mode 100644 index 11dd9bb..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Dto/EcomPaymentShippingAddressDto.php +++ /dev/null @@ -1,8 +0,0 @@ -callbackUrl; - } - - public function setCallbackUrl($callbackUrl) - { - $this->callbackUrl = $callbackUrl; - } - - public function getJsonObject() - { - return JsonBuilder::fromJsonObject(parent::getJsonObject()) - ->add("callbackUrl", $this->getCallbackUrl()) - ->getObject(); - } - - public function toPKIRequestString() - { - return PKIRequestStringBuilder::newInstance() - ->appendSuper(parent::toPKIRequestString()) - ->append("callbackUrl", $this->getCallbackUrl()) - ->getRequestString(); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomPaymentThreeDSRequest.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomPaymentThreeDSRequest.php deleted file mode 100644 index 344865e..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Request/EcomPaymentThreeDSRequest.php +++ /dev/null @@ -1,51 +0,0 @@ -paymentId; - } - - public function setPaymentId($paymentId) - { - $this->paymentId = $paymentId; - } - - public function getConversationData() - { - return $this->conversationData; - } - - public function setConversationData($conversationData) - { - $this->conversationData = $conversationData; - } - - public function getJsonObject() - { - return JsonBuilder::fromJsonObject(parent::getJsonObject()) - ->add("paymentId", $this->getPaymentId()) - ->add("conversationData", $this->getConversationData()) - ->getObject(); - } - - public function toPKIRequestString() - { - return PKIRequestStringBuilder::newInstance() - ->appendSuper(parent::toPKIRequestString()) - ->append("paymentId", $this->getPaymentId()) - ->append("conversationData", $this->getConversationData()) - ->getRequestString(); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentAuthResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentAuthResponse.php deleted file mode 100644 index 83dcdbb..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentAuthResponse.php +++ /dev/null @@ -1,13 +0,0 @@ -mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentBKMInitializeResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentBKMInitializeResponse.php deleted file mode 100644 index 21d17ec..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentBKMInitializeResponse.php +++ /dev/null @@ -1,25 +0,0 @@ -htmlContent; - } - - public function setHtmlContent($htmlContent) - { - $this->htmlContent = $htmlContent; - } - - public function fromJson($jsonResult) - { - EcomPaymentBKMInitializeResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentPreAuthResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentPreAuthResponse.php deleted file mode 100644 index 43c11ba..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentPreAuthResponse.php +++ /dev/null @@ -1,13 +0,0 @@ -mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentThreeDSInitializeResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentThreeDSInitializeResponse.php deleted file mode 100644 index 776f17a..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentThreeDSInitializeResponse.php +++ /dev/null @@ -1,26 +0,0 @@ -threeDSHtmlContent; - } - - public function setThreeDSHtmlContent($threeDSHtmlContent) - { - $this->threeDSHtmlContent = $threeDSHtmlContent; - } - - public function fromJson($jsonResult) - { - EcomPaymentThreeDSInitializeResponseMapper::newInstance()->mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentThreeDSResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentThreeDSResponse.php deleted file mode 100644 index 2ac49ce..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomPaymentThreeDSResponse.php +++ /dev/null @@ -1,13 +0,0 @@ -mapResponse($this, $jsonResult); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomRetrievePaymentBKMAuthResponse.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomRetrievePaymentBKMAuthResponse.php deleted file mode 100644 index fdd1308..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/EcomRetrievePaymentBKMAuthResponse.php +++ /dev/null @@ -1,21 +0,0 @@ -mapResponse($this, $jsonResult); - } - -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/Mapper/EcomPaymentAuthResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/Mapper/EcomPaymentAuthResponseMapper.php deleted file mode 100644 index e536afd..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/Mapper/EcomPaymentAuthResponseMapper.php +++ /dev/null @@ -1,18 +0,0 @@ -htmlContent)) { - $response->setHtmlContent($jsonResult->htmlContent); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/Mapper/EcomPaymentCheckoutFormInitializeResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/Mapper/EcomPaymentCheckoutFormInitializeResponseMapper.php deleted file mode 100644 index c7e1480..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/Mapper/EcomPaymentCheckoutFormInitializeResponseMapper.php +++ /dev/null @@ -1,29 +0,0 @@ -token)) { - $response->setToken($jsonResult->token); - } - if (isset($jsonResult->checkoutFormContent)) { - $response->setCheckoutFormContent($jsonResult->checkoutFormContent); - } - if (isset($jsonResult->tokenExpireTime)) { - $response->setTokenExpireTime($jsonResult->tokenExpireTime); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/Mapper/EcomPaymentPreAuthResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/Mapper/EcomPaymentPreAuthResponseMapper.php deleted file mode 100644 index 5cae1ac..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/Mapper/EcomPaymentPreAuthResponseMapper.php +++ /dev/null @@ -1,18 +0,0 @@ -price)) { - $response->setPrice($jsonResult->price); - } - if (isset($jsonResult->paidPrice)) { - $response->setPaidPrice($jsonResult->paidPrice); - } - if (isset($jsonResult->basketId)) { - $response->setBasketId($jsonResult->basketId); - } - if (isset($jsonResult->installment)) { - $response->setInstallment($jsonResult->installment); - } - if (isset($jsonResult->paymentId)) { - $response->setPaymentId($jsonResult->paymentId); - } - if (isset($jsonResult->fraudStatus)) { - $response->setFraudStatus($jsonResult->fraudStatus); - } - if (isset($jsonResult->merchantCommissionRate)) { - $response->setMerchantCommissionRate($jsonResult->merchantCommissionRate); - } - if (isset($jsonResult->merchantCommissionRateAmount)) { - $response->setMerchantCommissionRateAmount($jsonResult->merchantCommissionRateAmount); - } - if (isset($jsonResult->iyziCommissionRateAmount)) { - $response->setIyziCommissionRateAmount($jsonResult->iyziCommissionRateAmount); - } - if (isset($jsonResult->iyziCommissionFee)) { - $response->setIyziCommissionFee($jsonResult->iyziCommissionFee); - } - if (isset($jsonResult->cardType)) { - $response->setCardType($jsonResult->cardType); - } - if (isset($jsonResult->cardAssociation)) { - $response->setCardAssociation($jsonResult->cardAssociation); - } - if (isset($jsonResult->cardFamily)) { - $response->setCardFamily($jsonResult->cardFamily); - } - if (isset($jsonResult->cardToken)) { - $response->setCardToken($jsonResult->cardToken); - } - if (isset($jsonResult->cardUserKey)) { - $response->setCardUserKey($jsonResult->cardUserKey); - } - if (isset($jsonResult->binNumber)) { - $response->setBinNumber($jsonResult->binNumber); - } - if (isset($jsonResult->itemTransactions)) { - $response->setItemTransactions($this->mapPaymentItemTransactions($jsonResult->itemTransactions)); - } - } - - private function mapPaymentItemTransactions($itemTransactions) - { - $itemTransactionDtoArray = array(); - - foreach ($itemTransactions as $index => $itemTransaction) { - $itemTransactionDto = new EcomPaymentItemTransactionDto(); - if (isset($itemTransaction->itemId)) { - $itemTransactionDto->setItemId($itemTransaction->itemId); - } - if (isset($itemTransaction->paymentTransactionId)) { - $itemTransactionDto->setPaymentTransactionId($itemTransaction->paymentTransactionId); - } - if (isset($itemTransaction->transactionStatus)) { - $itemTransactionDto->setTransactionStatus($itemTransaction->transactionStatus); - } - if (isset($itemTransaction->price)) { - $itemTransactionDto->setPrice($itemTransaction->price); - } - if (isset($itemTransaction->paidPrice)) { - $itemTransactionDto->setPaidPrice($itemTransaction->paidPrice); - } - if (isset($itemTransaction->merchantCommissionRate)) { - $itemTransactionDto->setMerchantCommissionRate($itemTransaction->merchantCommissionRate); - } - if (isset($itemTransaction->merchantCommissionRateAmount)) { - $itemTransactionDto->setMerchantCommissionRateAmount($itemTransaction->merchantCommissionRateAmount); - } - if (isset($itemTransaction->iyziCommissionRateAmount)) { - $itemTransactionDto->setIyziCommissionRateAmount($itemTransaction->iyziCommissionRateAmount); - } - if (isset($itemTransaction->iyziCommissionFee)) { - $itemTransactionDto->setIyziCommissionFee($itemTransaction->iyziCommissionFee); - } - if (isset($itemTransaction->blockageRate)) { - $itemTransactionDto->setBlockageRate($itemTransaction->blockageRate); - } - if (isset($itemTransaction->blockageRateAmountMerchant)) { - $itemTransactionDto->setBlockageRateAmountMerchant($itemTransaction->blockageRateAmountMerchant); - } - if (isset($itemTransaction->blockageRateAmountSubMerchant)) { - $itemTransactionDto->setBlockageRateAmountSubMerchant($itemTransaction->blockageRateAmountSubMerchant); - } - if (isset($itemTransaction->blockageResolvedDate)) { - $itemTransactionDto->setBlockageResolvedDate($itemTransaction->blockageResolvedDate); - } - if (isset($itemTransaction->subMerchantKey)) { - $itemTransactionDto->setSubMerchantKey($itemTransaction->subMerchantKey); - } - if (isset($itemTransaction->subMerchantPrice)) { - $itemTransactionDto->setSubMerchantPrice($itemTransaction->subMerchantPrice); - } - if (isset($itemTransaction->subMerchantPayoutRate)) { - $itemTransactionDto->setSubMerchantPayoutRate($itemTransaction->subMerchantPayoutRate); - } - if (isset($itemTransaction->subMerchantPayoutAmount)) { - $itemTransactionDto->setSubMerchantPayoutAmount($itemTransaction->subMerchantPayoutAmount); - } - if (isset($itemTransaction->merchantPayoutAmount)) { - $itemTransactionDto->setMerchantPayoutAmount($itemTransaction->merchantPayoutAmount); - } - $itemTransactionDtoArray[$index] = $itemTransactionDto; - } - - return $itemTransactionDtoArray; - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/Mapper/EcomPaymentThreeDSInitializeResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/Mapper/EcomPaymentThreeDSInitializeResponseMapper.php deleted file mode 100644 index 13c9033..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/Mapper/EcomPaymentThreeDSInitializeResponseMapper.php +++ /dev/null @@ -1,23 +0,0 @@ -threeDSHtmlContent)) { - $response->setThreeDSHtmlContent(base64_decode($jsonResult->threeDSHtmlContent)); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/Mapper/EcomPaymentThreeDSResponseMapper.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/Mapper/EcomPaymentThreeDSResponseMapper.php deleted file mode 100644 index ec37084..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Ecom/Payment/Response/Mapper/EcomPaymentThreeDSResponseMapper.php +++ /dev/null @@ -1,19 +0,0 @@ -token)) { - $response->setToken($jsonResult->token); - } - if (isset($jsonResult->callbackUrl)) { - $response->setCallbackUrl($jsonResult->callbackUrl); - } - if (isset($jsonResult->paymentStatus)) { - $response->setPaymentStatus($jsonResult->paymentStatus); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/FromJson.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/FromJson.php deleted file mode 100644 index cc21b6c..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/FromJson.php +++ /dev/null @@ -1,8 +0,0 @@ -status)) { - $response->setStatus($jsonResult->status); - } - if (isset($jsonResult->conversationId)) { - $response->setConversationId($jsonResult->conversationId); - } - if (isset($jsonResult->errorCode)) { - $response->setErrorCode($jsonResult->errorCode); - } - if (isset($jsonResult->errorMessage)) { - $response->setErrorMessage($jsonResult->errorMessage); - } - if (isset($jsonResult->errorGroup)) { - $response->setErrorGroup($jsonResult->errorGroup); - } - if (isset($jsonResult->locale)) { - $response->setLocale($jsonResult->locale); - } - if (isset($jsonResult->systemTime)) { - $response->setSystemTime($jsonResult->systemTime); - } - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/BasePaymentServiceClient.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/BasePaymentServiceClient.php deleted file mode 100644 index 22783d8..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/BasePaymentServiceClient.php +++ /dev/null @@ -1,33 +0,0 @@ -httpClientTemplate->get($this->configuration->getBaseUrl() . "/payment/test", parent::getPlainHttpHeader()); - $response = new Response(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function checkBin(BinCheckRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/bin/check", parent::getHttpHeader($request), $request->toJsonString()); - $response = new BinCheckResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/BaseServiceClient.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/BaseServiceClient.php deleted file mode 100644 index 2f9d855..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/BaseServiceClient.php +++ /dev/null @@ -1,63 +0,0 @@ -configuration = $configuration; - $this->httpClientTemplate = $httpClientTemplate; - } - - protected function getHttpHeader(Request $request = null, $authorizeRequest = true) - { - $header = array( - "Accept: application/json", - "Content-type: application/json", - ); - - if ($authorizeRequest == true) { - $randomHeaderValue = RandomStringGenerator::randomString(RequestHelper::RANDOM_STRING_SIZE); - array_push($header, "Authorization: " . $this->prepareAuthorizationString($request, $randomHeaderValue)); - array_push($header, "x-iyzi-rnd: " . $randomHeaderValue); - } - - return $header; - } - - protected function getPlainHttpHeader() - { - return $this->getHttpHeader(null, false); - } - - protected function jsonDecodeAndPrepareResponse(Response $response, $rawResult) - { - $jsonResult = json_decode($rawResult); - $response->setRawResult($rawResult); - $response->fromJson($jsonResult); - } - - private function prepareAuthorizationString(Request $request, $randomHeaderValue) - { - $hash = $this->calculateHash($request, $randomHeaderValue); - return RequestHelper::formatHeaderString(array($this->configuration->getApiKey(), $hash)); - } - - private function calculateHash(Request $request, $randomHeaderValue) - { - $hashStr = $this->configuration->getApiKey() . $randomHeaderValue . $this->configuration->getSecretKey() . $request->toPKIRequestString(); - return Digest::hash($hashStr); - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/CardStorageServiceClient.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/CardStorageServiceClient.php deleted file mode 100644 index fde7ca2..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/CardStorageServiceClient.php +++ /dev/null @@ -1,44 +0,0 @@ -httpClientTemplate->post($this->configuration->getBaseUrl() . "/cardstorage/card", parent::getHttpHeader($request), $request->toJsonString()); - $response = new CreateCardResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function deleteCard(DeleteCardRequest $request) - { - $rawResult = $this->httpClientTemplate->delete($this->configuration->getBaseUrl() . "/cardstorage/card", parent::getHttpHeader($request), $request->toJsonString()); - $response = new DeleteCardResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function getCards(RetrieveCardListRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/cardstorage/cards", parent::getHttpHeader($request), $request->toJsonString()); - $response = new RetrieveCardListResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/ConnectPaymentServiceClient.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/ConnectPaymentServiceClient.php deleted file mode 100644 index 43dd7b1..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/ConnectPaymentServiceClient.php +++ /dev/null @@ -1,84 +0,0 @@ -httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyziconnect/auth", parent::getHttpHeader($request), $request->toJsonString()); - $response = new ConnectPaymentAuthResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function preAuth(ConnectPaymentPreAuthRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyziconnect/preauth", parent::getHttpHeader($request), $request->toJsonString()); - $response = new ConnectPaymentPreAuthResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function postAuth(ConnectPaymentPostAuthRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyziconnect/postauth", parent::getHttpHeader($request), $request->toJsonString()); - $response = new ConnectPaymentPostAuthResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function refund(ConnectPaymentRefundRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyziconnect/refund", parent::getHttpHeader($request), $request->toJsonString()); - $response = new ConnectPaymentRefundResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function cancel(ConnectPaymentCancelRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyziconnect/cancel", parent::getHttpHeader($request), $request->toJsonString()); - $response = new ConnectPaymentCancelResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function initializeThreeDS(ConnectPaymentThreeDSInitializeRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyziconnect/initialize3ds", parent::getHttpHeader($request), $request->toJsonString()); - $response = new ConnectPaymentThreeDSInitializeResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function threeDSAuth(ConnectPaymentThreeDSRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyziconnect/auth3ds", parent::getHttpHeader($request), $request->toJsonString()); - $response = new ConnectPaymentThreeDSResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/CrossBookingServiceClient.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/CrossBookingServiceClient.php deleted file mode 100644 index c665952..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/CrossBookingServiceClient.php +++ /dev/null @@ -1,32 +0,0 @@ -httpClientTemplate->post($this->configuration->getBaseUrl() . "/crossbooking/send", parent::getHttpHeader($request), $request->toJsonString()); - $response = new CrossBookingResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function receiveFromSubMerchant(CrossBookingRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/crossbooking/receive", parent::getHttpHeader($request), $request->toJsonString()); - $response = new CrossBookingResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/EcomCheckoutFormServiceClient.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/EcomCheckoutFormServiceClient.php deleted file mode 100644 index 79d6aa6..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/EcomCheckoutFormServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyzipos/checkoutform/initialize/ecom", parent::getHttpHeader($request), $request->toJsonString()); - $response = new EcomPaymentCheckoutFormInitializeResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function getAuthResponse(EcomRetrievePaymentCheckoutFormAuthRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyzipos/checkoutform/auth/ecom/detail", parent::getHttpHeader($request), $request->toJsonString()); - $response = new EcomRetrievePaymentCheckoutFormAuthResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/EcomPaymentServiceClient.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/EcomPaymentServiceClient.php deleted file mode 100644 index 04cf83c..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/EcomPaymentServiceClient.php +++ /dev/null @@ -1,140 +0,0 @@ -httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyzipos/installment", parent::getHttpHeader($request), $request->toJsonString()); - $response = new InstallmentInfoResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function approve(ApprovalRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyzipos/item/approve", parent::getHttpHeader($request), $request->toJsonString()); - $response = new ApprovalResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function disapprove(ApprovalRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyzipos/item/disapprove", parent::getHttpHeader($request), $request->toJsonString()); - $response = new ApprovalResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function auth(EcomPaymentAuthRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyzipos/auth/ecom", parent::getHttpHeader($request), $request->toJsonString()); - $response = new EcomPaymentAuthResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function preAuth(EcomPaymentPreAuthRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyzipos/preauth/ecom", parent::getHttpHeader($request), $request->toJsonString()); - $response = new EcomPaymentPreAuthResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function postAuth(PaymentPostAuthRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyzipos/postauth", parent::getHttpHeader($request), $request->toJsonString()); - $response = new PaymentPostAuthResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function refund(PaymentRefundRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyzipos/refund", parent::getHttpHeader($request), $request->toJsonString()); - $response = new PaymentRefundResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function refundChargedFromMerchant(PaymentRefundRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyzipos/refund/merchant/charge", parent::getHttpHeader($request), $request->toJsonString()); - $response = new PaymentRefundResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function cancel(PaymentCancelRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyzipos/cancel", parent::getHttpHeader($request), $request->toJsonString()); - $response = new PaymentCancelResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function initializeThreeDS(EcomPaymentThreeDSInitializeRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyzipos/initialize3ds/ecom", parent::getHttpHeader($request), $request->toJsonString()); - $response = new EcomPaymentThreeDSInitializeResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function threeDSAuth(EcomPaymentThreeDSRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyzipos/auth3ds/ecom", parent::getHttpHeader($request), $request->toJsonString()); - $response = new EcomPaymentThreeDSResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function initializeBKM(EcomPaymentBKMInitializeRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyzipos/initializebkm/ecom", parent::getHttpHeader($request), $request->toJsonString()); - $response = new EcomPaymentBKMInitializeResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function getBKMAuthResponse(EcomRetrievePaymentBKMAuthRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/payment/iyzipos/bkm/auth/ecom/detail", parent::getHttpHeader($request), $request->toJsonString()); - $response = new EcomRetrievePaymentBKMAuthResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/OnboardingServiceClient.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/OnboardingServiceClient.php deleted file mode 100644 index b712c43..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/OnboardingServiceClient.php +++ /dev/null @@ -1,44 +0,0 @@ -httpClientTemplate->post($this->configuration->getBaseUrl() . "/onboarding/submerchant/detail", parent::getHttpHeader($request), $request->toJsonString()); - $response = new RetrieveSubMerchantResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function createSubMerchant(CreateSubMerchantRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/onboarding/submerchant", parent::getHttpHeader($request), $request->toJsonString()); - $response = new CreateSubMerchantResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function updateSubMerchant(UpdateSubMerchantRequest $request) - { - $rawResult = $this->httpClientTemplate->put($this->configuration->getBaseUrl() . "/onboarding/submerchant", parent::getHttpHeader($request), $request->toJsonString()); - $response = new UpdateSubMerchantResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } -} \ No newline at end of file diff --git a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/ReportingServiceClient.php b/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/ReportingServiceClient.php deleted file mode 100644 index dc25f94..0000000 --- a/Payments/iyzico/upload/system/library/iyzico/src/Iyzipay/Client/Service/ReportingServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -httpClientTemplate->post($this->configuration->getBaseUrl() . "/reporting/settlement/payoutcompleted", parent::getHttpHeader($request), $request->toJsonString()); - $response = new PayoutCompletedResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } - - public function getBouncedRows(BouncedRowRequest $request) - { - $rawResult = $this->httpClientTemplate->post($this->configuration->getBaseUrl() . "/reporting/settlement/bounced", parent::getHttpHeader($request), $request->toJsonString()); - $response = new BouncedRowResponse(); - parent::jsonDecodeAndPrepareResponse($response, $rawResult); - return $response; - } -} \ No newline at end of file