+ Add User - Envoi de wallet à carte

This commit is contained in:
Djery-Tom 2020-06-26 17:55:56 +01:00
parent 0f6da25c0b
commit 126239ff8f
4 changed files with 50 additions and 27 deletions

View File

@ -233,7 +233,10 @@ class iLinkTransactionController extends Controller
['id_transaction' => $transaction->id_transaction, 'amount' => $this->toMoney($transaction->montant, $init_country), ['id_transaction' => $transaction->id_transaction, 'amount' => $this->toMoney($transaction->montant, $init_country),
'net' => $this->toMoney($montantDepot, $init_country), 'fees' => $this->toMoney($frais, $init_country), 'net' => $this->toMoney($montantDepot, $init_country), 'fees' => $this->toMoney($frais, $init_country),
'sender_code' => $user->user_code, 'cart_number' => wordwrap($request->numero_carte, 4, ' ', true)])); 'sender_code' => $user->user_code, 'cart_number' => wordwrap($request->numero_carte, 4, ' ', true)]));
return $this->successResponse(trans('messages.successful_transaction')); return $this->successResponse(trans('messages.successful_user_send_to_cart_2',
['amount' => $this->toMoney($transaction->montant, $init_country),
'net' => $this->toMoney($montantDepot, $init_country), 'fees' => $this->toMoney($frais, $init_country),
'sender_code' => $user->user_code, 'cart_number' => wordwrap($request->numero_carte, 4, ' ', true)]));
} else { } else {
return $this->errorResponse(trans('errors.visa_api_failed'), Response::HTTP_INTERNAL_SERVER_ERROR); return $this->errorResponse(trans('errors.visa_api_failed'), Response::HTTP_INTERNAL_SERVER_ERROR);

View File

@ -91,7 +91,7 @@ trait Helper
$converter = new CurrencyConverter($provider); $converter = new CurrencyConverter($provider);
$init_country = Country::findOrFail($init_country); $init_country = Country::findOrFail($init_country);
$final_country = Country::findOrFail($final_country); $final_country = Country::findOrFail($final_country);
$init_money = Money::of(round(str_replace(',' , '',number_format($amount,2)), 2),$init_country->currency->code,new AutoContext()); $init_money = Money::of(round($amount, 2),$init_country->currency->code,new AutoContext());
return $converter->convert($init_money, $final_country->currency->code, RoundingMode::DOWN); return $converter->convert($init_money, $final_country->currency->code, RoundingMode::DOWN);
} }

View File

@ -49,29 +49,40 @@ Transaction information:
Transaction information : Transaction information :
- Transaction ID : :id_transaction - Transaction ID : :id_transaction
- Amount of the transaction : :amount - Amount of the transaction : :amount
- Fees + Taxes : :fees
- Country of departure : :init_country - Country of departure : :init_country
- Net amount of the country of departure : :net_init - Net amount of the country of departure : :net_init
- Country of destination : :final_country - Country of destination : :final_country
- Net amount of the destination country : :net_final - Net amount of the destination country : :net_final
- Fees + Tax : :fees - Issuer account : :sender_code
- Number of the sending wallet: :sender_code - Recipient account : :receiver_code',
- Number of the recipient wallet: :receiver_code',
'successful_user_send_to_wallet_2' => 'Money sent to a wallet. 'successful_user_send_to_wallet_2' => 'Money sent to a wallet.
Transaction information : Transaction information :
- Amount of the transaction : :amount - Amount of the transaction : :amount
- Fees + Taxes : :fees
- Country of departure: :init_country - Country of departure: :init_country
- Net amount of the country of departure : :net_init - Net amount of the country of departure : :net_init
- Country of destination : :final_country - Country of destination : :final_country
- Net amount of the destination country : :net_final - Net amount of the destination country : :net_final
- Fees + Tax : :fees - Issuer account : :sender_code
- Number of the sending wallet: :sender_code - Recipient account : :receiver_code
- Number of the recipient wallet: :receiver_code',
This message was sent to the sender\'s email',
'successful_user_send_to_cart' => 'Sending money to a visa card made. 'successful_user_send_to_cart' => 'Sending money to a visa card made.
Transaction information : Transaction information :
- Transaction ID : :id_transaction - Transaction ID : :id_transaction
- Amount of the transaction : :amount - Amount of the transaction : :amount
- Net shipping amount: :net
- Fees : :fees - Fees : :fees
- Number of the sending wallet: :sender_code - Net shipping amount : :net
- Issuer account :sender_code
- Recipient\'s card number: :cart_number', - Recipient\'s card number: :cart_number',
'successful_user_send_to_cart_2' => 'Sending money to a visa card made.
Transaction information :
- Amount of the transaction : :amount
- Fees : :fees
- Net shipping amount : :net
- Issuer account :sender_code
- Recipient\'s card number: :cart_number
This message was sent to the sender\'s email',
]; ];

View File

@ -49,29 +49,38 @@ Informations de la transaction :
Informations de la transaction : Informations de la transaction :
- Transaction ID : :id_transaction - Transaction ID : :id_transaction
- Montant de la transaction : :amount - Montant de la transaction : :amount
- Frais et Taxes : :fees
- Pays de départ : :init_country - Pays de départ : :init_country
- Montant net du pays de départ : :net_init - Montant net du pays de départ : :net_init
- Pays de destination : :final_country - Pays de destination : :final_country
- Montant net du pays de destination : :net_final - Montant net du pays de destination : :net_final
- Frais et Taxe : :fees - Compte émetteur : :sender_code
- Numero du wallet émetteur : :sender_code - Compte destinataire : :receiver_code',
- Numero du wallet destinataire : :receiver_code',
'successful_user_send_to_wallet_2' => 'Envoi d\'argent vers un wallet effectué. 'successful_user_send_to_wallet_2' => 'Envoi d\'argent vers un wallet effectué.
Informations de la transaction : Informations de la transaction :
- Montant de la transaction : :amount - Montant de la transaction : :amount
- Frais et Taxes : :fees
- Pays de départ : :init_country - Pays de départ : :init_country
- Montant net du pays de départ : :net_init - Montant net du pays de départ : :net_init
- Pays de destination : :final_country - Pays de destination : :final_country
- Montant net du pays de destination : :net_final - Montant net du pays de destination : :net_final
- Frais et Taxe : :fees - Compte émetteur : :sender_code
- Numero du wallet émetteur : :sender_code - Compte destinataire : :receiver_code
- Numero du wallet destinataire : :receiver_code',
Ce message a été envoyé dans le mail de l\'émetteur',
'successful_user_send_to_cart' => 'Envoi d\'argent vers une carte visa effectué. 'successful_user_send_to_cart' => 'Envoi d\'argent vers une carte visa effectué.
Informations de la transaction : Informations de la transaction :
- Transaction ID : :id_transaction - Transaction ID : :id_transaction
- Montant de la transaction : :amount - Montant de la transaction : :amount
- Montant net d\'envoi: :net
- Frais : :fees - Frais : :fees
- Montant net d\'envoi: :net
- Compte émetteur : :sender_code
- Numero de la carte du destinataire : :cart_number',
'successful_user_send_to_cart_2' => 'Envoi d\'argent vers une carte visa effectué.
Informations de la transaction :
- Montant de la transaction : :amount
- Frais : :fees
- Montant net d\'envoi: :net
- Numero du wallet émetteur : :sender_code - Numero du wallet émetteur : :sender_code
- Numero de la carte du destinataire : :cart_number', - Numero de la carte du destinataire : :cart_number',
]; ];