Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AmirrezaNasiri/6755ff7379e589fb7ea31f6e86642c1a to your computer and use it in GitHub Desktop.
Save AmirrezaNasiri/6755ff7379e589fb7ea31f6e86642c1a to your computer and use it in GitHub Desktop.
<?php
use Evryn\LaravelToman\Facades\Toman;
// ...
$request = Toman::amount(1000)
// ->description('Subscribing to Plan A')
// ->callback(route('payment.callback'))
// ->mobile('09350000000')
// ->email('amirreza@example.com')
->request();
if ($request->successful()) {
// Store created transaction details for verification
$transactionId = $request->transactionId();
// Redirect to payment URL
return $request->pay();
}
if ($request->failed()) {
// Handle transaction request failure.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment