feat(cinetpay payout): add log to test payout in real situation
This commit is contained in:
parent
7e3a7fc0ca
commit
354d33d7df
|
@ -205,9 +205,9 @@ class CinetpayController extends Controller
|
||||||
$amount = $request->input('amount');
|
$amount = $request->input('amount');
|
||||||
$payment_method = 'WALLET';
|
$payment_method = 'WALLET';
|
||||||
|
|
||||||
if($amount < 500){
|
// if($amount < 500){
|
||||||
return $this->errorResponse('Minimun amount is 500');
|
// return $this->errorResponse('Minimun amount is 500');
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
$client = new Client([
|
$client = new Client([
|
||||||
|
@ -302,11 +302,14 @@ class CinetpayController extends Controller
|
||||||
$responseData = json_decode($transfertResponse->getBody()->getContents());
|
$responseData = json_decode($transfertResponse->getBody()->getContents());
|
||||||
$responseCode = $transfertResponse->getStatusCode();
|
$responseCode = $transfertResponse->getStatusCode();
|
||||||
|
|
||||||
|
Log::info("Pay out cinietpay");
|
||||||
|
Log::info(json_encode($responseData));
|
||||||
|
|
||||||
if ($responseCode == 200) {
|
if ($responseCode == 200) {
|
||||||
|
|
||||||
$transaction->update([
|
$transaction->update([
|
||||||
'aggregator_payment_ref' => $responseData->data[0]?->transaction_id,
|
'aggregator_payment_ref' => $responseData->data[0]?->transaction_id,
|
||||||
'status' => PaymentTransactionStatus::PENDING,
|
'status' => $responseData->data[0]?->treatment_status,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $this->successResponse([
|
return $this->successResponse([
|
||||||
|
@ -367,12 +370,15 @@ class CinetpayController extends Controller
|
||||||
|
|
||||||
$responseData = json_decode($response->getBody()->getContents());
|
$responseData = json_decode($response->getBody()->getContents());
|
||||||
$responseCode = $response->getStatusCode();
|
$responseCode = $response->getStatusCode();
|
||||||
|
|
||||||
|
Log::info("Pay out check result");
|
||||||
|
Log::info(json_encode($responseData));
|
||||||
|
|
||||||
if ($responseCode == 200) {
|
if ($responseCode == 200) {
|
||||||
|
|
||||||
$transaction->update([
|
$transaction->update([
|
||||||
'status' => $responseData->data->status,
|
'aggregator_payment_ref' => $responseData->data[0]?->transaction_id,
|
||||||
'payment_method_exact' => $responseData->data->payment_method ?? null,
|
'status' => $responseData->data[0]?->treatment_status,
|
||||||
'payment_date' => $responseData->data->payment_date ?? null,
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue