Add migration to enhance session_payments table with payment_method_uuid and reference fields for split-payment details
This commit is contained in:
@@ -1004,6 +1004,8 @@ class AppointmentController extends BaseController
|
||||
), 422);
|
||||
}
|
||||
|
||||
// پرداختِ چندروشی (split): هر ردیف یک روش + مبلغ، و بهاختیار جزئیاتِ روش
|
||||
// (uuid کارتخوان/حساب بانکیِ ثبتشده + شناسه تراکنش).
|
||||
$payments = [];
|
||||
foreach ((array) ($data['payments'] ?? []) as $row) {
|
||||
$method = trim((string) ($row['method'] ?? ''));
|
||||
@@ -1014,7 +1016,14 @@ class AppointmentController extends BaseController
|
||||
if ($amount <= 0) {
|
||||
return $this->error(ErrorCodes::ERR_SESSION_PAYMENT_INVALID, ErrorCodes::message(ErrorCodes::ERR_SESSION_PAYMENT_INVALID), 422, 'amount_rials');
|
||||
}
|
||||
$payments[] = ['method' => $method, 'amount_rials' => $amount];
|
||||
$methodUuid = trim((string) ($row['payment_method_uuid'] ?? ''));
|
||||
$reference = trim((string) ($row['reference'] ?? ''));
|
||||
$payments[] = [
|
||||
'method' => $method,
|
||||
'amount_rials' => $amount,
|
||||
'payment_method_uuid' => $methodUuid !== '' ? mb_substr($methodUuid, 0, 36) : null,
|
||||
'reference' => $reference !== '' ? mb_substr($reference, 0, 255) : null,
|
||||
];
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user