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



Installation

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
"""
kipo = KipoKPG("YOUR MERCHANT KEY")

"""
    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
    """
    kipo.render_form(kpg_initiate['shopping_key'])
else:
    """
        Show error to user

        You can call getErrorMessage and send error code to that as input
        and get error message
        kipo.get_error_message(ERROR_CODE)
    """

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
kipo.get_shopping_key()
# Get referent code after kpg_inquery called
kipo.get_referent_code()

Properties

""" 
    URL of Kipo server - https://kpg.kipopay.com:8091/V1.0/processors/json/
    This server create shopping key and 
"""
kipo.request_url

"""
    URL of Kipo KPG - http://webgate.kipopay.com/
    Shopping key must post to this url with SK name
"""
kipo.kipo_webgate_url

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"/>
</form>
<script language="javascript">document.forms['kipopay-gateway'].submit();</script>

Project details


Release history Release notifications | RSS feed

This version

1.2

Download files

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

Source Distribution

kipo_kpg-1.2.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

kipo_kpg-1.2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file kipo_kpg-1.2.tar.gz.

File metadata

  • Download URL: kipo_kpg-1.2.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for kipo_kpg-1.2.tar.gz
Algorithm Hash digest
SHA256 50b8805a5d8d3a92374dfc0c04b49f07b161961d78753beadded493d36d0f76e
MD5 5f0ad819cb5684c5ea4c0e48c7a78772
BLAKE2b-256 2baea240da118a7007c4a3a23c847703ee5b878da0af5e822a1081541eb32303

See more details on using hashes here.

File details

Details for the file kipo_kpg-1.2-py3-none-any.whl.

File metadata

  • Download URL: kipo_kpg-1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for kipo_kpg-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0ded4b9d3f878be7f5a6aa8976e2e5409578f7c6ced9fc674fadea5cf5b1d02a
MD5 075675a6a81a0f1ee7ff5795ed2c0484
BLAKE2b-256 4a8a6fff59eb4175fe1762c3e5136d8acf308641450f4159f426a1ffa243e244

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page