Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/code4mk/lara-sslcommerz

Laravel sslcommerz payment . SSLCOMMERZ is a bangladeshi payment gateway provider.
https://github.com/code4mk/lara-sslcommerz

bd-payment laravel laravel-package laravel-sslcommerz laravel-sslcommerz-payment sslcommerz sslcommerz-laravel sslcommerz-payment-gateway

Last synced: 2 days ago
JSON representation

Laravel sslcommerz payment . SSLCOMMERZ is a bangladeshi payment gateway provider.

Awesome Lists containing this project

README

        

customer('kamal212')
->amount(100)
->emi(4,5,1)
->getRedirectUrl();

if( $data->failedreason == "") {
$link = $data->GatewayPageURL;
return response()->json($link);
}else{
// your code
return response()->json($data->failedreason);
}
```

## methods

* emi($max_inst = '',$selected_inst = '',$allow_only = '')
* customer($name = '', $email = '', $phone = '', $add1 = '', $city = '', $post_code = '', $country = '')

# verify payment (`post method`) - success URL

```bash
http://127.0.0.1:8000/success
```

```php
use SslPayment;
$data = SslPayment::verify(request());
// return response()->json($data);
if ($data->status == 'VALID') {
// your business logic
}
```

# ipn payment verify

create a post route for ipn and csrf free

* [ipn doc sslcommerz](https://developer.sslcommerz.com/doc/v4/#validate-payment-with-ipn)

```php
/* you can get success objects which triggers by sslcomerz.
you can
*/
Route::post('ipn',function(){
return response()->json(request());
})
```

# csrf

* enable csrf free for your success route

ex : (VerifyCsrfToken.php)

```php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;

class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'/success',
'/ipn'
];
}

```

# Any query

* [email protected]