Skip to main content

Unofficial Python SDK for YenePay (https://yenepay.com) payment integration

Project description

ᴘʏᴛʜᴏɴ sᴅᴋ | ᴜɴᴏғғɪᴄɪᴀʟ

test-status linter-status publication-status

This library allows you to quickly and easily add YenePay as a payment method using Python

We encourage you to read through this README to get the most our of what this library has to offer. We want this library to be community driven and we really appreciate any support we can get from the community.

Getting Started

These instructions will guide you on how to develop and test YenePay's payment method integration with your Python application. YenePay have setup a sandbox environment for you to test and play around the integration process. To learn more about this, please visit yenepay community site: https://community.yenepay.com/

Pre-requisite

To add YenePay to your application and start collecting payments, you will first need to register on YenePay as a merchant and get your seller code. You can do that from https://www.yenepay.com/merchant

Installation

Option 1: Using PyPI

pip install yenepay

Option 2: Directly from GitHub

  • Clone package into local folder and change director
git clone git@github.com:backostech/yenepay.sdk.python.git
cd yenepay.sdk.python/
  • Install using python setuptools
python setup.py .

Basic Usage

Creating client

  • Inorder to use and feature from this package, first you have to create a client instance.
from yenepay import Client

MERCHANT_ID = "0000"

client = Client(MERCHANT_ID) # Return client instance

Creating express checkout

from yenepay import Client, Item

client = Client(merchant_id="0000", token="abcd")

item = Item("PC", 42_000.00, 1)

express_checkout = client.get_cart_checkout(
    items=[item],
    merchant_order_id="a1b2c3",
    use_sandbox=True,
)

checkout_url = express_checkout.get_url()

print(checkout_url)

Creating cart checkout

from yenepay import Client, Item

MERCHANT_ID = "0000"

client = Client(MERCHANT_ID)

items = [
    Item("PC_1", 50_000.00, 1),
    Item("PC_2", 20_000.00, 3),
    Item("PC_3", 10_000.00, 4),
    Item("PC_4", 150_000.00, 2),
]

cart_checkout = client.get_cart_checkout(items=items)

checkout_url = cart_checkout.get_url()  # Return link for payment, if success

PDT

from yenepay import Client

client = Client(merchant_id="0000", token="abcd")

merchant_order_id = "0000"  # Give when you create checkout url

transaction_id = "abcd"  # Send from yenepay when payment is successfull

response = client.check_pdt_status(merchant_order_id, transaction_id)

if response.result == "SUCCESS" and response.status == "Paid":
    print("Payment Completed By: {}".format(response.buyer_id))

Contact

Dont't hesitate to contact us, either in person or through our call centers.

info@backostech.com

Backos Technologies

+251910900879


𝔹𝕒𝕔𝕜𝕠𝕤 𝕋𝕖𝕔𝕙𝕟𝕠𝕝𝕠𝕘𝕚𝕖𝕤

                                                  ᴀ ᴛᴇᴄʜ ʏᴏᴜ ᴄᴀɴ ᴛʀᴜsᴛ

© Copyright Backos Technologies. All Rights Reserved

Project details


Download files

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

Source Distribution

yenepay-0.2.0a1.tar.gz (12.6 kB view details)

Uploaded Source

File details

Details for the file yenepay-0.2.0a1.tar.gz.

File metadata

  • Download URL: yenepay-0.2.0a1.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for yenepay-0.2.0a1.tar.gz
Algorithm Hash digest
SHA256 6a82b429d026b1ccadc9d5d51d1baecfbd1383384ac89308ebf0affdb6891fae
MD5 f1bded4408a6b8086465d75a3410a20d
BLAKE2b-256 f7af585cb3ada0d7d83ebcfc24d7b4cdeadfe98e5920dc414fcdbf828e9be0d5

See more details on using hashes here.

Supported by

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