Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Kunto
/
backoffice
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7889b67b
authored
Sep 23, 2019
by
solo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
notify produk
1 parent
402b6945
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
src/agratek/api/merchant/views/notify_vendor.py
src/agratek/api/merchant/views/odeo/notify.py
src/agratek/api/merchant/views/notify_vendor.py
View file @
7889b67
...
@@ -66,6 +66,10 @@ def purchase_notify(order):
...
@@ -66,6 +66,10 @@ def purchase_notify(order):
))
))
dat
.
update
(
produk
=
produk
)
dat
.
update
(
produk
=
produk
)
data
.
append
(
dat
)
data
.
append
(
dat
)
log
.
info
(
"Notify Save:
%
s
%
s"
%
(
data
))
order
.
notify
[
"result"
]
=
data
flush_row
(
order
)
js
=
get_jsonrpc
(
method
=
"notify"
,
params
=
dict
(
data
=
data
))
js
=
get_jsonrpc
(
method
=
"notify"
,
params
=
dict
(
data
=
data
))
log
.
info
(
"Notify:
%
s
%
s"
%
(
url
,
js
))
log
.
info
(
"Notify:
%
s
%
s"
%
(
url
,
js
))
try
:
try
:
...
@@ -87,7 +91,8 @@ def payment_notify(order):
...
@@ -87,7 +91,8 @@ def payment_notify(order):
# tx_id merchant harus dikirim
# tx_id merchant harus dikirim
tx_id
=
order
.
tx_id
tx_id
=
order
.
tx_id
if
not
tx_id
:
if
not
tx_id
:
pay_request
=
'request'
in
order
.
payment
and
order
.
payment
[
'request'
]
or
{}
pay_request
=
'request'
in
order
.
payment
\
and
order
.
payment
[
'request'
]
or
{}
tx_id
=
'tx_id'
in
pay_request
and
pay_request
[
'tx_id'
]
or
""
tx_id
=
'tx_id'
in
pay_request
and
pay_request
[
'tx_id'
]
or
""
data
.
update
(
dict
(
data
.
update
(
dict
(
...
@@ -96,12 +101,9 @@ def payment_notify(order):
...
@@ -96,12 +101,9 @@ def payment_notify(order):
type
=
typ
,
type
=
typ
,
tx_id
=
tx_id
tx_id
=
tx_id
))
))
# data.update(order.notify["result"])
# print('>>>', json.dumps(data, indent=4, sort_keys=True))
js
=
get_jsonrpc
(
method
=
"notify"
,
params
=
dict
(
data
=
data
))
js
=
get_jsonrpc
(
method
=
"notify"
,
params
=
dict
(
data
=
data
))
log
.
info
(
"Notify:
%
s
%
s"
%
(
url
,
js
))
log
.
info
(
"Notify:
%
s
%
s"
%
(
url
,
js
))
try
:
try
:
# pass
requests
.
post
(
url
,
data
=
js
,
timeout
=
20
)
requests
.
post
(
url
,
data
=
js
,
timeout
=
20
)
except
:
except
:
pass
pass
...
...
src/agratek/api/merchant/views/odeo/notify.py
View file @
7889b67
...
@@ -57,7 +57,7 @@ def proses(data):
...
@@ -57,7 +57,7 @@ def proses(data):
if
loc
>-
1
:
if
loc
>-
1
:
sn
=
message
[
loc
+
4
:
loc
+
28
]
sn
=
message
[
loc
+
4
:
loc
+
28
]
order
.
serial_number
=
sn
order
.
serial_number
=
sn
log
.
info
(
"Notify Save: POST={}"
.
format
(
data
))
flush_row
(
order
)
flush_row
(
order
)
# todo: add to customer notify table
# todo: add to customer notify table
# todo: create cron for notify
# todo: create cron for notify
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment