Download the PHP package sama-ir/sama-laravel-payment without Composer
On this page you can find all versions of the php package sama-ir/sama-laravel-payment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sama-ir/sama-laravel-payment
More information about sama-ir/sama-laravel-payment
Files in sama-ir/sama-laravel-payment
Package sama-laravel-payment
Short Description Sama gateway library for Laravel.
License MIT
Homepage https://github.com/sama-ir/sama-laravel-payment
Informations about the package sama-laravel-payment
درگاه پرداخت سما | Sama Payment Gateway
Sama Gateway library for Laravel based on Sama API
کتابخانه درگاه پرداخت سما برای لاراول براساس ایپیآی سما
روش نصب - Installation
Use composer to install this package
برای نصب و استفاده از این پکیج می توانید از کامپوزر استفاده کنید
تنظیمات - Configuration
You need a token to use Sama web services, you can get this token according to Sama documentation.
برای استفاده از سرویس های سما نیاز به یک توکن دارید، این توکن را می توانید طبق مستندات سما دریافت کنید.
Add your token to .env file.
توکن خود را به فایل env اضافه کنید.
You can also set token at runtime.
امکان تعیین توکن در حین اجرا نیز وجود دارد که در ادامه توضیح داده خواهد شد.
روش استفاده | How to use
برای استفاده از سرویس پرداخت امن سما، لازم است وب سایت فروشگاه یک درخواست ایجاد لینک پرداخت به همراه «آدرس بازگشت فروشگاه» به سما ارسال کند. سما در پاسخ یک آدرس پرداخت ارسال می کند که فروشگاه، کاربر خریدار را به آن هدایت خواهد کرد. بعد از مشخص شدن نتیجه پرداخت، سما کاربر را به «آدرس بازگشت فروشگاه» هدایت خواهد کرد.
ارسال مشتری به درگاه پرداخت | Send customer to payment gateway
در روال پرداخت با سما، وب سایت فروشگاه ابتدا یک درخواست ایجاد لینک پرداخت به سما ارسال می کند. این درخواست شامل مبلغ تراکنش، یک مقدار شناسه یکتا به ازای هر درخواست پرداخت، «آدرس بازگشت فروشگاه» پس از پرداخت است. در پاسخ فراخوانی وب سرویس یک لینک پرداخت دریافت می شود که فروشگاه کاربر پرداخت کننده را به آن لینک پرداخت هدایت کند. «آدرس بازگشت فروشگاه» آدرسی است که در بخش بررسی وضعیت تراکنش اجرا خواهد شد.
بررسی وضعیت تراکنش | Verify payment status
پس از مشخص شدن نتیجه پرداخت سما کاربر خریدار را با متد POST به «آدرس بازگشت فروشگاه» هدایت می کند، نمونه کد برای بررسی وضعیت تراکنش مشابه زیر خواهد بود: