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 63d68582
authored
Sep 23, 2019
by
Solo Group
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add notify test
1 parent
a8ab70a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 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 @
63d6858
...
...
@@ -36,6 +36,7 @@ def purchase_notify(order):
# Callback to merchant
if
hasattr
(
order
,
"customer_id"
):
customer
=
order
.
customer
invoice
=
order
else
:
invoice
=
order
.
invoice
customer
=
invoice
.
customer
...
...
@@ -48,6 +49,7 @@ def purchase_notify(order):
or
"PENDING"
key
=
invoice
.
cust_inv_no
+
users
.
user_name
+
users
.
api_key
+
status
signature
=
sha256
(
key
)
data
=
[]
produk
=
[]
dat
=
dict
(
...
...
@@ -66,9 +68,8 @@ def purchase_notify(order):
))
dat
.
update
(
produk
=
produk
)
data
.
append
(
dat
)
log
.
info
(
"Notify Save:
%
s
%
s
"
%
(
data
))
log
.
info
(
"Notify Save:
%
s"
%
(
data
))
order
.
notify
[
"result"
]
=
data
flush_row
(
order
)
js
=
get_jsonrpc
(
method
=
"notify"
,
params
=
dict
(
data
=
data
))
log
.
info
(
"Notify:
%
s
%
s"
%
(
url
,
js
))
...
...
@@ -101,7 +102,8 @@ def payment_notify(order):
type
=
typ
,
tx_id
=
tx_id
))
js
=
get_jsonrpc
(
method
=
"notify"
,
params
=
dict
(
data
=
data
))
params
=
dict
(
data
=
data
)
js
=
get_jsonrpc
(
method
=
"notify"
,
params
=
params
)
log
.
info
(
"Notify:
%
s
%
s"
%
(
url
,
js
))
try
:
...
...
src/agratek/api/merchant/views/odeo/notify.py
View file @
63d6858
...
...
@@ -62,7 +62,7 @@ def proses(data):
# todo: add to customer notify table
# todo: create cron for notify
# proses jika status 1 notify ada isinya tapi belum ada field result
# todo: create cron torecurring order to other vendor
# todo: create cron to
recurring order to other vendor
# jika status = -2 proses vendor yang lain
purchase_notify
(
order
)
return
order
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