Bank Transaction Documentation
This guide explains how to use the BankTransaction class from the ipakyuli.transfer module for creating, confirming, and canceling bank transfers.
Installation
Ensure that you have installed the required dependencies for ipakyuli.transfer. If it's part of a package, you can install it using:
pip install ipakyuli
Bank Authentication
Before initiating a transaction, you'll need to authenticate with the bank's API by providing necessary credentials like API URL, login, password, and cash box ID.
Example Authentication Data
bank_auth = {
"api_url": "https://example-api-url.com", # Replace with the actual API URL
"login": "your_login", # Your login credentials
"password": "your_password", # Your password
"cash_box_id": "your_cash_box_id" # Cash box ID provided by the bank
}
Card Data
Card information should be provided in a dictionary containing the PAN (card number) and expiry date.
card_data = {
"pan": "8600123412341234", # Example card number (PAN)
"expiry": "2509" # Expiry date in YYMM format
}
Bank Transaction
To initiate a bank transaction, you'll use the BankTransaction class, passing in the card data and authentication credentials.
from ipakyuli.transfer import BankTransaction
# Initialize the BankTransaction instance
bank = BankTransaction(card_data=card_data, **bank_auth)
Transfer Creation
To create a new transfer, provide the amount, order ID, and a description of the payment.
transfer_data = {
"amount": 5000.0, # Amount in the local currency
"order_id": "3", # Unique ID for the order
"desc": "payment description" # Description of the payment
}
# Create a new transfer
bank.transfer_create(**transfer_data)
Transfer Confirmation
After creating a transfer, you can confirm it using the confirmation code sent by the bank.
# Confirm the transfer using the confirmation code
bank.transfer_confirm(code="1234")
Transfer Cancellation
If you need to cancel the transfer for any reason, you can do so using the transfer_cancel method
# Cancel the transfer
bank.transfer_cancel()
Example Workflow
Here's an example of how the full transaction process works:
from ipakyuli.transfer import BankTransaction
# Authentication credentials and card data
bank_auth = {
"api_url": "https://example-api-url.com",
"login": "your_login",
"password": "your_password",
"cash_box_id": "your_cash_box_id"
}
card_data = {
"pan": "8600123412341234", # Example card number (PAN)
"expiry": "2509" # Expiry date in YYMM format
}
# Initialize the BankTransaction instance
bank = BankTransaction(card_data=card_data, **bank_auth)
# Create a new transfer
transfer_data = {
"amount": 5000.0,
"order_id": "3",
"desc": "payment description"
}
bank.transfer_create(**transfer_data)
# Confirm the transfer
bank.transfer_confirm(code="1234")
# Cancel the transfer if needed
bank.transfer_cancel()
Metadata
Release files for ipakyuli 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ipakyuli-0.1.0.tar.gz | 4.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ipakyuli-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.2 kB
Release files / ipakyuli-0.1.0.tar.gz
| Download URL | ipakyuli-0.1.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
17f38299f27c5139c7fe99ae2ba9a6101976b5e94f3af6d960c823dbbbe1d1ef
|
|
BLAKE2b-256 checksum How to use checksums |
1ad19323ffba5868392c3d8e6d7198b8a5fa1b1c1c10aa817210f1a850067b42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.2
|
Release files / ipakyuli-0.1.0-py3-none-any.whl
| Download URL | ipakyuli-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58296cc56a105c2f72972c40c29e70c1d72da85e8bf079036dce0bcb0ef48bd2
|
|
BLAKE2b-256 checksum How to use checksums |
7160cc1b554edae66af50e7a6bad032e77bfe11f8d02c9b31b5228bc328aaf11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.2
|