Tools
Small helpers that run in your browser. Nothing you type is sent anywhere.
Checkout builder
Checkout builder
Choose how you want to take the payment. You get the controller, and for Inertia the page component too.
use Flutterwave\Payments\Facades\Flutterwave;
public function pay(Order $order)
{
// Sends the customer to Flutterwave's hosted checkout.
// Inertia form posts work too, with no extra code.
return Flutterwave::redirect([
// Your own reference, to match the payment later.
'tx_ref' => $order->reference,
'amount' => $order->total,
'currency' => $order->currency,
'email' => $order->user->email,
'meta' => ['order_id' => $order->id],
]);
}Webhook signature tester
Webhook signature tester
Signs a payload the way Flutterwave does: a base64 HMAC-SHA256 of the raw body, keyed with your secret hash. Check a header you received, or send a test webhook to your app. It all runs in your browser, but use a test secret hash here, not your live one.
Send it to your local app. A charge.completed with a made-up id gets a 500, because the package re-fetches every charge from the API before firing ChargeCompleted. Use a real test transaction id, or php artisan flutterwave:ping-webhook <id>.
curl -X POST 'http://localhost:8000/flutterwave/webhook' \
-H 'Content-Type: application/json' \
-H 'flutterwave-signature: ' \
--data-raw '{
"event": "charge.completed",
"data": {
"id": 4975363,
"tx_ref": "LARAVEL-aB3xQ1729000000",
"flw_ref": "FLW-MOCK-0f1c2d3e4f",
"amount": 5000,
"currency": "NGN",
"charged_amount": 5000,
"status": "successful",
"payment_type": "card",
"customer": {
"id": 2280112,
"email": "customer@example.com"
}
}
}'use Flutterwave\Payments\Facades\Flutterwave;
use Flutterwave\Payments\Testing\FlutterwaveFake;
it('marks the order paid when the charge completes', function () {
// The fake answers the package's re-verification of the charge.
Flutterwave::fake()->transaction(4975363, ['amount' => 5000, 'tx_ref' => 'ORDER-42']);
$this->postJson('/flutterwave/webhook', [
'event' => 'charge.completed',
'data' => ['id' => 4975363, 'tx_ref' => 'ORDER-42', 'status' => 'successful'],
], FlutterwaveFake::webhookHeaders())->assertOk();
});.env builder
.env builder
Pick your settings and copy the block into .env. Nothing you type leaves this page, and defaults are left out so your file stays short.
# Settings > API keys on the Flutterwave dashboard
FLW_PUBLIC_KEY=FLWPUBK_TEST-xxxxxxxx-X
FLW_SECRET_KEY=FLWSECK_TEST-xxxxxxxx-X
FLW_ENCRYPTION_KEY=FLWSECK_TESTxxxxxxxx
# The same value you type into Settings > Webhooks > Secret hash
FLW_SECRET_HASH=choose-a-long-random-string
FLW_ENVIRONMENT=stagingArtisan command builder
Artisan command builder
Pick a command, fill in what you need and copy the line. Arguments and options are read from the package source when the docs are built.
php artisan flutterwave:doctorLooking for a method? Try the service explorer.