پکیج لاراولی درگاه آلسات پرداخت
راهنمای نصب پکیج درگاه پرداخت آلسات پرداخت : Install this package with composer
composer require alsatpardakht/payment
You should publish and run the migrations with:
php artisan vendor:publish --provider="Alsatpardakht\Payment\PaymentServiceProvider" --tag="migrations"
php artisan migrate
$pay = new Paymethods();
$params = [
'Api' => env('payApi'),
'Amount' => $payAmount,
'RedirectAddress' => route('buyPayVerify'),
'InvoiceNumber' => $order->InvoiceNumber
];
return $pay->getPayUrl($params);
$pay = new Paymethods();
$response = $pay->verifyPay($request, env('payApi'));
$order =
$payLink = Paylink::where('InvoiceNumber', $request->iN)->first();
if ($response->getStatusCode() == 405) {
//some problem occurred
} else if($response->getStatusCode() == 200) {
//it is true
}
در متد بالا اگر ریسپانس شما 405 باشد پرداخت با مشکل مواجه شده است در صورتی که 200 از ریسپانس برگشت داده شود یعنی وریفای انجام شده است.
more methods:
1-getPayLinks($InvoiceNumber);
2-getPayLinksWithPaginate($InvoiceNumber,$count);
3-getPayVerify($InvoiceNumber);
4-getPayVerifyWithPaginate($InvoiceNumber,$count);