Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dischub

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dischub

A Python SDK to initiate online payment to the Dischub API

  • 2.1.1
  • PyPI
  • Socket score

Maintainers
1

Dischub Python SDK

Overview

The Dischub Python SDK allows developers to easily integrate with the Dischub API for online payment processing. This SDK provides a simple interface for creating payments via the Dischub API.

Installation

You can install the Dischub SDK using pip:

pip install dischub

Usage

Copy and paste code below as a function called "payment" in your functions' file

from dischub import Dischub

def payment():
    data = {
        "api_key" : "your-api-key",
        "sender": "sender-dischub-account-email-@gmail.com",
        "recipient": "your-dischub-business-account-email-@gmail.com",
        "amount": 100,
        "currency": "USD",
    }
    payment_instance = Dischub()
    response = payment_instance.create_payment(data)
    print(response)
payment()

Success Response

If your integration is done so well, you will get the below response

{'status': 'success', 'message': 'payment initiated', 'response_code': 200}

Missing Keys Response

if you miss one or more keys in the data dictionary, you will get below response

{'status': 'error', 'message': 'missing or invalid required keys', 'response_code': 400}

Currency Response

if you upload currency type other than 'USD' and 'ZWG' on the currency key in the data dictionary, you will get below response

{'status': 'error', 'message': 'Invalid or unsupported currency', 'response_code': 400}

Authorization Response

if use invalid api_key or you Dischub business account email on the api_key or reciepient keys respectively, you will get the below response

{'status': 'error', 'message': 'authorization failed', 'response_code': 401}

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc