1. Go to this page and download the library: Download reefki/laravel-flip library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
reefki / laravel-flip example snippets
use Reefki\Flip\Facades\Flip;
// Always check the deposit balance first
$balance = Flip::balance()->get(); // ['balance' => 49656053]
// Find a recipient bank
$bca = Flip::banks()->find('bca'); // operational status, fee, queue
// Verify the account holder name (cached → sync; uncached → callback)
$inquiry = Flip::disbursement()->inquiry('5465327020', 'bca');
// Create a disbursement (idempotency key is
Flip::balance()->get(); // ['balance' => int]
Flip::banks()->list(); // all banks
Flip::banks()->list('bca'); // filter by code
Flip::banks()->find('bca'); // single entry, or null
// Force a v2 disbursement create even if FLIP_VERSION=v3
Flip::disbursement()->withVersion('v2')->create($payload, 'idem-1');
// Or for an entire facade chain
Flip::useVersion('v2')->disbursement()->list();
use Illuminate\Http\Request;
use Reefki\Flip\Facades\Flip;
use Reefki\Flip\Exceptions\InvalidWebhookSignatureException;
Route::post('/webhooks/flip/disbursement', function (Request $request) {
try {
$payload = Flip::webhook()->verify($request);
} catch (InvalidWebhookSignatureException) {
abort(403);
}
// $payload is the decoded `data` array
// ['id' => '1234567890123456789', 'status' => 'DONE', 'amount' => '10000', ...]
Disbursement::where('flip_id', $payload['id'])->update([
'status' => $payload['status'],
'reason' => $payload['reason'] ?? null,
'time_served' => $payload['time_served'] ?? null,
]);
return response()->noContent(); // Flip retries non-200s 5x at 2-min intervals
});
if (Flip::webhook()->isValid($request->input('token'))) {
// ...
}