Skip to content

Commit

Permalink
Admin pkiString Builder updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetselim committed Aug 6, 2018
1 parent 636a917 commit 51dc62e
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions upload/admin/model/extension/payment/iyzico.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,85 +33,65 @@ 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) {
$name = var_export($key, true);
$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;
}

Expand Down

0 comments on commit 51dc62e

Please sign in to comment.