Created
April 11, 2021 14:08
-
-
Save AmirrezaNasiri/6755ff7379e589fb7ea31f6e86642c1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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