Frappe Payment Midtrans

A custom Frappe App that integrates Midtrans Payment Gateway with the Frappe Framework, specifically designed to work seamlessly with Frappe LMS.

Install Frappe Payment Midtrans

bench get-app https://github.com/ptrmtb/frappe_payment_midtrans

Add the Frappe Gems badge to your README

Maintain Frappe Payment Midtrans? Paste this into your README:

[![Listed on Frappe Gems](https://frappegems.com/api/method/frappe_gems.seo.badge?app=ptrmtb%2Ffrappe_payment_midtrans)](https://frappegems.com/gems/apps/ptrmtb/frappe_payment_midtrans)

About Frappe Payment Midtrans

Midtrans Payment Gateway for Frappe

A custom Frappe App that integrates Midtrans Payment Gateway with the Frappe Framework, specifically designed to work seamlessly with Frappe LMS.

Features

  • Midtrans Snap Integration: Secure and modern payment popup experience.
  • Frappe LMS Support: Automatically enrolls students in Courses or Batches upon successful payment.
  • Webhook Handling: Robust background processing of payment notifications (Success, Pending, Failure) to ensure enrollment happens even if the user closes the browser.
  • Dynamic Redirects: Redirects users back to the specific course or page they initiated payment from.
  • Currency Validation: Ensures transactions are processed in IDR (Indonesian Rupiah).

Prerequisites

Installation

  1. Get the app

    bench get-app payment_midtrans https://github.com/your-repo/payment_midtrans.git
    
  2. Install the app on your site

    bench --site [your-site-name] install-app payment_midtrans
    
  3. Migrate database

    bench --site [your-site-name] migrate
    

Configuration

1. Midtrans Dashboard Setup

  1. Login to your Midtrans Dashboard.
  2. Go to Settings > Access Keys to get your Merchant ID, Client Key, and Server Key.
  3. Go to Settings > Configuration.
  4. Set the Notification URL (Webhook) to:
    https://[your-domain.com]/api/method/payment_midtrans.midtrans_payment_gateway.doctype.midtrans_settings.midtrans_settings.midtrans_notification
    
    Note: If developing locally, use an Ngrok URL.

2. Frappe Site Setup

  1. Open your Frappe Desk.
  2. Search for Midtrans Settings.
  3. Enter your Merchant ID, Client Key, and Server Key.
  4. Enable Is Sandbox if you are testing.
  5. Save.
  6. Search for LMS Settings.
  7. Set Payment Gateway to Midtrans.
  8. Save.

Local Development

To test webhooks locally, you must expose your local server to the internet.

  1. Start Ngrok
    bench ngrok --bind-tls
    
  2. Copy the https forwarding URL.
  3. Update the Notification URL in Midtrans Dashboard with this Ngrok URL.

License

MIT

Related Accounting apps for Frappe & ERPNext

  • Books — Free Accounting Software
  • Lending — Open Source Lending software
  • Payments — A payments app for frappe
  • Banking — Load your bank transactions into ERPNext and reconcile them with your vouchers.
  • Erpnext Quota — App to manage ERPNext Site, User, Company and Space limitations
  • Utility Billing — The Utility Billing & Property Management App is a powerful addition to ERPNext, designed to streamline utility billing, property leasing, and tenant management. Ideal for municipal utilities, real estate managers, and property developers.
  • Expense Request — ERPNext Expense Requests
  • Vendor Payments — A frappe app that has workflows and reports to make payments to vendors by a company and track them