PHP code example of gando / partner-symfony

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

    

gando / partner-symfony example snippets


// config/bundles.php
return [
    // ...
    Gando\Partner\Symfony\GandoPartnerBundle::class => ['all' => true],
];

use Gando\Partner\Api\Client;

final class DepositService
{
    public function __construct(
        private readonly Client $gando,
    ) {
    }

    public function listDeposits(): void
    {
        $response = $this->gando->deposits->list(page: 1, limit: 20);
        // ...
    }
}

$url = $this->urlBuilder->signupUrl(externalId: 'fleet_acct_42');

use Gando\Partner\Symfony\Event\DepositActivated;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;

#[AsEventListener]
final class SyncDepositOnActivation
{
    public function __invoke(DepositActivated $event): void
    {
        // Dispatch to Messenger / queue — keep this fast.
    }
}

use Gando\Partner\Symfony\Attribute\GandoWebhook;

#[Route('/custom/webhook', methods: ['POST'])]
#[GandoWebhook]
public function __invoke(Request $request): Response
{
    // ...
}