From 51dc62e09268234472e40e2a56b34f2b5d9c2563 Mon Sep 17 00:00:00 2001 From: Mehmet Selim Dil Date: Mon, 6 Aug 2018 16:06:05 +0300 Subject: [PATCH] Admin pkiString Builder updated. --- .../admin/model/extension/payment/iyzico.php | 30 ++++--------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/upload/admin/model/extension/payment/iyzico.php b/upload/admin/model/extension/payment/iyzico.php index 3d60d93..b0bcd4b 100755 --- a/upload/admin/model/extension/payment/iyzico.php +++ b/upload/admin/model/extension/payment/iyzico.php @@ -33,42 +33,32 @@ public function uninstall() { } public function pkiStringGenerate($object_data) { - + $pki_value = "["; foreach ($object_data as $key => $data) { - if(is_object($data)) { - $name = var_export($key, true); $name = str_replace("'", "", $name); $pki_value .= $name."=["; - $end_key = count(get_object_vars($data)); $count = 0; - foreach ($data as $key => $value) { - $count++; $name = var_export($key, true); $name = str_replace("'", "", $name); - - $pki_value .= $name."="."".$value; - if($end_key != $count) $pki_value .= ","; } - $pki_value .= "]"; - } else if(is_array($data)) { $name = var_export($key, true); $name = str_replace("'", "", $name); - $pki_value .= $name."=["; - + $end_key = count($data); + $count = 0; foreach ($data as $key => $result) { - + $count++; $pki_value .= "["; foreach ($result as $key => $item) { @@ -76,42 +66,32 @@ public function pkiStringGenerate($object_data) { $name = str_replace("'", "", $name); $pki_value .= $name."="."".$item; - if(end($result) != $item) { $pki_value .= ","; } - if(end($result) == $item) { - if(end($data) != $result) { - + if($end_key != $count) { $pki_value .= "], "; } else { - $pki_value .= "]"; } } } } - if(end($data) == $result) $pki_value .= "]"; } else { - $name = var_export($key, true); $name = str_replace("'", "", $name); - $pki_value .= $name."="."".$data.""; } - if(end($object_data) != $data) $pki_value .= ","; } - $pki_value .= "]"; - return $pki_value; }