wip
This commit is contained in:
@@ -48,40 +48,33 @@ class SyncWithSystem extends Action
|
|||||||
|
|
||||||
$response = checkOnlinePayment($onlinePaymentResource->orderId, $result['username'], $result['password']);
|
$response = checkOnlinePayment($onlinePaymentResource->orderId, $result['username'], $result['password']);
|
||||||
|
|
||||||
$systemResponse = syncWithBankSystem(
|
$systemRawResponse = syncWithBankSystem(
|
||||||
online_payment_order_uuid: $onlinePaymentResource->orderId,
|
online_payment_order_uuid: $onlinePaymentResource->orderId,
|
||||||
bank_unique_code: $sberPaymentOrder->branch->unique_code,
|
bank_unique_code: $sberPaymentOrder->branch->unique_code,
|
||||||
online_payment_terminal_id: $response['terminalId'],
|
online_payment_terminal_id: $response['terminalId'],
|
||||||
user_deposit_account: number_format($sberPaymentOrder->sender_deposit_account, 0, '', ''),
|
user_deposit_account: number_format($sberPaymentOrder->sender_deposit_account, 0, '', ''),
|
||||||
online_payment_auth_ref_num: $response['authRefNum'],
|
online_payment_auth_ref_num: $response['authRefNum'],
|
||||||
online_payment_tmt_amount: $orderItem->tmt_payment_amount,
|
online_payment_tmt_amount: $orderItem->tmt_payment_amount,
|
||||||
pay_purpose: $sberPaymentOrder->created_at->translatedFormat('F').' '.$sberPaymentOrder->created_at->format('Y')
|
pay_purpose: $orderItem->created_at->translatedFormat('F').' '.$orderItem->created_at->format('Y')
|
||||||
);
|
);
|
||||||
|
|
||||||
$ok = json_decode($systemResponse);
|
$systemResponse = json_decode($systemRawResponse);
|
||||||
|
|
||||||
info([
|
$success = $systemResponse['errCode'] == 0;
|
||||||
'type' => gettype($ok),
|
|
||||||
'response' => $ok,
|
|
||||||
'isClass' => is_object($ok),
|
|
||||||
'isArray' => is_array($ok),
|
|
||||||
]);
|
|
||||||
|
|
||||||
// $success = $systemResponse['errCode'] == 0;
|
if ($success) {
|
||||||
|
$orderItem->update([
|
||||||
// if ($success) {
|
'synced_with_system' => true,
|
||||||
// $orderItem->update([
|
]);
|
||||||
// 'synced_with_system' => true,
|
} else {
|
||||||
// ]);
|
$orderItem->update([
|
||||||
// } else {
|
'synced_with_system' => false,
|
||||||
// $orderItem->update([
|
]);
|
||||||
// 'synced_with_system' => false,
|
}
|
||||||
// ]);
|
|
||||||
// }
|
|
||||||
|
|
||||||
return Action::modal('modal-response', [
|
return Action::modal('modal-response', [
|
||||||
// 'html' => $success ? "Success" : "Fail",
|
'html' => $success ? "Success" : "Fail",
|
||||||
// 'title' => $success ? "Success" : "Fail",
|
'title' => $success ? "Success" : "Fail",
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user