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_api/controllers/api_v1/midtrans.py | 8 ++++++++ indoteknik_custom/models/midtrans.py | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/indoteknik_api/controllers/api_v1/midtrans.py b/indoteknik_api/controllers/api_v1/midtrans.py index a5e667cf..fdc801d3 100644 --- a/indoteknik_api/controllers/api_v1/midtrans.py +++ b/indoteknik_api/controllers/api_v1/midtrans.py @@ -32,3 +32,11 @@ class Midtrans(controller.Controller): 'json_raw': json_raw, }]) return + + @http.route(prefix + 'midtrans/payaccount', auth='none', type='json', csrf=False, cors='*', methods=['POST', 'OPTIONS']) + def payaccount(self, **kw): + json_raw = json.loads(request.httprequest.data) + request.env['midtrans.account'].create([{ + 'json_raw': json_raw, + }]) + return \ No newline at end of file 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