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

https://github.com/md-asifiqbal/sam-sslcommerz-

SSLCOMMERZ is the largest payment gateway aggregator in Banglades
https://github.com/md-asifiqbal/sam-sslcommerz-

bangladesh-payment laravel payment-gateway sslcommerz

Last synced: 3 months ago
JSON representation

SSLCOMMERZ is the largest payment gateway aggregator in Banglades

Awesome Lists containing this project

README

        

# SSLCommerz
[SSLCommerz](https://www.sslcommerz.com) Payment gateway library for Laravel framework. Official documentation is [here](https://developer.sslcommerz.com/docs.html).

## install
```
composer require sam-asif/sslcommerz
```

## Provider

You need to update your application configuration in order to register the package so it can be loaded by Laravel, just update your `config/app.php` file adding the following code at the end of your `'providers'` section:

> `config/app.php`

```php
[
SamAsif\Sslcommerz\SSLCommerzServiceProvider::class,
// ...
],
// ...
];
```

### publish
```
php artisan vendor:publish
```
This command will create a `sslcommerz.php` file inside the `config` directory. Configure your parameters in your `.env` file

If your request value contain following key

```
total_amount
currency
tran_id
cus_name
cus_email
cus_add1
cus_add2
cus_city
cus_state
cus_postcode
cus_country
cus_phone
cus_fax
ship_name
ship_add1
ship_add2
ship_city
ship_state
ship_postcode
ship_phone
ship_country
shipping_method
product_name
product_category
product_profile
value_a
value_b
value_c
value_d
```

Then just call the controller method.

```php
index($request, 'hosted');

if (!is_array($payment_options)) {
print_r($payment_options);
$payment_options = array();
}

}

}

```

If your request value dostn't contain those key, then define an array with those key and call the controller function.

```php
index($post_data, 'hosted');

if (!is_array($payment_options)) {
print_r($payment_options);
$payment_options = array();
}

}

// For received return value

public function return(Request $request){
return $request->all();
}

}

```

### Web Route
```
Route::post('/sslcommerz/return', 'OrderController::class@return')->name('sslcommerz.return');

```

This route for the received the return value from SSLCommerz gateway.