This document will show you how to collect payments from your customers using PayChangu inline in a js

Sample inline Implementation

You can embed PayChangu on your page using our PayChanguCheckout() JavaScript function. The function responds to your request in accordance with your request configurations. If you specify a callback_url in your request, the function will redirect your users to the provided callback URL when they complete the payment.

  <script src=""></script>
  <div id="wrapper"></div>
  <button type="button" onClick="makePayment()">Pay Now</button>
    function makePayment(){
        "public_key": "SEC-TEST-OtbJJZgchqInA8mYSfZby8ZS7ff7WD9i",
        "tx_ref": '' + Math.floor((Math.random() * 1000000000) + 1),
        "amount": 1000,
        "currency": "MWK",
        "callback_url": "",
        "return_url": "",
          "email": "[email protected]",
        "customization": {
          "title": "Test Payment",
          "description": "Payment Description",
          "logo": ""
        "meta": {
          "uuid": "uuid",
          "response": "Response"

With this, you can go ahead and perform other activities like Transaction verification