https://github.com/nyancodeid/lumen-midtrans
Midtrans: Payment Gateway Indonesia with Lumen MicroFramework Example
https://github.com/nyancodeid/lumen-midtrans
lumen-framework midtrans midtrans-php php7
Last synced: about 1 year ago
JSON representation
Midtrans: Payment Gateway Indonesia with Lumen MicroFramework Example
- Host: GitHub
- URL: https://github.com/nyancodeid/lumen-midtrans
- Owner: nyancodeid
- Created: 2020-09-12T09:10:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-12T09:11:44.000Z (over 5 years ago)
- Last Synced: 2025-02-10T22:30:51.609Z (over 1 year ago)
- Topics: lumen-framework, midtrans, midtrans-php, php7
- Language: PHP
- Homepage:
- Size: 36.1 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Midtrans Lumen Example
Example Project How to implement Midtrans with Lumen MicroFramework. **Disclaimer**, this project is for learning purposes only.
## Includes
- Create SNAP Token.
- Check Transaction Status.
- Cancel Transaction.
- MidtransMiddleware.
- Authentication (`not-available`)
## Configuration
Midtrans Configuration is available on `.env` file. And also is ported into config file `configs/app.php` so you can call it using `config` function.
```env
MIDTRANS_MERCH_ID=xxx
MIDTRANS_CLIENT_KEY=SB-Mid-client-xxx
MIDTRANS_SERVER_KEY=SB-Mid-server-xxx
MIDTRANS_IS_PRODUCTION=false
MIDTRANS_IS_SANITIZED=true
```
## Routes
| Method | URI | Action | Middleware | Map To |
| ------ | --------------- | ---------- | ---------- | --------------------------------------------------------------- |
| GET | / | Closure | | |
| GET | /products | Controller | | App\Http\Controllers\ProductController@select_view |
| GET | /select/{name} | Controller | | App\Http\Controllers\MidtransController@create_transaction_view |
| GET | /tx/status/{id} | Controller | midtrans | App\Http\Controllers\MidtransController@get_tx_status |
| POST | /tx/cancel/{id} | Controller | midtrans | App\Http\Controllers\MidtransController@cancel_tx |
| POST | /tx/create | Controller | midtrans | App\Http\Controllers\MidtransController@create_transaction |
| GET | /midtrans | Closure | midtrans | |