Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
payment-report
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 86f025cd
authored
May 27, 2021
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Tambah channel BAYARIN
1 parent
369e1dad
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
13 deletions
CHANGES.txt
contrib/pbb-iso.py
payment_report/scripts/common.py
CHANGES.txt
View file @
86f025c
0.1.4 27-5-2021
---------------
- Tambah channel BAYARIN
0.1.3 30-4-2021
---------------
- Tambah channel Virtual Account PBB
...
...
contrib/pbb-iso.py
0 → 100644
View file @
86f025c
import
sys
import
transaction
from
opensipkd.iso8583.bjb.pbb.models
import
Log
from
opensipkd.iso8583.bjb.pbb
import
Doc
from
payment_report.scripts.pbb
import
App
as
BaseApp
from
payment_report.scripts.common
import
(
get_iso
,
get_keys
,
)
class
App
(
BaseApp
):
def
__run_payment
(
self
):
last
=
self
.
get_last_id
(
'pbb payment last id'
)
q_iso
=
self
.
__get_query_iso
(
last
.
as_int
())
found
=
False
for
row_pay
,
row_inq
in
q_iso
.
limit
(
1000
):
iso
=
get_iso
(
row_pay
.
iso_request
,
Doc
,
self
.
option
.
debug
)
stan
=
iso
.
getBit
(
11
)
ntb
=
iso
.
getBit
(
48
)
d
=
get_keys
(
iso
)
s
=
f
"STAN {stan} NTB {ntb} Channel {d['channel']}"
self
.
log
.
info
(
s
)
q
=
self
.
rpt_session
.
query
(
Log
)
.
filter_by
(
bit_011
=
stan
,
bit_048
=
ntb
)
iso_log
=
q
.
first
()
if
not
iso_log
:
iso_values
=
iso
.
get_values
()
bits
=
dict
(
mti
=
'0200'
)
for
bit
in
iso_values
:
value
=
iso_values
[
bit
]
field
=
'bit_{}'
.
format
(
str
(
bit
)
.
zfill
(
3
))
bits
[
field
]
=
value
iso_log
=
Log
(
**
bits
)
iso_log
.
error
=
d
[
'channel'
],
# Numpang di field error
last
.
nilai
=
str
(
row_inq
.
id
)
with
transaction
.
manager
:
self
.
rpt_session
.
add
(
iso_log
)
self
.
rpt_session
.
add
(
last
)
found
=
True
return
found
def
run_reversal
(
self
):
# Override
pass
app
=
App
(
sys
.
argv
[
1
:])
app
.
run
()
payment_report/scripts/common.py
View file @
86f025c
...
...
@@ -32,7 +32,18 @@ BIT_18_NAMES = {
'6016'
:
'AUTODEBET'
,
'6017'
:
'MOBILBANKING'
}
BIT_43_NAMES
=
(
'INDOMARET'
,
'ALFAMART'
,
'LINKAJA'
,
'GOPAY'
,
'EMONEY'
,
'PTPOS'
)
# Bit 41, 42, dan 43
BIT_PROFILE_NAMES
=
{
'INDOMARET'
:
'INDOMARET'
,
'ALFAMART'
:
'ALFAMART'
,
'LINKAJA'
:
'LINKAJA'
,
'GOPAY'
:
'GOPAY'
,
'EMONEY'
:
'EMONEY'
,
'PTPOS'
:
'PTPOS'
,
'TOKOPEDI'
:
'TOKOPEDIA'
,
'BUKALAPA'
:
'BUKALAPAK'
,
'MASAGO'
:
'MASAGO'
,
'BAYARIN'
:
'BAYARIN'
}
my_registry
=
dict
()
...
...
@@ -81,20 +92,17 @@ def get_iso(raw, iso_class, debug=False):
def
get_channel_name
(
bit_018
,
bit_041
,
bit_042
,
bit_043
):
bit_018
=
bit_018
.
strip
()
bit_041
=
bit_041
.
strip
()
bit_042
=
bit_042
.
strip
()
bit_043
=
bit_043
.
strip
()
for
name
in
BIT_43_NAMES
:
if
bit_043
.
find
(
name
)
>
-
1
:
return
name
if
bit_018
==
'6025'
:
bit_041
=
bit_041
.
strip
()
bit_042
=
bit_042
.
strip
()
bit_043
=
bit_043
.
strip
()
profile_values
=
[
bit_041
,
bit_042
,
bit_043
]
for
name
in
BIT_PROFILE_NAMES
:
for
bit_value
in
profile_values
:
if
bit_value
.
find
(
name
)
>
-
1
:
return
BIT_PROFILE_NAMES
[
name
]
if
bit_018
in
BIT_18_NAMES
:
return
BIT_18_NAMES
[
bit_018
]
if
bit_018
!=
'6025'
:
return
''
if
bit_042
in
(
'TOKOPEDIA'
,
'BUKALAPAK'
,
'MASAGO'
):
return
bit_042
if
bit_042
==
'NG'
:
return
bit_041
return
'LAINNYA'
...
...
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