Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: Broken

unipay-sdk

Python SDK for unipay.com payments gateway

Install

pip3 install unipay-sdk

How to ...

Create order

from unipay_sdk import UniPayClient
from unipay_sdk import OrderItem

client = UniPayClient(
    secretkey='mySecretKeyFromUniPay',
    merchant_id=00000000000000,
    success_url='/url/success',
    cancel_url='/url/cancel',
    callback_url='/url/callback'
)

new_order = client.create_order(
    merchant_order_id='ORDER1234', # Unique order id
    merchant_order_user='1', # User id on merchant side
    order_price=15.35, # in GEL
    order_name='Purchase on example.com',
    order_description='Some description',
    items=[
        OrderItem.from_dict({'price': 7.0, 'quantity': 1, 'title': 'Coffee', 'description': 'Cup of coffee'}),
        OrderItem.from_dict({'price': 8.35, 'quantity': 1, 'title': 'Cake', 'description': 'Big cake'})        
    ]
)
checkout_link = new_order.data.Checkout
order_hash = new_order.data.UnipayOrderHashID

Handle errors

from unipay_sdk import UniPayClient
from unipay_sdk import OrderItem
from unipay_sdk import APIError

client = UniPayClient(...)

new_order = client.create_order(...)

match new_order.errorcode:
    case APIError.OK:
        print('OK')
    case APIError.FREQUENCY_LIMIT_EXCEEDED:
        print('Rate limited')
    # etc...

Test server

To test order workflows you may use unipay-test-server

To use test server you might initialize UniPayClient with test flag

from unipay_sdk import UniPayClient

test_client = UniPayClient(..., test=True, test_url='http://localhost:8080')
# test_url is path to unipay-test-server 

Validate

UniPay-SDK also provides Pydantic 2.0 schemas for callbacks and responses

from unipay_sdk.pydantic import BasicUniPayCallback
from unipay_sdk.pydantic import BasicUniPayResponse

Found error or want to contribute?

You may create a pull request to repository

Metadata

Release files for unipay-sdk 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unipay-sdk 0.0.2
File Size Uploaded Provenance Actions
unipay_sdk-0.0.2.tar.gz 9.9 kB Without provenance Details for unipay_sdk-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for unipay-sdk 0.0.2
File Interpreter ABI Platform Actions
unipay_sdk-0.0.2-py3-none-any.whl Python 3 none any Details for unipay_sdk-0.0.2-py3-none-any.whl

Total release size: 19.6 kB

Release files / unipay_sdk-0.0.2.tar.gz

Download URL unipay_sdk-0.0.2.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
795957fcb115adc97fd069b274ca568396800a76e4527fe4d6bac366b459b769
BLAKE2b-256 checksum
How to use checksums
106d7271b13e0655b9830cbb29393425da0e25abeb9fc5ebc0e730681bff7caa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / unipay_sdk-0.0.2-py3-none-any.whl

Download URL unipay_sdk-0.0.2-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
746acbe4c0de720a08addb0b80962e35dc48925fb4c37b6001d9253503d53a10
BLAKE2b-256 checksum
How to use checksums
1db1b783837b02043ae1fd9c6a6df16505344038a941b02f73cb121d451f59f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Security for unipay-sdk 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page