fix: missing recipient while doing ilink world transaction v4
This commit is contained in:
parent
20a23ea373
commit
b653f158d6
|
@ -267,9 +267,6 @@ class iLinkTransactionController extends Controller
|
|||
|
||||
$frais = ($init_country != $request->final_country) ? $this->calculateFees($plr_user_wallet_wallet, $request->montant) : $this->calculateFees($plr_user_wallet_wallet_national, $request->montant);
|
||||
$reseauPayeur = PayingNetwork::where('id_network', $request->network_destinataire)->where('id_configWallet', $config->id)->first();
|
||||
if(empty($reseauPayeur)){
|
||||
return $this->errorResponse(__('errors.service_unavailable_in_country'));
|
||||
}
|
||||
$configPayeur = ConfigWallet::where('id_network', $request->network_destinataire)->firstOrFail();
|
||||
|
||||
$fees = 0;
|
||||
|
@ -291,6 +288,12 @@ class iLinkTransactionController extends Controller
|
|||
$transaction->montant_net = $montantDepot = $transaction->montant - $frais - $taxe;
|
||||
$transaction->montant_net_final_country = $this->toMoneyAmount($montantDepot, $init_country, $request->final_country);
|
||||
|
||||
// Verifier si le reseau payeur existe si c'est pas un reseau ilink
|
||||
if ($configPayeur->type != 'ilink' && empty($reseauPayeur)) {
|
||||
return $this->errorResponse(__('errors.service_unavailable_in_country'));
|
||||
}
|
||||
|
||||
|
||||
if (isset($reseauPayeur)) {
|
||||
$transaction->part_reseau_payeur = $frais * $reseauPayeur->taux_partage / 100;
|
||||
$transaction->part_reseau_payeur_final_country = $this->toMoneyAmount($transaction->part_reseau_payeur, $init_country, $request->final_country);
|
||||
|
|
Loading…
Reference in New Issue