Skip to content

Midtrans: Payment Gateway Indonesia with Lumen MicroFramework Example

Notifications You must be signed in to change notification settings

nyancodeid/lumen-midtrans

Repository files navigation

Midtrans Lumen Example

Lumen (v7.2.1) Midtrans-PHP (v1.2)

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.

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

About

Midtrans: Payment Gateway Indonesia with Lumen MicroFramework Example

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published