Skip to content

Instantly share code, notes, and snippets.

@MHM5000
Last active August 18, 2019 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MHM5000/d92c63c4b158916215e4631d2989858f to your computer and use it in GitHub Desktop.
Save MHM5000/d92c63c4b158916215e4631d2989858f to your computer and use it in GitHub Desktop.
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
)
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