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

Sample inline Redirect 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="message"></div>
  <button type="button" onClick="makePayment()">Pay Now</button>
    function makePayment(){
        "public_key": "pub-test-R1kGqpldxWW7HAVrRf4CRx4E6RSEbAmG",
        "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