Package
yativo/fiat-sdk-laravelRequires
Laravel 10–13, PHP 8.1+ (8.2+ for Laravel 11 and newer)
Source
Yativo/yativo-fiat-laravel
Install
Configure
Add your API key to.env. The key needs your server’s IP on its IP whitelist.
.env
php artisan config:clear after changing .env if you cache your config.
Make your first request
\Yativo\Fiat\Yativo:
Accept a payment
1
Find a payment method
Look up the method for your customer’s country and currency once, and keep its
id.2
Create the deposit and redirect
amount is in the method’s currency. currency is the wallet you’re credited in.3
Confirm when the customer returns
Never trust the redirect alone: read the deposit.
Webhooks become Laravel events
The package servesPOST /webhooks/yativo in the api middleware group and checks every signature. Register the URL once and put the returned secret in YATIVO_WEBHOOK_SECRET:
Yativo\Fiat\Laravel\Events\WebhookReceived and yativo.{type}, such as yativo.deposit.updated:
- Duplicate deliveries are skipped using your cache. A delivery is only remembered after your listeners succeed, so a failure is retried.
- A bad signature gets
401and never reaches your listeners. - Change the path with
YATIVO_WEBHOOK_PATH, or setYATIVO_WEBHOOK_ROUTE=falseand addRoute::yativoWebhooks('your/path');yourself.
Everyday tasks
Every method of the PHP SDK is on the facade:$yativo->cardCheckout->createOrder() becomes Yativo::cardCheckout()->createOrder().
Errors
Configuration
Test your app
Send a signed webhook in a feature test:Yativo::sandbox()->simulateWebhook('payin').
