diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-01-27 11:05:53 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-01-27 11:05:53 +0700 |
| commit | daf2b9581e8d1d72a72c7b01e760c4e67407472e (patch) | |
| tree | e401f82226cfb6b6022165503ba261763dddf985 | |
| parent | 669b9de298ed3667fc6aaf1e6070604c1799a0a8 (diff) | |
add midtrans pay account notification
| -rw-r--r-- | indoteknik_api/controllers/api_v1/midtrans.py | 8 | ||||
| -rw-r--r-- | indoteknik_custom/models/midtrans.py | 8 |
2 files changed, 15 insertions, 1 deletions
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') |
