Skip to main content

Python Kipo KPG Library make it easy to stablish payment with kipo gateway.

Project description

Python Kipo KPG Library: make payment easy with kipo

Latest Stable Version

Python Kipo KPG Library make it easy to stablish payment with kipo gateway.

KipoPay Company logo


Add KipoKPG files to Your project or simply run pip install kipo-kpg

Quick Start and Examples

Initial Kipo KPG and request shopping key from kipo server.

from KipoKPG import KipoKPG

    Initial Kipo Library and craete object from KipoKPG class
    Merchant key is merchant phone number

    Replace "YOUR CALLBACK URL" and "AMOUNT" with what you want
    kpg_initiate return a Dictionary 
    Successful - {"status": True, "shopping_key": SHOPING_KEY}
    Failed - {"status": false, "message": ERROR_CODE}
kpg_initiate = kipo.kpg_initiate(AMOUNT, 'YOUR CALLBACK URL')

if kpg_initiate['status']:
        Store kpg_initiate["shopping_key"] to session to verfiy
        payment after user came back from gateway

        Call render_form function to render a html form and send
        user to Kipo KPG Gateway (you can create this form manually
        where you want - form example is at the end of Quick Start
        Show error to user

        You can call getErrorMessage and send error code to that as input
        and get error message

Verify payment after user return back to CALLBACK URL

    Replace "SHOPPING_KEY" with your SHOPPING_KEY that you taken from
    Initiate function

    kpg_inquery return a dictionary for result
    Successful - {"status": True, "referent_code": REFERENT_CODE}
    Failed - {"status": False, "message": ERROR_CODE}
kpg_inquery = kipo.kpg_inquery(SHOPPING_KEY)
# Get shopping key after kpg_initiate called
# Get referent code after kpg_inquery called


    URL of Kipo server -
    This server create shopping key and 

    URL of Kipo KPG -
    Shopping key must post to this url with SK name

HTML Form to transfer user to KPG

<form id="kipopay-gateway" method="post" action="KIPO_WEBGATE_URL" style="display: none;">
    <input type="hidden" id="sk" name="sk" value="SHOPING_KEY"/>
<script language="javascript">document.forms['kipopay-gateway'].submit();</script>

Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for kipo-kpg, version 1.2
Filename, size File type Python version Upload date Hashes
Filename, size kipo_kpg-1.2-py3-none-any.whl (3.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size kipo_kpg-1.2.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page