A brief description
Project description
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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ipakyuli-0.1.0.tar.gz
.
File metadata
- Download URL: ipakyuli-0.1.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17f38299f27c5139c7fe99ae2ba9a6101976b5e94f3af6d960c823dbbbe1d1ef |
|
MD5 | 1a91cda266dc080067933509b37c5d43 |
|
BLAKE2b-256 | 1ad19323ffba5868392c3d8e6d7198b8a5fa1b1c1c10aa817210f1a850067b42 |
File details
Details for the file ipakyuli-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: ipakyuli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58296cc56a105c2f72972c40c29e70c1d72da85e8bf079036dce0bcb0ef48bd2 |
|
MD5 | 56ba2fec081a4aba3c3c47e2eeadbb47 |
|
BLAKE2b-256 | 7160cc1b554edae66af50e7a6bad032e77bfe11f8d02c9b31b5228bc328aaf11 |