|
@@ -0,0 +1,53 @@
|
|
|
+import requests
|
|
|
+
|
|
|
+def make_payment(data,headers):
|
|
|
+ url = "https://vtb.rbsuat.com/payment/rest/register.do"
|
|
|
+ try:
|
|
|
+ response = requests.post(url, headers=headers, data=data)
|
|
|
+ return response.json()
|
|
|
+ except requests.exceptions.RequestException as e:
|
|
|
+ print(f"Произошла ошибка при запросе к API: {e}")
|
|
|
+ return None
|
|
|
+
|
|
|
+
|
|
|
+def input_function_payments(orderId):
|
|
|
+ amount = 5000
|
|
|
+ orderNumber = orderId
|
|
|
+ email = "test@test.com"
|
|
|
+ clientId = 1
|
|
|
+ returnUrl = "https://assist.sharix.org/"
|
|
|
+ failUrl = "https://mybestmerchantfailurl.com"
|
|
|
+ data = {
|
|
|
+ "amount": amount,
|
|
|
+ "userName": "assist_sharix-api",
|
|
|
+ "password": "assist_sharix",
|
|
|
+ "orderNumber": orderNumber,
|
|
|
+ "returnUrl": returnUrl,
|
|
|
+ "failUrl": failUrl,
|
|
|
+ "email": "test@test.com",
|
|
|
+ "clientId": clientId,
|
|
|
+ "language": "ru"
|
|
|
+ }
|
|
|
+
|
|
|
+ headers = {
|
|
|
+ "Content-Type": "application/x-www-form-urlencoded"
|
|
|
+ }
|
|
|
+ result = make_payment(data, headers)
|
|
|
+ return result
|
|
|
+
|
|
|
+
|
|
|
+def find_connections(clientId):
|
|
|
+ url = "https://vtb.rbsuat.com/payment/rest/getBindings.do"
|
|
|
+ headers = {
|
|
|
+ 'Content-Type': 'application/x-www-form-urlencoded'
|
|
|
+ }
|
|
|
+ data = {
|
|
|
+ "userName": "assist_sharix-api",
|
|
|
+ "password": "assist_sharix",
|
|
|
+ 'clientId': 'dos-clientos',
|
|
|
+ 'bindingType': 'C'
|
|
|
+ }
|
|
|
+
|
|
|
+ response = requests.post(url, headers=headers, data=data)
|
|
|
+
|
|
|
+ return response
|