PHP code example of memberflow / plorea

1. Go to this page and download the library: Download memberflow/plorea 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/ */

    

memberflow / plorea example snippets


use MemberFlow\Plorea\Data\Amount;
use MemberFlow\Plorea\Facades\Plorea;

$link = Plorea::payments()
    ->link('FIN-2026-00123', 'Faktura FIN-2026-00123', Amount::nok(450000), 'https://app.example/paid')
    ->payerEmail('[email protected]')
    ->merchant(orgNr: '999999999', name: 'Acme Gym AS')
    ->firstOrCreate();

return redirect($link->url);

return response()->json(Plorea::payByLink()->session($link->id, $returnUrl, Channel::Android));
// {"sessionId": ..., "sessionData": ..., "clientKey": ..., "environment": ...} — and nothing else

Plorea::fake();

// ... exercise your code ...

Plorea::assertSent('payments/link');
Plorea::assertSent(fn ($request) => $request->input('amount') === 50000);