This commit is contained in:
parent
b7f66cbcbb
commit
d4e0bf734f
@ -1 +0,0 @@
|
|||||||
Subproject commit 026e86100527c2105c8c396d1b30bbdefd612fe6
|
|
||||||
4
bross.py
4
bross.py
@ -18,7 +18,7 @@ headers = {
|
|||||||
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/analytics/services/cancelled?startDate=20241008&endDate=20241008&dateKind=0", headers=headers)
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/analytics/services/cancelled?startDate=20241008&endDate=20241008&dateKind=0", headers=headers)
|
||||||
|
|
||||||
# PAYMENTS TIME PERIOD
|
# PAYMENTS TIME PERIOD
|
||||||
response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/analytics/payments?startDateTime=202408010000&endDateTime=202408072359&includeServices=true", headers=headers)
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/analytics/payments?startDateTime=202408010000&endDateTime=202408072359&includeServices=true", headers=headers)
|
||||||
|
|
||||||
# BOOKINGS TIME PERIOD
|
# BOOKINGS TIME PERIOD
|
||||||
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings?modifiedFrom=2024-01-01T00:00&modifiedTo=2024-01-30T23:59&state=Active", headers=headers)
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings?modifiedFrom=2024-01-01T00:00&modifiedTo=2024-01-30T23:59&state=Active", headers=headers)
|
||||||
@ -26,6 +26,8 @@ response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/analytics/
|
|||||||
|
|
||||||
# BOOKING
|
# BOOKING
|
||||||
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings/20241009-503875-1220777184", headers=headers) # Room move
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings/20241009-503875-1220777184", headers=headers) # Room move
|
||||||
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings/20241106-503875-1217522037", headers=headers) # Cancelled booking
|
||||||
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings/20240727-503875-1216958604", headers=headers)
|
||||||
|
|
||||||
# INVOICES
|
# INVOICES
|
||||||
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings/20241009-503875-1220777184/invoices?language=en", headers=headers)
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings/20241009-503875-1220777184/invoices?language=en", headers=headers)
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import base64
|
import base64
|
||||||
|
from io import BytesIO
|
||||||
import tempfile
|
import tempfile
|
||||||
import os
|
import os
|
||||||
from odoo import models, fields, _
|
from odoo import models, fields, _
|
||||||
@ -21,14 +22,11 @@ class BankSettings(models.Model):
|
|||||||
def get_request_object(self):
|
def get_request_object(self):
|
||||||
config = self.env.ref('bross_bank_management.bank_api_configuration')
|
config = self.env.ref('bross_bank_management.bank_api_configuration')
|
||||||
cert_data = base64.b64decode(config.cert_file_path)
|
cert_data = base64.b64decode(config.cert_file_path)
|
||||||
|
cert_file_stream = BytesIO(cert_data)
|
||||||
with tempfile.NamedTemporaryFile(delete=False, suffix='.pfx') as temp_cert_file:
|
|
||||||
temp_cert_file.write(cert_data)
|
|
||||||
temp_cert_file_path = temp_cert_file.name
|
|
||||||
|
|
||||||
client = TBCBankClient(
|
client = TBCBankClient(
|
||||||
config.wsdl_url,
|
config.wsdl_url,
|
||||||
temp_cert_file_path,
|
cert_file_stream,
|
||||||
config.cert_password,
|
config.cert_password,
|
||||||
config.username,
|
config.username,
|
||||||
config.current_password
|
config.current_password
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user