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 f6760487
authored
Sep 23, 2019
by
solo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
notify
1 parent
bdf64cab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 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 @
f676048
...
@@ -38,7 +38,7 @@ def purchase_notify(order):
...
@@ -38,7 +38,7 @@ def purchase_notify(order):
customer
=
order
.
customer
customer
=
order
.
customer
invoice
=
order
invoice
=
order
else
:
else
:
invoice
=
order
.
invoice
invoice
=
order
.
h2h_ar_
invoice
customer
=
invoice
.
customer
customer
=
invoice
.
customer
if
customer
and
customer
.
website
:
if
customer
and
customer
.
website
:
...
@@ -72,9 +72,9 @@ def purchase_notify(order):
...
@@ -72,9 +72,9 @@ def purchase_notify(order):
order
.
notify
[
"result"
]
=
data
order
.
notify
[
"result"
]
=
data
flush_row
(
order
)
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
on
.
dumps
(
js
)
))
try
:
try
:
requests
.
post
(
url
,
data
=
js
,
timeout
=
10
)
requests
.
post
(
url
,
data
=
js
on
.
dumps
(
js
)
,
timeout
=
10
)
except
:
except
:
pass
pass
...
...
src/agratek/api/merchant/views/odeo/notify.py
View file @
f676048
from
_sha256
import
sha256
from
..vendor
import
sha256
import
logging
import
logging
from
agratek.api.merchant.views.notify_vendor
import
purchase_notify
,
update_harga
from
agratek.api.merchant.views.notify_vendor
import
purchase_notify
,
update_harga
...
@@ -32,10 +33,13 @@ def proses(data):
...
@@ -32,10 +33,13 @@ def proses(data):
else
:
else
:
order_id
=
str
(
data
[
"order_id"
])
order_id
=
str
(
data
[
"order_id"
])
signature
=
sha256
(
"{order_id}{mid}{key}{status}"
.
format
(
sg
=
"{order_id}{mid}{key}{status}"
.
format
(
order_id
=
order_id
,
mid
=
mid
,
key
=
key
,
status
=
status
))
order_id
=
order_id
,
mid
=
mid
,
key
=
key
,
status
=
status
)
log
.
info
(
sg
)
signature
=
sha256
(
sg
)
if
signature
!=
data
[
"signature"
]:
if
signature
!=
data
[
"signature"
]:
log
.
info
(
"Signature Vendor Different"
)
log
.
info
(
"Signature Vendor Different {} {}"
.
format
(
data
[
"signature"
],
signature
))
log
.
info
(
"local
%
s, vendor
%
s"
%
(
signature
,
data
[
"signature"
]))
log
.
info
(
"local
%
s, vendor
%
s"
%
(
signature
,
data
[
"signature"
]))
return
dict
(
error
=
"Signature Different"
)
return
dict
(
error
=
"Signature Different"
)
order
=
H2hArInvoiceDet
.
query
()
\
order
=
H2hArInvoiceDet
.
query
()
\
...
...
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