mirror of
https://git.auk.su/Dinect/bonus-import-tools.git
synced 2025-12-28 18:10:01 +00:00
add binus_payment for payoff bonus
This commit is contained in:
@@ -191,7 +191,7 @@ def bonuses_update(
|
||||
base_url = url + 'users/' + str(user_id) + '/purchases/'
|
||||
params = {
|
||||
"doc_id": doc_id,
|
||||
"bonus_amount": bonus_amount,
|
||||
# "bonus_amount": bonus_amount,
|
||||
"sum_total": summ_total,
|
||||
"sum_discount": sum_discount,
|
||||
"sum_with_discount ": sum_with_discount,
|
||||
@@ -200,6 +200,12 @@ def bonuses_update(
|
||||
"override": 'True'
|
||||
# "date": '2024-08-03 12:53:07',
|
||||
}
|
||||
bonus_amount_numeric = float(bonus_amount)
|
||||
if bonus_amount_numeric >= 0:
|
||||
params["bonus_amount"] = bonus_amount
|
||||
else:
|
||||
params["bonus_payment"] = bonus_amount[1:]
|
||||
|
||||
r = requests.post(base_url, headers=headers, json=params)
|
||||
if r.status_code == 201:
|
||||
return True, r.json()
|
||||
|
||||
Reference in New Issue
Block a user