Last active
August 18, 2019 09:32
-
-
Save MHM5000/d92c63c4b158916215e4631d2989858f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def send_request_webgate(amount, description, email, mobile, additional_data=''): | |
client = Client(WSDL_URL) | |
if additional_data: | |
result = client.service.PaymentRequestWithExtra( | |
ZARINPAL_MERCAHNTID, | |
amount, | |
description, | |
additional_data, | |
email, | |
mobile, | |
ZARINPAL_REDIRECT_URL | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
marketer_percent = pixel.marketer.percent | |
marketer_zarinpal_wallet = pixel.marketer.zarinpal_wallet | |
marketer_share = int(pixel.amount * marketer_percent / 100) | |
mhm5000_share = int(pixel.amount * ( 100 - marketer_percent ) / 100) | |
data = { | |
"Wages": { | |
"ZP.23751.1": { | |
"Amount": mhm5000_share, | |
"Description": "سهم مدیر" | |
}, | |
marketer_zarinpal_wallet: { | |
"Amount": marketer_share, | |
"Description": "سهم بازاریاب" | |
} | |
} | |
} | |
additional_data = json.dumps(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment