javad/ir-kish

There is no license information available for the latest version (dev-main) of this package.

a package for using iran kish gateway

dev-main 2021-11-10 06:40 UTC

This package is auto-updated.

Last update: 2024-09-10 14:11:24 UTC


README

a simple package for usnig irankish gateway.

پکیج درگاه پرداخت ایران کیش برای لاراول

Installation

Use the composer to install irankish-laravel.

composer require javad/ir-kish

publish config file

php artisan vendor:publish --provider=MJSeydi\iranKish\IranKishServiceProvider

Usage

use MJSeydi\iranKish\Facades\IranKish;

# getting the token from irankish 
# you must save $orderId in your database for verify the payment
$response = IranKish::getIranKishToken($Amount,$orderId);
if ($response["responseCode"] != "00") {
     # you have error!
}else{
     $token = $response['result']['token'];
     # in you view you must have a form like this
     /*
<form action="https://ikc.shaparak.ir/iuiv3/IPG/Index/" method="POST">
   <input type="hidden" name="tokenIdentity" value="{{$token}}" />
   <input type="submit" value="ورود به درگاه پرداخت" />
</form>
    */
}

verify payment

use MJSeydi\iranKish\Facades\IranKish;

# all parameter will send to you by POST method 
$response = IranKish::verifyPayment($request->verifySaleReferenceId,
$request->systemTraceAuditNumber, $request->token);
#your order id is on the $request->orderId
if ($response["responseCode"] != 0 && $response["responseCode"] != "00") {
     # you have error!
}else{
     echo "success";
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.