diff --git a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py index 123613951..2b50be86a 100644 --- a/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py +++ b/posawesome/posawesome/doctype/pezesha_settings/pezesha_settings.py @@ -34,7 +34,6 @@ def validate(self): @frappe.whitelist() def pezesha_loan_offer(customer, pos_profile): pos = frappe.get_doc("POS Profile", pos_profile) - print("----------", pos.custom_pezesha_channel_id) pz_st = frappe.db.get_single_value('Pezesha Settings', 'authorization') url = 'https://api.pezesha.com/mfi/v1/borrowers/options' headers = { @@ -62,14 +61,13 @@ def pezesha_loan_application(data, pos_profile): res = json.loads(data) pos = frappe.get_doc("POS Profile", pos_profile) pz_st = frappe.db.get_single_value('Pezesha Settings', 'authorization') - url = 'https://api.pezesha.com/mfi/v1/borrowers/options' headers = { 'Authorization': f'Bearer {pz_st}' } data = { - 'channel': 'VICTORY_FARMS_KAWANGWARE', - 'identifier': 'VF-CUST-2023-10313', + 'channel': pos.custom_pezesha_channel_id, + 'identifier': res.get('pezesha_customer_id'), 'amount': res.get('amount'), 'duration': res.get('duration'), 'interest': res.get('interest'), @@ -79,3 +77,18 @@ def pezesha_loan_application(data, pos_profile): response = requests.post(url, headers=headers, data=data) return response.json() + +# @frappe.whitelist() +# def pezesha_loan_status(customer, pos_profile): +# pos = frappe.get_doc("POS Profile", pos_profile) +# pz_st = frappe.db.get_single_value('Pezesha Settings', 'authorization') +# url = 'https://api.pezesha.com/mfi/v1/borrowers/latest' +# headers = { +# 'Authorization': f'Bearer {pz_st}' +# } +# data = { +# 'channel': pos.custom_pezesha_channel_id, +# 'identifier': "VF-CUST-2024-00044" +# } +# response = requests.post(url, headers=headers, data=data) +# return response.json() \ No newline at end of file diff --git a/posawesome/public/js/posapp/components/pos/Invoice.vue b/posawesome/public/js/posapp/components/pos/Invoice.vue index c9a306028..cea600808 100644 --- a/posawesome/public/js/posapp/components/pos/Invoice.vue +++ b/posawesome/public/js/posapp/components/pos/Invoice.vue @@ -1,43 +1,5 @@