Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: getStatement method of Payme #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Http/Classes/DataFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static function timestamp2datetime($timestamp)
}

// convert to datetime string
return date('Y-m-d H:i:s', strtotime($timestamp));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bu classga tegmasdan payme.php classni o'zida yangi method ochib shu orqali hal qilish yaxshiroq, chunki bu funsiyada boshqa classlarda ham foydalanilgan bo'lishi mumkin

return date('Y-m-d H:i:s', $timestamp);
}

/**
Expand All @@ -90,7 +90,7 @@ public static function timestamp2datetime($timestamp)
public static function datetime2timestamp($datetime)
{
if ($datetime) {
return strtotime($datetime);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bu yerda ham ma'no yo'qolib qolgan

return ($datetime);
}

return $datetime;
Expand Down
8 changes: 4 additions & 4 deletions src/Http/Classes/Payme/Payme.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,15 +442,15 @@ public function getReport($from_date, $to_date)
'time' => 1 * $detail['system_time_datetime'], // paycom transaction timestamp as is
'amount' => 1 * $row['amount'],
'account' => [
"{$this->config['key']}" => 1 * $row[$this->config['key']], // account parameters to identify client/order/service
"{$this->config['key']}" => 1 * $row['transactionable_id'], // account parameters to identify client/order/service
// ... additional parameters may be listed here, which are belongs to the account
],
'create_time' => DataFormat::datetime2timestamp($detail['create_time']),
'perform_time' => DataFormat::datetime2timestamp($detail['perform_time']),
'cancel_time' => DataFormat::datetime2timestamp($detail['cancel_time']),
'cancel_time' => DataFormat::datetime2timestamp($detail['cancel_time']) ?? 0,
'transaction' => (string)$row['id'],
'state' => 1 * $row['state'],
'reason' => isset($row['comment']) ? 1 * $row['comment'] : null,
'state' => 1 * intval($row['state']),
'reason' => \Illuminate\Support\Arr::get($row,"comment") ? (1 * \Illuminate\Support\Arr::get($row,"comment")) : null,,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tepada use deb import qilgan yaxshiroq, single quote bilan

'receivers' => isset($row['receivers']) ? json_decode($row['receivers'], true) : null,
];
}
Expand Down