From 46cc2c3deb299cc61c14a0675221b811aaf999b8 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Fri, 27 Jan 2023 10:42:46 +0700 Subject: initial commit for midtrans development --- indoteknik_custom/models/midtrans.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 indoteknik_custom/models/midtrans.py (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/midtrans.py b/indoteknik_custom/models/midtrans.py new file mode 100644 index 00000000..9546ff64 --- /dev/null +++ b/indoteknik_custom/models/midtrans.py @@ -0,0 +1,32 @@ +from odoo import fields, models, api +import logging + +_logger = logging.getLogger(__name__) + + +class MidtransNotification(models.Model): + _name = 'midtrans.notification' + + json_raw = fields.Char(string='JSON Raw Text') + sale_order_id = fields.Many2one('sale.order', string='Sales Order') + payment_status = fields.Selection([ + ('pending', 'Pending'), + ('capture', 'Capture'), + ('settlement', 'Settlement'), + ('deny', 'Deny'), + ('cancel', 'Cancel'), + ('expire', 'Expire'), + ('failure', 'Failure'), + ('refund', 'Refund'), + ('chargeback', 'Chargeback'), + ('partial_refund', 'Partial Refund'), + ('partial_chargeback', 'Partial Chargeback'), + ('authorize', 'Authorize'), + ], string='Payment Status', + help='Payment Gateway Status / Midtrans / Web, https://docs.midtrans.com/en/after-payment/status-cycle') + + +class MidtransRecurring(models.Model): + _name = 'midtrans.recurring' + + json_raw = fields.Char(string='JSON Raw Text') \ No newline at end of file -- cgit v1.2.3 From 669b9de298ed3667fc6aaf1e6070604c1799a0a8 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Fri, 27 Jan 2023 10:56:07 +0700 Subject: bug fix unauthorized sale order --- indoteknik_custom/models/__init__.py | 1 + indoteknik_custom/security/ir.model.access.csv | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py index c6fb7d4f..121bd0f4 100755 --- a/indoteknik_custom/models/__init__.py +++ b/indoteknik_custom/models/__init__.py @@ -46,3 +46,4 @@ from . import x_partner_purchase_order from . import x_product_tags from . import website_ads from . import leads_monitoring +from . import midtrans diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv index d469aa1e..c755c11a 100755 --- a/indoteknik_custom/security/ir.model.access.csv +++ b/indoteknik_custom/security/ir.model.access.csv @@ -27,4 +27,6 @@ access_website_content,access.website.content,model_website_content,,1,1,1,1 access_invoice_reklas,access.invoice.reklas,model_invoice_reklas,,1,1,1,1 access_custom_mail_marketing,access.custom.mail.marketing,model_custom_mail_marketing,,1,1,1,1 access_website_ads,access.website.ads,model_website_ads,,1,1,1,1 -access_leads_monitoring,access.leads.monitoring,model_leads_monitoring,,1,1,1,1 \ No newline at end of file +access_leads_monitoring,access.leads.monitoring,model_leads_monitoring,,1,1,1,1 +access_midtrans_notification,access.midtrans.notification,model_midtrans_notification,,1,1,1,1 +access_midtrans_recurring,access.midtrans.recurring,model_midtrans_recurring,,1,1,1,1 \ No newline at end of file -- cgit v1.2.3 From daf2b9581e8d1d72a72c7b01e760c4e67407472e Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Fri, 27 Jan 2023 11:05:53 +0700 Subject: add midtrans pay account notification --- indoteknik_custom/models/midtrans.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/midtrans.py b/indoteknik_custom/models/midtrans.py index 9546ff64..76dee447 100644 --- a/indoteknik_custom/models/midtrans.py +++ b/indoteknik_custom/models/midtrans.py @@ -29,4 +29,10 @@ class MidtransNotification(models.Model): class MidtransRecurring(models.Model): _name = 'midtrans.recurring' - json_raw = fields.Char(string='JSON Raw Text') \ No newline at end of file + json_raw = fields.Char(string='JSON Raw Text') + + +class MidtransAccount(models.Model): + _name = 'midtrans.account' + + json_raw = fields.Char(string='JSON Raw Text') -- cgit v1.2.3 From 5ddf58175a447ecf728025c8615262a423f1313a Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Fri, 27 Jan 2023 11:07:25 +0700 Subject: add security for midtrans pay account --- indoteknik_custom/security/ir.model.access.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv index c755c11a..83d9e2ed 100755 --- a/indoteknik_custom/security/ir.model.access.csv +++ b/indoteknik_custom/security/ir.model.access.csv @@ -29,4 +29,5 @@ access_custom_mail_marketing,access.custom.mail.marketing,model_custom_mail_mark access_website_ads,access.website.ads,model_website_ads,,1,1,1,1 access_leads_monitoring,access.leads.monitoring,model_leads_monitoring,,1,1,1,1 access_midtrans_notification,access.midtrans.notification,model_midtrans_notification,,1,1,1,1 -access_midtrans_recurring,access.midtrans.recurring,model_midtrans_recurring,,1,1,1,1 \ No newline at end of file +access_midtrans_recurring,access.midtrans.recurring,model_midtrans_recurring,,1,1,1,1 +access_midtrans_account,access.midtrans.account,model_midtrans_account,,1,1,1,1 \ No newline at end of file -- cgit v1.2.3