PHP code example of rayanpay / rayan-gate
1. Go to this page and download the library: Download rayanpay/rayan-gate 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/ */
rayanpay / rayan-gate example snippets
`
Route::get('/payment', function () {
$payment_request = new \Rayanpay\RayanGate\Objects\PaymentRequest();
$payment_request->setDescription(json_encode(["name"=>"shahriar","lastname"=>"pahlevansadgh"]));
$payment_request->setAmount( 15000);
$payment_request->setEmail("[email protected]");
$payment_request->setMobile( "989120308527");
$result = \Rayanpay\RayanGate\Services\RayanPayServices::request($payment_request);
if(data_get($result,"Status") == 100)
\Rayanpay\RayanGate\Services\RayanPayServices::redirect(data_get($result,"StartPay"));
return response()->json($result,200);
});