+ Fix bug
This commit is contained in:
parent
0a10771c11
commit
6189c78de8
|
@ -223,9 +223,9 @@ class iLinkTransactionController extends Controller
|
||||||
if ($code == 200) {
|
if ($code == 200) {
|
||||||
$walletUser->balance -= $transaction->montant;
|
$walletUser->balance -= $transaction->montant;
|
||||||
//Emettre une trame SSL pour recharger le compte de la banque partenaire du montant de sa commission
|
//Emettre une trame SSL pour recharger le compte de la banque partenaire du montant de sa commission
|
||||||
$transaction->commission_banque = $frais * $config->taux_com_banque_envoi_wallet_carte_ilink / 100 ;
|
$transaction->commission_banque = $frais * $config->taux_com_banque_envoi_wallet_carte_ilink / 100;
|
||||||
|
|
||||||
$transaction->commission_hyp = $frais * $config->taux_com_hyp_envoi_wallet_carte_ilink / 100 ;
|
$transaction->commission_hyp = $frais * $config->taux_com_hyp_envoi_wallet_carte_ilink / 100;
|
||||||
$walletHyperviseur->balance_com += $transaction->commission_hyp;
|
$walletHyperviseur->balance_com += $transaction->commission_hyp;
|
||||||
$transaction->id_wallet_hyp = $walletHyperviseur->id;
|
$transaction->id_wallet_hyp = $walletHyperviseur->id;
|
||||||
$transaction->frais = $frais;
|
$transaction->frais = $frais;
|
||||||
|
@ -270,7 +270,7 @@ class iLinkTransactionController extends Controller
|
||||||
}
|
}
|
||||||
$transaction->montant_net_final_country = $this->toMoneyAmount($montantRetrait, $init_country, $request->final_country);
|
$transaction->montant_net_final_country = $this->toMoneyAmount($montantRetrait, $init_country, $request->final_country);
|
||||||
$transaction->commission_hyp = $transaction->part_reseau_emetteur;
|
$transaction->commission_hyp = $transaction->part_reseau_emetteur;
|
||||||
$transaction->commission_hyp_final_country = $this->toMoneyAmount($transaction->commission_hyp, $init_country, $request->final_country);
|
$transaction->commission_hyp_final_country = $this->toMoneyAmount($transaction->commission_hyp, $init_country, $request->final_country);
|
||||||
$transaction->part_reseau_payeur_final_country = $this->toMoneyAmount($transaction->part_reseau_payeur, $init_country, $request->final_country);
|
$transaction->part_reseau_payeur_final_country = $this->toMoneyAmount($transaction->part_reseau_payeur, $init_country, $request->final_country);
|
||||||
if (isset($reseauPayeur))
|
if (isset($reseauPayeur))
|
||||||
$reseauPayeur->balance_com += $transaction->part_reseau_payeur_final_country;
|
$reseauPayeur->balance_com += $transaction->part_reseau_payeur_final_country;
|
||||||
|
@ -363,7 +363,7 @@ class iLinkTransactionController extends Controller
|
||||||
$message = trans('messages.successful_user_remove_from_wallet_to_cash',
|
$message = trans('messages.successful_user_remove_from_wallet_to_cash',
|
||||||
['id_transaction' => $transaction->id_transaction, 'amount' => $this->toMoney($transaction->montant, $init_country), 'net' => $this->toMoney($montantRetrait, $init_country),
|
['id_transaction' => $transaction->id_transaction, 'amount' => $this->toMoney($transaction->montant, $init_country), 'net' => $this->toMoney($montantRetrait, $init_country),
|
||||||
'fees' => $this->toMoney($frais + $taxe, $init_country), 'code' => wordwrap($code_retrait, 4, ' ', true),
|
'fees' => $this->toMoney($frais + $taxe, $init_country), 'code' => wordwrap($code_retrait, 4, ' ', true),
|
||||||
'sender_code' => $user->user_code , 'init_country' => $this->getCountryName($init_country),]);
|
'sender_code' => $user->user_code, 'init_country' => $this->getCountryName($init_country),]);
|
||||||
$this->sendMail($user->email, trans('messages.successful_transaction'), $message);
|
$this->sendMail($user->email, trans('messages.successful_transaction'), $message);
|
||||||
return $this->successResponse($message . trans('messages.sent_by_mail'));
|
return $this->successResponse($message . trans('messages.sent_by_mail'));
|
||||||
}
|
}
|
||||||
|
@ -482,12 +482,12 @@ class iLinkTransactionController extends Controller
|
||||||
$this->validate($request, $transaction->remove_cash_rules());
|
$this->validate($request, $transaction->remove_cash_rules());
|
||||||
$agent = AgentPlus::findOrFail($network_agent->agent_id);
|
$agent = AgentPlus::findOrFail($network_agent->agent_id);
|
||||||
if ($this->checkPassword($request->password, $agent->encrypted_password, $agent->salt)) {
|
if ($this->checkPassword($request->password, $agent->encrypted_password, $agent->salt)) {
|
||||||
$transaction = WalletIlinkTransaction::where('id_transaction',$request->id_transaction)->first();
|
$transaction = WalletIlinkTransaction::where('id_transaction', $request->id_transaction)->first();
|
||||||
if ($transaction) {
|
if ($transaction) {
|
||||||
if ($transaction->status_retrait == 0) {
|
if ($transaction->status_retrait == 0) {
|
||||||
//Verifier que le pays de destinatation correspond au pays de retrait
|
//Verifier que le pays de destinatation correspond au pays de retrait
|
||||||
if($transaction->type != 11)
|
if ($transaction->type != 11)
|
||||||
if($init_country != $transaction->final_country)
|
if ($init_country != $transaction->final_country)
|
||||||
return $this->errorResponse(trans('errors.operation_cannot_performed_in_country'));
|
return $this->errorResponse(trans('errors.operation_cannot_performed_in_country'));
|
||||||
if ($this->checkPassword($request->code_retrait, $transaction->encrypted_code_retrait, $transaction->code_retrait_salt)) {
|
if ($this->checkPassword($request->code_retrait, $transaction->encrypted_code_retrait, $transaction->code_retrait_salt)) {
|
||||||
$montantNet = $transaction->type == 11 ? $transaction->montant_net : $transaction->montant_net_final_country;
|
$montantNet = $transaction->type == 11 ? $transaction->montant_net : $transaction->montant_net_final_country;
|
||||||
|
@ -501,12 +501,12 @@ class iLinkTransactionController extends Controller
|
||||||
$emailEmetteur = $transaction->wallet_user ? $transaction->wallet_user->user->email : $transaction->email_emetteur;
|
$emailEmetteur = $transaction->wallet_user ? $transaction->wallet_user->user->email : $transaction->email_emetteur;
|
||||||
|
|
||||||
$transactionRetrait->commission_ag = floatval($commissionHyp * $config->taux_com_ag_retrait_cash / 100);
|
$transactionRetrait->commission_ag = floatval($commissionHyp * $config->taux_com_ag_retrait_cash / 100);
|
||||||
$transactionRetrait->commission_sup = floatval($commissionHyp * $config->taux_com_sup_retrait_cash / 100);
|
$transactionRetrait->commission_sup = floatval($commissionHyp * $config->taux_com_sup_retrait_cash / 100);
|
||||||
$transactionRetrait->commission_hyp = $commissionHyp - $transactionRetrait->commission_ag - $transactionRetrait->commission_sup;
|
$transactionRetrait->commission_hyp = $commissionHyp - $transactionRetrait->commission_ag - $transactionRetrait->commission_sup;
|
||||||
$walletAgent->balance_princ += $montantNet;
|
$walletAgent->balance_princ += $montantNet;
|
||||||
$walletAgent->balance_com += $transactionRetrait->commission_ag;
|
$walletAgent->balance_com += $transactionRetrait->commission_ag;
|
||||||
$walletSuperviseur->balance_com += $transactionRetrait->commission_sup;
|
$walletSuperviseur->balance_com += $transactionRetrait->commission_sup;
|
||||||
$walletHyperviseur->balance_com -= ( $transactionRetrait->commission_ag + $transactionRetrait->commission_sup);
|
$walletHyperviseur->balance_com -= ($transactionRetrait->commission_ag + $transactionRetrait->commission_sup);
|
||||||
$transactionRetrait->id_wallet_ag = $walletAgent->id;
|
$transactionRetrait->id_wallet_ag = $walletAgent->id;
|
||||||
$transactionRetrait->id_wallet_sup = $walletSuperviseur->id;
|
$transactionRetrait->id_wallet_sup = $walletSuperviseur->id;
|
||||||
$transactionRetrait->id_wallet_hyp = $walletHyperviseur->id;
|
$transactionRetrait->id_wallet_hyp = $walletHyperviseur->id;
|
||||||
|
@ -523,7 +523,7 @@ class iLinkTransactionController extends Controller
|
||||||
$transactionRetrait->save();
|
$transactionRetrait->save();
|
||||||
$message = trans('messages.successful_agent_remove_cash',
|
$message = trans('messages.successful_agent_remove_cash',
|
||||||
['id_transaction' => $transactionRetrait->id_transaction, 'amount' => $this->toMoney($request->montant, $init_country),
|
['id_transaction' => $transactionRetrait->id_transaction, 'amount' => $this->toMoney($request->montant, $init_country),
|
||||||
'code' => wordwrap($request->code_retrait, 4, ' ', true), 'id_transaction_retrait' => $transaction->id_transaction]);
|
'code' => wordwrap($request->code_retrait, 4, ' ', true), 'id_transaction_retrait' => $transaction->id_transaction]);
|
||||||
$this->sendMail($emailEmetteur, trans('messages.successful_transaction'), $message);
|
$this->sendMail($emailEmetteur, trans('messages.successful_transaction'), $message);
|
||||||
return $this->successResponse($message . trans('messages.sent_by_mail'));
|
return $this->successResponse($message . trans('messages.sent_by_mail'));
|
||||||
} else {
|
} else {
|
||||||
|
@ -607,14 +607,14 @@ class iLinkTransactionController extends Controller
|
||||||
$agent = AgentPlus::findOrFail($network_agent->agent_id);
|
$agent = AgentPlus::findOrFail($network_agent->agent_id);
|
||||||
if ($this->checkPassword($request->password, $agent->encrypted_password, $agent->salt)) {
|
if ($this->checkPassword($request->password, $agent->encrypted_password, $agent->salt)) {
|
||||||
$user = User::where('user_code', $request->user_code)->first();
|
$user = User::where('user_code', $request->user_code)->first();
|
||||||
if(!$user)
|
if (!$user)
|
||||||
return $this->errorResponse(trans('errors.wallet_not_defined'));
|
return $this->errorResponse(trans('errors.wallet_not_defined'));
|
||||||
|
|
||||||
$walletUser = WalletsUser::where('idUser', $user->id)->firstOrFail();
|
$walletUser = WalletsUser::where('idUser', $user->id)->firstOrFail();
|
||||||
$transaction->final_country = $final_country = $user->network->country->id;
|
$transaction->final_country = $final_country = $user->network->country->id;
|
||||||
|
|
||||||
$frais = ($init_country != $final_country) ? $this->calculateFees($plr_agent_depot_wallet_ilink, $request->montant) : $this->calculateFees($plr_agent_depot_wallet_ilink_national, $request->montant);
|
$frais = ($init_country != $final_country) ? $this->calculateFees($plr_agent_depot_wallet_ilink, $request->montant) : $this->calculateFees($plr_agent_depot_wallet_ilink_national, $request->montant);
|
||||||
$taxe = ($init_country!= $final_country) ? $this->calculateTax($taxesInternationales, $frais) : $this->calculateTax($taxesNationales, $frais);
|
$taxe = ($init_country != $final_country) ? $this->calculateTax($taxesInternationales, $frais) : $this->calculateTax($taxesNationales, $frais);
|
||||||
$montantDepot = $request->montant - $frais - $taxe;
|
$montantDepot = $request->montant - $frais - $taxe;
|
||||||
$transaction->montant_net = $montantDepot;
|
$transaction->montant_net = $montantDepot;
|
||||||
$transaction->montant_net_final_country = $this->toMoneyAmount($montantDepot, $init_country, $final_country);
|
$transaction->montant_net_final_country = $this->toMoneyAmount($montantDepot, $init_country, $final_country);
|
||||||
|
@ -653,27 +653,23 @@ class iLinkTransactionController extends Controller
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 15: // Agent - Envoi de cash vers autre wallet
|
case 15: // Agent - Envoi de cash vers autre wallet
|
||||||
$this->validate($request, array_merge($transaction->cash_cash_rules(),[
|
$this->validate($request, array_merge($transaction->cash_cash_rules(), [
|
||||||
'network_destinataire'=>'required|integer|min:0|not_in:0'
|
'network_destinataire' => 'required|integer|min:0|not_in:0'
|
||||||
]));
|
]));
|
||||||
$agent = AgentPlus::findOrFail($network_agent->agent_id);
|
$agent = AgentPlus::findOrFail($network_agent->agent_id);
|
||||||
if ($this->checkPassword($request->password, $agent->encrypted_password, $agent->salt)) {
|
if ($this->checkPassword($request->password, $agent->encrypted_password, $agent->salt)) {
|
||||||
if ($request->montant > $walletAgent->balance_princ)
|
if ($request->montant > $walletAgent->balance_princ)
|
||||||
return $this->errorResponse(trans('errors.insufficient_balance'));
|
return $this->errorResponse(trans('errors.insufficient_balance'));
|
||||||
$frais = ($init_country != $request->final_country) ? $this->calculateFees($plr_agent_depot_autre_wallet, $request->montant) : $this->calculateFees($plr_agent_depot_autre_wallet_national, $request->montant);
|
$frais = ($init_country != $request->final_country) ? $this->calculateFees($plr_agent_depot_autre_wallet, $request->montant) : $this->calculateFees($plr_agent_depot_autre_wallet_national, $request->montant);
|
||||||
$taxe = ($init_country != $request->final_country) ? $this->calculateTax($taxesInternationales, $frais) : $this->calculateTax($taxesNationales, $frais);
|
$taxe = ($init_country != $request->final_country) ? $this->calculateTax($taxesInternationales, $frais) : $this->calculateTax($taxesNationales, $frais);
|
||||||
$montantDepot = $request->montant - $frais - $taxe;
|
$montantDepot = $request->montant - $frais - $taxe;
|
||||||
$transaction->montant_net = $montantDepot;
|
$transaction->montant_net = $montantDepot;
|
||||||
$transaction->montant_net_final_country = $this->toMoneyAmount($montantDepot, $init_country, $request->final_country);
|
$transaction->montant_net_final_country = $this->toMoneyAmount($montantDepot, $init_country, $request->final_country);
|
||||||
|
|
||||||
if ($init_country != $request->final_country) {
|
$reseauPayeur = PayingNetwork::where('id_network', $request->network_destinataire)->where('id_configWallet', $config->id)->firstOrFail();
|
||||||
$reseauPayeur = PayingNetwork::where('id_network', $request->network_destinataire)->where('id_configWallet', $config->id)->firstOrFail();
|
$transaction->part_reseau_payeur = $frais * $reseauPayeur->taux_partage / 100;
|
||||||
$transaction->part_reseau_payeur = $frais * $reseauPayeur->taux_partage / 100;
|
$transaction->part_reseau_emetteur = $frais - $transaction->part_reseau_payeur;
|
||||||
$transaction->part_reseau_emetteur = $frais - $transaction->part_reseau_payeur;
|
|
||||||
} else {
|
|
||||||
$transaction->part_reseau_payeur = 0;
|
|
||||||
$transaction->part_reseau_emetteur = $frais;
|
|
||||||
}
|
|
||||||
$transaction->part_reseau_payeur_final_country = $this->toMoneyAmount($transaction->part_reseau_payeur, $init_country, $request->final_country);
|
$transaction->part_reseau_payeur_final_country = $this->toMoneyAmount($transaction->part_reseau_payeur, $init_country, $request->final_country);
|
||||||
if (isset($reseauPayeur))
|
if (isset($reseauPayeur))
|
||||||
$reseauPayeur->balance_com += $transaction->part_reseau_payeur_final_country;
|
$reseauPayeur->balance_com += $transaction->part_reseau_payeur_final_country;
|
||||||
|
@ -819,12 +815,12 @@ class iLinkTransactionController extends Controller
|
||||||
$walletHyperviseur->save();
|
$walletHyperviseur->save();
|
||||||
$transaction->id_transaction = $this->getTransactionID();
|
$transaction->id_transaction = $this->getTransactionID();
|
||||||
$transaction->save();
|
$transaction->save();
|
||||||
$message = trans('messages.successful_agent_send_cash',
|
$message = trans('messages.successful_agent_send_cash',
|
||||||
['sender_name' => $request->prenom_emetteur . ' ' . $request->nom_emetteur, 'receiver_name' => $request->prenom_destinataire . ' ' . $request->nom_destinataire,
|
['sender_name' => $request->prenom_emetteur . ' ' . $request->nom_emetteur, 'receiver_name' => $request->prenom_destinataire . ' ' . $request->nom_destinataire,
|
||||||
'id_transaction' => $transaction->id_transaction, 'amount' => $this->toMoney($transaction->montant, $init_country), 'net_init' => $this->toMoney($montantRetrait, $init_country),
|
'id_transaction' => $transaction->id_transaction, 'amount' => $this->toMoney($transaction->montant, $init_country), 'net_init' => $this->toMoney($montantRetrait, $init_country),
|
||||||
'net_final' => $this->toMoneyWithCurrency($montantRetrait, $init_country, $request->final_country), 'fees' => $this->toMoney($frais + $taxe, $init_country), 'init_country' => $this->getCountryName($init_country),
|
'net_final' => $this->toMoneyWithCurrency($montantRetrait, $init_country, $request->final_country), 'fees' => $this->toMoney($frais + $taxe, $init_country), 'init_country' => $this->getCountryName($init_country),
|
||||||
'final_country' => $this->getCountryName($request->final_country),'code' => wordwrap($code_retrait, 4, ' ', true)]);
|
'final_country' => $this->getCountryName($request->final_country), 'code' => wordwrap($code_retrait, 4, ' ', true)]);
|
||||||
$this->sendMail($request->email_emetteur, trans('messages.successful_transaction'),$message);
|
$this->sendMail($request->email_emetteur, trans('messages.successful_transaction'), $message);
|
||||||
return $this->successResponse($message . trans('messages.sent_by_mail'));
|
return $this->successResponse($message . trans('messages.sent_by_mail'));
|
||||||
} else {
|
} else {
|
||||||
return $this->errorResponse(trans('messages.incorrect_user_password'));
|
return $this->errorResponse(trans('messages.incorrect_user_password'));
|
||||||
|
@ -981,12 +977,12 @@ class iLinkTransactionController extends Controller
|
||||||
'user_code' => 'required',
|
'user_code' => 'required',
|
||||||
]);
|
]);
|
||||||
$user = User::where('user_code', $request->user_code)->first();
|
$user = User::where('user_code', $request->user_code)->first();
|
||||||
if(!$user)
|
if (!$user)
|
||||||
return $this->errorResponse(trans('errors.wallet_not_defined'));
|
return $this->errorResponse(trans('errors.wallet_not_defined'));
|
||||||
$final_country = $user->network->country->id;
|
$final_country = $user->network->country->id;
|
||||||
$frais = ($init_country != $final_country) ? $this->calculateFees($plr_agent_depot_wallet_ilink, $request->montant) : $this->calculateFees($plr_agent_depot_wallet_ilink_national, $request->montant);
|
$frais = ($init_country != $final_country) ? $this->calculateFees($plr_agent_depot_wallet_ilink, $request->montant) : $this->calculateFees($plr_agent_depot_wallet_ilink_national, $request->montant);
|
||||||
$taxe = ($init_country!= $final_country) ? $this->calculateTax($taxesInternationales, $frais) : $this->calculateTax($taxesNationales, $frais);
|
$taxe = ($init_country != $final_country) ? $this->calculateTax($taxesInternationales, $frais) : $this->calculateTax($taxesNationales, $frais);
|
||||||
$data['frais'] = $frais +$taxe;
|
$data['frais'] = $frais + $taxe;
|
||||||
$data['montant_net_init'] = $request->montant - $frais - $taxe;
|
$data['montant_net_init'] = $request->montant - $frais - $taxe;
|
||||||
$data['montant_net_final'] = $this->toMoneyWithCurrency($data['montant_net_init'], $init_country, $final_country);
|
$data['montant_net_final'] = $this->toMoneyWithCurrency($data['montant_net_init'], $init_country, $final_country);
|
||||||
return $this->successResponse($data);
|
return $this->successResponse($data);
|
||||||
|
@ -996,7 +992,7 @@ class iLinkTransactionController extends Controller
|
||||||
'final_country' => 'required|integer|min:0|not_in:0',
|
'final_country' => 'required|integer|min:0|not_in:0',
|
||||||
]);
|
]);
|
||||||
$frais = ($init_country != $request->final_country) ? $this->calculateFees($plr_agent_depot_autre_wallet, $request->montant) : $this->calculateFees($plr_agent_depot_autre_wallet_national, $request->montant);
|
$frais = ($init_country != $request->final_country) ? $this->calculateFees($plr_agent_depot_autre_wallet, $request->montant) : $this->calculateFees($plr_agent_depot_autre_wallet_national, $request->montant);
|
||||||
$taxe = ($init_country != $request->final_country) ? $this->calculateTax($taxesInternationales, $frais) : $this->calculateTax($taxesNationales, $frais);
|
$taxe = ($init_country != $request->final_country) ? $this->calculateTax($taxesInternationales, $frais) : $this->calculateTax($taxesNationales, $frais);
|
||||||
$data['frais'] = $frais + $taxe;
|
$data['frais'] = $frais + $taxe;
|
||||||
$data['montant_net_init'] = $request->montant - $frais - $taxe;
|
$data['montant_net_init'] = $request->montant - $frais - $taxe;
|
||||||
$data['montant_net_final'] = $this->toMoneyWithCurrency($data['montant_net_init'], $init_country, $request->final_country);
|
$data['montant_net_final'] = $this->toMoneyWithCurrency($data['montant_net_init'], $init_country, $request->final_country);
|
||||||
|
@ -1023,15 +1019,16 @@ class iLinkTransactionController extends Controller
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTransactionRetrait(Request $request){
|
public function getTransactionRetrait(Request $request)
|
||||||
|
{
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'id_transaction' =>'required',
|
'id_transaction' => 'required',
|
||||||
'id_wallet_agent' => 'required|integer|min:0|not_in:0',
|
'id_wallet_agent' => 'required|integer|min:0|not_in:0',
|
||||||
]);
|
]);
|
||||||
$transaction = WalletIlinkTransaction::select('nom_destinataire' , 'prenom_destinataire' ,'type_document_destinataire','id_document_destinataire' ,'type',
|
$transaction = WalletIlinkTransaction::select('nom_destinataire', 'prenom_destinataire', 'type_document_destinataire', 'id_document_destinataire', 'type',
|
||||||
'id_wallet_user','init_country' , 'final_country')->where('id_transaction',$request->id_transaction)->first();
|
'id_wallet_user', 'init_country', 'final_country')->where('id_transaction', $request->id_transaction)->first();
|
||||||
|
|
||||||
if(!$transaction)
|
if (!$transaction)
|
||||||
return $this->errorResponse(trans('errors.transaction_not_exist'), Response::HTTP_NOT_FOUND);
|
return $this->errorResponse(trans('errors.transaction_not_exist'), Response::HTTP_NOT_FOUND);
|
||||||
|
|
||||||
if ($transaction->status_retrait != 0)
|
if ($transaction->status_retrait != 0)
|
||||||
|
@ -1040,17 +1037,18 @@ class iLinkTransactionController extends Controller
|
||||||
$walletAgent = Wallet::findOrFail($request->get('id_wallet_agent'));
|
$walletAgent = Wallet::findOrFail($request->get('id_wallet_agent'));
|
||||||
$network_agent = NetworksAgent::findOrFail($walletAgent->id_networkAgent);
|
$network_agent = NetworksAgent::findOrFail($walletAgent->id_networkAgent);
|
||||||
$agent_country = $network_agent->network->country->id;
|
$agent_country = $network_agent->network->country->id;
|
||||||
if($transaction->type != 11)
|
if ($transaction->type != 11)
|
||||||
if($agent_country != $transaction->final_country)
|
if ($agent_country != $transaction->final_country)
|
||||||
return $this->errorResponse(trans('errors.operation_cannot_performed_in_country'));
|
return $this->errorResponse(trans('errors.operation_cannot_performed_in_country'));
|
||||||
|
|
||||||
|
|
||||||
$data = $transaction->replicate();
|
$data = $transaction->replicate();
|
||||||
if($transaction->type == 9){
|
if (in_array($transaction->type, [9, 11])) {
|
||||||
$data->nom_destinataire = $transaction->wallet_user->user->lastname;
|
$data->nom_destinataire = $transaction->wallet_user->user->lastname;
|
||||||
$data->prenom_destinataire = $transaction->wallet_user->user->firstname;
|
$data->prenom_destinataire = $transaction->wallet_user->user->firstname;
|
||||||
$data->user_code = $transaction->wallet_user->user->user_code;
|
$data->user_code = $transaction->wallet_user->user->user_code;
|
||||||
}
|
}
|
||||||
|
unset($data->type, $data->init_country, $data->final_country, $data->id_wallet_user);
|
||||||
|
|
||||||
return $this->successResponse($data);
|
return $this->successResponse($data);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue