Update app.py
Browse files
app.py
CHANGED
@@ -1065,6 +1065,7 @@ def generate_payment_link(
|
|
1065 |
description: str, # Description of the purchase
|
1066 |
user_ip: str, # User IP address
|
1067 |
is_test: str, # Test mode flag
|
|
|
1068 |
robokassa_payment_url = 'https://auth.robokassa.ru/Merchant/Index.aspx',
|
1069 |
) -> str:
|
1070 |
"""URL for redirection of the customer to the service."""
|
@@ -1083,7 +1084,8 @@ def generate_payment_link(
|
|
1083 |
'Description': description,
|
1084 |
'SignatureValue': signature,
|
1085 |
'IsTest': is_test,
|
1086 |
-
'UserIp': user_ip
|
|
|
1087 |
}
|
1088 |
return f'{robokassa_payment_url}?{parse.urlencode(data)}'
|
1089 |
|
@@ -1124,12 +1126,12 @@ def process_payment():
|
|
1124 |
user_email = request.form.get('email', '')
|
1125 |
user_phone = request.form.get('phone', '')
|
1126 |
user_ip = request.form.get('user_ip', '')
|
1127 |
-
user_is_test = request.form.get('
|
1128 |
|
1129 |
product_name = request.form.get('product_name', 'product')
|
1130 |
product_id = request.form.get('product_id', 'default_product_id')
|
1131 |
-
expiration_date = request.form.get('expiration_date', '
|
1132 |
-
dostup_date = request.form.get('dostup_date', '')
|
1133 |
|
1134 |
# Проверяем, что invid установлен
|
1135 |
if invid is None:
|
@@ -1146,7 +1148,8 @@ def process_payment():
|
|
1146 |
invid,
|
1147 |
f"Оплата за {product_name}",
|
1148 |
user_ip,
|
1149 |
-
user_is_test
|
|
|
1150 |
)
|
1151 |
|
1152 |
# Отправляем запрос на сервер Robokassa
|
@@ -1190,7 +1193,6 @@ def process_payment():
|
|
1190 |
|
1191 |
|
1192 |
|
1193 |
-
|
1194 |
|
1195 |
|
1196 |
# Поднятие страницы с таблицей
|
|
|
1065 |
description: str, # Description of the purchase
|
1066 |
user_ip: str, # User IP address
|
1067 |
is_test: str, # Test mode flag
|
1068 |
+
expiration_date: str, # Срок действия счёта
|
1069 |
robokassa_payment_url = 'https://auth.robokassa.ru/Merchant/Index.aspx',
|
1070 |
) -> str:
|
1071 |
"""URL for redirection of the customer to the service."""
|
|
|
1084 |
'Description': description,
|
1085 |
'SignatureValue': signature,
|
1086 |
'IsTest': is_test,
|
1087 |
+
'UserIp': user_ip,
|
1088 |
+
'ExpirationDate': expiration_date, # Добавляем срок действия счёта
|
1089 |
}
|
1090 |
return f'{robokassa_payment_url}?{parse.urlencode(data)}'
|
1091 |
|
|
|
1126 |
user_email = request.form.get('email', '')
|
1127 |
user_phone = request.form.get('phone', '')
|
1128 |
user_ip = request.form.get('user_ip', '')
|
1129 |
+
user_is_test = request.form.get('test', '0')
|
1130 |
|
1131 |
product_name = request.form.get('product_name', 'product')
|
1132 |
product_id = request.form.get('product_id', 'default_product_id')
|
1133 |
+
expiration_date = request.form.get('expiration_date', '2100-01-01T00:00:08.0+03:00')
|
1134 |
+
dostup_date = request.form.get('dostup_date', '2100-01-01T00:00:08.0+03:00')
|
1135 |
|
1136 |
# Проверяем, что invid установлен
|
1137 |
if invid is None:
|
|
|
1148 |
invid,
|
1149 |
f"Оплата за {product_name}",
|
1150 |
user_ip,
|
1151 |
+
user_is_test,
|
1152 |
+
expiration_date # Добавляем срок действия счёта
|
1153 |
)
|
1154 |
|
1155 |
# Отправляем запрос на сервер Robokassa
|
|
|
1193 |
|
1194 |
|
1195 |
|
|
|
1196 |
|
1197 |
|
1198 |
# Поднятие страницы с таблицей
|