BVN stands for Bank Verification Number and it is the prerogative of every Nigeria who is of age to have one.
BVN stands for Bank Verification Number and it is the prerogative of every Nigeria who is of age to have one.
Read lessLost your password? Please enter your email address. You will receive a link and will create a new password via email.
Sorry, you do not have a permission to ask a question, You must login to ask question.
We want to connect the people who have knowledge to the people who need it, to bring together people with different perspectives so they can understand each other better, and to empower everyone to share their knowledge.
BVN stands for Bank Verification Number and it is the prerogative of every Nigeria who is of age to have one.
BVN stands for Bank Verification Number and it is the prerogative of every Nigeria who is of age to have one.
Read lessI had some friends come over today and I want to entertain the guys with games. I have the installation package for FIFA19 on my system, but what is stopping me from whopping their a** is installation instruction… Any links, Video or ...Read more
I had some friends come over today and I want to entertain the guys with games.
I have the installation package for FIFA19 on my system, but what is stopping me from whopping their a** is installation instruction…
Any links, Video or guideline will be appreciated since I have the installation package.
Read lessI inherited a project recently written in laravel 5.8 to be precise, at this time, laravel has moved on to version 7, but my main issue here is how to setup flutterwave webhook (A very efficient ...Read more
I inherited a project recently written in laravel 5.8 to be precise, at this time, laravel has moved on to version 7, but my main issue here is how to setup flutterwave webhook (A very efficient Nigerian payment gateway) to work in this project, the previous developer had started work on it. After many attempts and reaching out to the rave team.
I’ll be sharing a step-by-step process of how to do that successfully, from the A-Z. Before now a laravel package had been created for this purpose, its called kingflamez/laravelrave or check the official docs. Follow the steps to get the rave package into your laravel project.
First, create a controller in laravel and call it RaveController with this command
php artisan make:controller RaveController
If you correctly setup your flutterwave composer package, you should have the file rave.php in your config folder in laravel i.e. config/rave.php. Also your environment variables ( .env file) need to be setup correctly too as this
RAVE_PUBLIC_KEY=FLWPUBK_TEST-xxxxxxx
RAVE_SECRET_KEY=FLWSECK_TEST-XXXXXXX
RAVE_TITLE="Name of your Company"
RAVE_ENVIRONMENT="test/live --(choose anyone)"
RAVE_LOGO="link to the rave logo"
RAVE_PREFIX="rave"
RAVE_SECRET_HASH='your secret hash string'
Once all these are setup properly, let’s proceed to the rave controller that you have created. Assume that you have a TransactionHistory model and thus a table in your database names transactionhistory.
First, rave looks for the initialize method, therefore, you should generate your transaction reference in this method before sending to the webhook. Generate a prefix, this is provided by the rave package, and save all the created objects to the database like the code below
<?php namespace App\Http\Controllers; use App\TransactionHistory; use App\User; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Rave; class RaveController extends Controller { /** * Initialize Rave payment process * @return void */ public function initialize() { request()->validate([ 'phone' => 'sometimes|required|min:11|starts_with:0', 'category' => 'sometimes|required|string', 'product_id' => 'sometimes|required|integer', 'amount' => 'sometimes|required|integer', ], ['phone.starts_with' => ' :attribute number must begin with 0. e.g 070123456789', 'amount.integer' => ' :attribute number must be a number']); $prefix = config()->get('rave.prefix'); $transactionPrefix = $prefix . '_'; request()->request->add(['user_id' => auth()->user()->id]); request()->request->add(['ref' => uniqid($transactionPrefix)]); TransactionHistory::create(request()->all()); Rave::initialize(route('callback')); } /** * Obtain Rave callback information * @return void */ public function callback() { $res_json = json_decode(request()->request->get('resp')); $txref = $res_json->data->data->txRef; $data = Rave::verifyTransaction($txref); $chargeResponsecode = $data->data->chargecode; $transaction = TransactionHistory::where('ref', $txref)->first(); if (($chargeResponsecode == "00" || $chargeResponsecode == "0")) { $user = User::whereId($transaction->user_id)->first(); $referred_by = ''; $transaction->update([ 'status' => 'paid', ]); return redirect()->route('home')->withSuccess('Wallet top-up successful.'); } else { return redirect()->route('home')->withErrors(['Something went wrong.']); } } }
You can write the webhook function just before the callback function. The web-hook automatically runs as a background service, you don’t get to see how it happens except you use a logger which is also provided by laravel.
Also, for the webhook to work, your RAVE_SECRET_HASH=’your secret hash string’ in your .env file must be the same as on your rave dashboard — (go to settings on your dashboard, and click the webhooks tab.
Your url should look like this; https://yourdomainname/rave/receive
public function webhook(){
$data = Rave::receiveWebhook();
$txref = $data['txRef'];
if ($data['status'] == 'successful') {
$transaction = TransactionHistory::where('ref', $txref)- >first();
$user = User::whereId($transaction->user_id)->first();
//give your user value here
$transaction->update([
'flwref' => $data['flwRef'],
'type' => $data['event.type'],
]);
}
}
Also, we need to update the VerifyCsrfToken.php file to exempt the POST call of the webhook from using the CSRF which is the custom behaviour of all POST method calls in laravel. Head on to app/Http/VerifyCsrfToken.php and add the following code
protected $except = [ 'rave/callback', 'rave/receive', ];
Finally, we need to create a route of this to work. In the routes/web.php file , add this
Route::post(‘/pay’, ‘RaveController@initialize’)->name(‘pay’); Route::get(‘/rave/callback’, ‘RaveController@callback’)->name(‘callback’);
And that’s all….., you’re done.
Let’s talk about the errors you might encounter.
I had an issue first with the package, because my project is version 5.8, all I needed to do was:
php artisan vendor:publish --provider="KingFlamez\Rave\RaveServiceProvider"
but it didn’t work as expected. (well, after solving this, it will make you a senior developer)When this happens to you, try to clear cache, OR delete the vendor folder and re-install OR use these commands
php artisan cache:clear php artisan config:clear
These two commands are very important. Lastly check the function called receiveWebhook
in the Rave.php file inside the kingflamez/laravelrave/src located in your vendor folder to see if it is the same with the one the official docs on event-webhook has. GOODLUCK
If you need a developer to help you integrate flutterwave to receive payment on your site, you can reach out to Pianistprogrammer on whatsapp +2347030507502 or jeremiahabimbola0@gmail.com
Read lessHow would you feel if your partner suddenly acts out a public display of affection (PDA) on you, especially in this part of the world, (taking Nigeria as a case study)? Many couples in Nigeria don’t do this often because ...Read more
How would you feel if your partner suddenly acts out a public display of affection (PDA) on you, especially in this part of the world, (taking Nigeria as a case study)?
Many couples in Nigeria don’t do this often because of reasons i’m not so sure about. If you have better views on this, please leave a comment
Business ethics refers to the system of ethical principles and rules applicable to business. As a social subject, business activities will not be carried out in a way that harms the interests of society and the business sector itself. Each ...Read more
Business ethics refers to the system of ethical principles and rules applicable to business. As a social subject, business activities will not be carried out in a way that harms the interests of society and the business sector itself. Each profession or group has formulated the rules for its members.
Importance of BUSINESS ETHICS
1: Business ethics help ensure the good reputation of your company. Not only does it feel good to be a member of a prestigious company, it is also good for business. When you have a reputation for consistently complying with ethics in the way you purchase and manufacture products and treat employees, customers, and communities, more people will be willing to do business with you.
2: Companies that practice good business ethics face less risk of fines and other legal issues. Of course, laws and regulations are complicated, but as long as you do some morally correct things, you can avoid many problems. By making business decisions with this in mind, you can avoid the pressure of having to defend your business due to litigation and fines.
3: Business ethics guarantees the development of the company. As long as an entrepreneur strictly abides by the code of ethics, a specific business sector will definitely develop. The company cannot be managed in a way that isn’t conducive to the interests of the society or the company itself. Therefore, the development of a company should have certain business ethics.
4: It’ll make employees to be more motivated to work because they feel that doing so will make the world a better place. Therefore, if you want normal profits to continue to rise until you make a lot of money, you must make your business fully ethical.
5: A reputation based on good ethics helps to establish a positive image in the market. This in turn makes customers trust your products and services. They also pass on information to your friends and family, thus creating more customers for you.
If you want your business to thrive for a long time, running an ethical business is essential. Business ethics and profits are mutually reinforcing. A company that is ethically oriented and wants to dominate its market segments can reap many benefits. However, unethical businesses are doomed to fail even if they start out with a record of high profits. Morality is making relationships better and stronger.
Read lessI woke up this morning, and found that my urine is yellow and I was a bit scared, I then had to find out from a Pharmacist, and this is what he had to say; there are many reasons why ...Read more
I woke up this morning, and found that my urine is yellow and I was a bit scared, I then had to find out from a Pharmacist, and this is what he had to say; there are many reasons why one’s urine can be yellow, in my case, it was lack of enough water, but i will list out other reasons why this could happen.
There are good or poor public display of affection among women. PDA is a hot theme in relationships , particularly between new couples, where they might have had a relationship earlier when something was somewhere and they are now in ...Read more
There are good or poor public display of affection among women. PDA is a hot theme in relationships , particularly between new couples, where they might have had a relationship earlier when something was somewhere and they are now in this new relationship and maybe public affection shows display more than the other person wants or maybe you don’t display enough for them maybe. PDA is sometimes referred to or public affection shows. This is a conversation to have with your significant other so they don’t feel unpleasant and when you’re out in public, kiss or hold your hands, or whatever.
It’s going to depend on the experience of an individual, the culture, and even on religion. Here we talk about the person with whom you are with, not the people around you. The way in which a person has been treated in terms of public display of affection will probably affect his or her ideas on public affairs.
Public showings of affection are therefore inherently good or inherently bad, depending on the preference of the two people. If a couple think that holding their hands in public is not appropriate, then it’s not only for them, but in many parts of the globe, public displays of affection are not only appropriate, but admired.
As I’ve said, there’s no inherently good or bad thing, it’s up to what you both think is right, but you’re always going to get people who get offended by your public displays of affection when you’re out and about in the world , for example, when you’re walking through the park and someone is looking at you and you’re kissing your significant other if they don’t want to see it, considering it should be b.
It might be inappropriate especially for kids, you don’t want to do all kinds of wild things out in public that you really should do behind closed doors like sexual acts.
Read less