-
Notifications
You must be signed in to change notification settings - Fork 5
Usage
1- The bank does not accept your requests out of registered IP addresses.
2- Redirect Address MUST be your domain or an other address that resolves registered IP Address
3- You have about 15 minutes to verify incoming payment before auto transaction reversal
from PyMellat.PyMellat import BMLPaymentAPI
bml = BMLPaymentAPI('username', 'password', long(TerminalID))
pay_token = bml.request_pay_ref(saved_random_number, price, call_back_address, extra_data)
When payment is done by user, user returns to call_back_address with POST method.
POST parameters : RefId, ResCode, SaleOrderId, SaleReferenceId
bml = BMLPaymentAPI(bank_username, bank_password, terminal_id)
verify_res = bml.verify_payment(long(SaleOrderId), long(SaleReferenceId))
If every thing was OK and verify_res[0] == '0' :
bml.settle_payment(long(SaleOrderId), SaleReferenceId)
You made it ;)