Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TangKuPos
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王海
TangKuPos
Commits
7d15e35b
Commit
7d15e35b
authored
Mar 29, 2018
by
zhang_z
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交百富统一支付平台;
parent
63867d4f
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
1455 additions
and
1 deletion
+1455
-1
.idea/dictionaries/Eurus.xml
.idea/dictionaries/Eurus.xml
+6
-0
.idea/gradle.xml
.idea/gradle.xml
+1
-0
.idea/modules.xml
.idea/modules.xml
+1
-0
neptune/.gitignore
neptune/.gitignore
+1
-0
neptune/build.gradle
neptune/build.gradle
+39
-0
neptune/proguard-rules.pro
neptune/proguard-rules.pro
+21
-0
neptune/src/androidTest/java/com/xingdata/pay/neptune/ExampleInstrumentedTest.java
...ava/com/xingdata/pay/neptune/ExampleInstrumentedTest.java
+26
-0
neptune/src/main/AndroidManifest.xml
neptune/src/main/AndroidManifest.xml
+2
-0
neptune/src/main/aidl/com/pax/pay/service/aidl/PayService.aidl
...ne/src/main/aidl/com/pax/pay/service/aidl/PayService.aidl
+5
-0
neptune/src/main/java/com/xingdata/pay/neptune/C.java
neptune/src/main/java/com/xingdata/pay/neptune/C.java
+67
-0
neptune/src/main/java/com/xingdata/pay/neptune/NeptuneCenter.java
...src/main/java/com/xingdata/pay/neptune/NeptuneCenter.java
+47
-0
neptune/src/main/java/com/xingdata/pay/neptune/Response.java
neptune/src/main/java/com/xingdata/pay/neptune/Response.java
+42
-0
neptune/src/main/java/com/xingdata/pay/neptune/Util.java
neptune/src/main/java/com/xingdata/pay/neptune/Util.java
+139
-0
neptune/src/main/java/com/xingdata/pay/neptune/ipc/C.java
neptune/src/main/java/com/xingdata/pay/neptune/ipc/C.java
+105
-0
neptune/src/main/java/com/xingdata/pay/neptune/ipc/Factory.java
...e/src/main/java/com/xingdata/pay/neptune/ipc/Factory.java
+98
-0
neptune/src/main/java/com/xingdata/pay/neptune/ipc/IRequest.java
.../src/main/java/com/xingdata/pay/neptune/ipc/IRequest.java
+99
-0
neptune/src/main/java/com/xingdata/pay/neptune/ipc/IResponse.java
...src/main/java/com/xingdata/pay/neptune/ipc/IResponse.java
+72
-0
neptune/src/main/java/com/xingdata/pay/neptune/ipc/ResultFilter.java
.../main/java/com/xingdata/pay/neptune/ipc/ResultFilter.java
+13
-0
neptune/src/main/java/com/xingdata/pay/neptune/model/Host.java
...ne/src/main/java/com/xingdata/pay/neptune/model/Host.java
+230
-0
neptune/src/main/java/com/xingdata/pay/neptune/model/Posppp.java
.../src/main/java/com/xingdata/pay/neptune/model/Posppp.java
+196
-0
neptune/src/main/java/com/xingdata/pay/neptune/model/Shopppp.java
...src/main/java/com/xingdata/pay/neptune/model/Shopppp.java
+224
-0
neptune/src/main/res/values/strings.xml
neptune/src/main/res/values/strings.xml
+3
-0
neptune/src/test/java/com/xingdata/pay/neptune/ExampleUnitTest.java
...c/test/java/com/xingdata/pay/neptune/ExampleUnitTest.java
+17
-0
settings.gradle
settings.gradle
+1
-1
No files found.
.idea/dictionaries/Eurus.xml
View file @
7d15e35b
...
...
@@ -5,7 +5,9 @@
<w>
alipay
</w>
<w>
amountexceed
</w>
<w>
appid
</w>
<w>
baifubao
</w>
<w>
baozheng
</w>
<w>
bestpay
</w>
<w>
caocao
</w>
<w>
chengyaojin
</w>
<w>
diaochan
</w>
...
...
@@ -18,6 +20,7 @@
<w>
instrans
</w>
<w>
invalidmerno
</w>
<w>
invalidstore
</w>
<w>
jdpay
</w>
<w>
jsonpay
</w>
<w>
jspay
</w>
<w>
kongming
</w>
...
...
@@ -33,7 +36,9 @@
<w>
noti
</w>
<w>
parametererror
</w>
<w>
patt
</w>
<w>
paxpay
</w>
<w>
posppp
</w>
<w>
qqpay
</w>
<w>
qrpay
</w>
<w>
shixiu
</w>
<w>
shopppp
</w>
...
...
@@ -43,6 +48,7 @@
<w>
strs
</w>
<w>
sunquan
</w>
<w>
transclose
</w>
<w>
ucodepay
</w>
<w>
unionpay
</w>
<w>
unipay
</w>
<w>
unkonw
</w>
...
...
.idea/gradle.xml
View file @
7d15e35b
...
...
@@ -9,6 +9,7 @@
<set>
<option
value=
"$PROJECT_DIR$"
/>
<option
value=
"$PROJECT_DIR$/app"
/>
<option
value=
"$PROJECT_DIR$/neptune"
/>
<option
value=
"$PROJECT_DIR$/pay"
/>
</set>
</option>
...
...
.idea/modules.xml
View file @
7d15e35b
...
...
@@ -4,6 +4,7 @@
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/TangKuPos.iml"
filepath=
"$PROJECT_DIR$/TangKuPos.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/app/app.iml"
filepath=
"$PROJECT_DIR$/app/app.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/neptune/neptune.iml"
filepath=
"$PROJECT_DIR$/neptune/neptune.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/pay/pay.iml"
filepath=
"$PROJECT_DIR$/pay/pay.iml"
/>
</modules>
</component>
...
...
neptune/.gitignore
0 → 100644
View file @
7d15e35b
/build
neptune/build.gradle
0 → 100644
View file @
7d15e35b
apply
plugin:
'com.android.library'
android
{
compileSdkVersion
27
defaultConfig
{
minSdkVersion
21
targetSdkVersion
27
versionCode
1
versionName
"1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
compileOptions
{
sourceCompatibility
JavaVersion
.
VERSION_1_8
targetCompatibility
JavaVersion
.
VERSION_1_8
}
buildTypes
{
release
{
minifyEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android.txt'
),
'proguard-rules.pro'
}
}
}
dependencies
{
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
'com.android.support:appcompat-v7:27.0.2'
testImplementation
'junit:junit:4.12'
androidTestImplementation
'com.android.support.test:runner:1.0.1'
androidTestImplementation
'com.android.support.test.espresso:espresso-core:3.0.1'
implementation
'io.reactivex.rxjava2:rxjava:2.1.5'
implementation
'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation
'com.alibaba:fastjson:1.1.67.android'
implementation
'com.blankj:utilcode:1.11.1'
}
neptune/proguard-rules.pro
0 → 100644
View file @
7d15e35b
# Add project specific ProGuard rules here.
#
You
can
control
the
set
of
applied
configuration
files
using
the
#
proguardFiles
setting
in
build
.
gradle
.
#
#
For
more
details
,
see
#
http
://
developer
.
android
.
com
/
guide
/
developing
/
tools
/
proguard
.
html
#
If
your
project
uses
WebView
with
JS
,
uncomment
the
following
#
and
specify
the
fully
qualified
class
name
to
the
JavaScript
interface
#
class
:
#-
keepclassmembers
class
fqcn
.
of
.
javascript
.
interface
.
for
.
webview
{
#
public
*
;
#
}
#
Uncomment
this
to
preserve
the
line
number
information
for
#
debugging
stack
traces
.
#-
keepattributes
SourceFile
,
LineNumberTable
#
If
you
keep
the
line
number
information
,
uncomment
this
to
#
hide
the
original
source
file
name
.
#-
renamesourcefileattribute
SourceFile
neptune/src/androidTest/java/com/xingdata/pay/neptune/ExampleInstrumentedTest.java
0 → 100644
View file @
7d15e35b
package
com
.
xingdata
.
pay
.
neptune
;
import
android.content.Context
;
import
android.support.test.InstrumentationRegistry
;
import
android.support.test.runner.AndroidJUnit4
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
static
org
.
junit
.
Assert
.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith
(
AndroidJUnit4
.
class
)
public
class
ExampleInstrumentedTest
{
@Test
public
void
useAppContext
()
throws
Exception
{
// Context of the app under test.
Context
appContext
=
InstrumentationRegistry
.
getTargetContext
();
assertEquals
(
"com.xingdata.pay.neptune.test"
,
appContext
.
getPackageName
());
}
}
neptune/src/main/AndroidManifest.xml
0 → 100644
View file @
7d15e35b
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.xingdata.pay.neptune"
/>
neptune/src/main/aidl/com/pax/pay/service/aidl/PayService.aidl
0 → 100644
View file @
7d15e35b
package
com
.
pax
.
pay
.
service
.
aidl
;
interface
PayService
{
String
doTrans
(
String
jsonStr
);
}
neptune/src/main/java/com/xingdata/pay/neptune/C.java
0 → 100644
View file @
7d15e35b
package
com
.
xingdata
.
pay
.
neptune
;
public
class
C
{
/**
* 交易状态
*/
public
final
static
class
PAY_STATE
{
/**
* 支付中 (默认状态)
*/
public
final
static
int
ING
=
0
;
/**
* 支付成功
*/
public
final
static
int
SUCCESS
=
1
;
/**
* 支付失败
*/
public
final
static
int
FAIL
=
2
;
/**
* 自定义的错误信息的标识
*/
public
final
static
int
FAIL_CUSTOM
=
-
999
;
}
/**
* 操作类型
*/
public
final
static
class
ACTION_TYPE
{
/**
* 条码支付
*/
public
final
static
int
PAY_BARCODE
=
101
;
/**
* 二维码支付
*/
public
final
static
int
PAY_QR
=
102
;
/**
* 公众号支付
*/
public
final
static
int
PAY_WOA
=
103
;
/**
* 退货
*/
public
final
static
int
REFUND
=
200
;
/**
* 撤销
*/
public
final
static
int
VOID
=
300
;
/**
* 查询
*/
public
final
static
int
QUERY
=
400
;
}
/**
* 交易类型
*/
public
final
class
PAY_CHANNEL
{
public
static
final
int
CASH
=
1
;
public
static
final
int
WECHAT
=
2
;
public
static
final
int
ALI
=
3
;
public
static
final
int
BANK
=
4
;
public
static
final
int
CARD
=
5
;
public
static
final
int
TALLY
=
9
;
}
}
neptune/src/main/java/com/xingdata/pay/neptune/NeptuneCenter.java
0 → 100644
View file @
7d15e35b
package
com
.
xingdata
.
pay
.
neptune
;
import
android.content.Context
;
import
com.alibaba.fastjson.JSON
;
import
com.blankj.utilcode.util.LogUtils
;
import
com.xingdata.pay.neptune.ipc.Factory
;
import
com.xingdata.pay.neptune.model.Shopppp
;
import
io.reactivex.Observable
;
public
class
NeptuneCenter
{
private
static
class
NeptuneCenterHolder
{
private
static
final
NeptuneCenter
INSTANCE
=
new
NeptuneCenter
();
}
/**
* 交易基本信息
*/
public
Shopppp
mShopppp
;
public
static
NeptuneCenter
getInstance
()
{
return
NeptuneCenter
.
NeptuneCenterHolder
.
INSTANCE
;
}
public
NeptuneCenter
init
(
Context
context
,
String
json
)
{
LogUtils
.
e
(
"初始化NeptuneCenter"
);
Factory
.
getInstance
().
init
(
context
);
mShopppp
=
JSON
.
parseObject
(
json
,
Shopppp
.
class
);
return
this
;
}
/**
* 支付
*
* @param payChannel 支付渠道
* @param orderAmt 金额
* @return 支付结果的Observable
*/
public
Observable
<
Response
>
pay
(
int
payChannel
,
Long
orderAmt
)
{
return
Factory
.
pay
(
payChannel
,
orderAmt
);
}
}
neptune/src/main/java/com/xingdata/pay/neptune/Response.java
0 → 100644
View file @
7d15e35b
package
com
.
xingdata
.
pay
.
neptune
;
public
class
Response
{
public
Response
()
{
}
public
Response
(
int
code
,
String
msg
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
}
private
int
code
;
private
String
msg
;
private
String
body
;
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
public
String
getBody
()
{
return
body
;
}
public
void
setBody
(
String
body
)
{
this
.
body
=
body
;
}
}
neptune/src/main/java/com/xingdata/pay/neptune/Util.java
0 → 100644
View file @
7d15e35b
package
com
.
xingdata
.
pay
.
neptune
;
import
com.blankj.utilcode.util.StringUtils
;
import
java.math.BigDecimal
;
class
Util
{
/**
* 分转元
*
* @param fen 分
* @return 元
*/
public
static
String
fenToYuan
(
Long
fen
)
{
if
(
fen
==
null
||
fen
==
0
)
return
"0.00"
;
BigDecimal
decimal
=
new
BigDecimal
(
fen
);
return
decimal
.
divide
(
new
BigDecimal
(
100
),
2
,
BigDecimal
.
ROUND_DOWN
).
toString
();
}
/**
* 分转元
*
* @param fen 分
* @return 元
*/
public
static
String
fenToYuanNoPoint
(
Long
fen
)
{
if
(
fen
==
null
)
return
"0"
;
return
String
.
valueOf
(
fen
/
100
);
}
/**
* 折扣率转换
*
* @param dis 分
* @return 元
*/
public
static
String
discount
(
int
dis
)
{
String
strFen
=
String
.
valueOf
((
double
)
dis
/
10
);
return
noZero
(
strFen
);
}
/**
* 分转元
*
* @param fen 分
* @param isMonetary 是否有货币单位
* @return 元
*/
public
static
String
fenToYuan
(
Long
fen
,
boolean
isMonetary
)
{
return
(
isMonetary
?
"¥"
:
""
)
+
fenToYuan
(
fen
);
}
/**
* 元转分
*
* @param yuan 元
* @return 分
*/
public
static
Long
yuanToFen
(
String
yuan
)
{
yuan
=
StringUtils
.
isEmpty
(
yuan
)
?
"0"
:
yuan
;
BigDecimal
b
=
new
BigDecimal
(
Double
.
valueOf
(
yuan
)
*
100
);
return
b
.
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
();
}
/**
* 字符串转数字
*
* @param str 字符串
* @return 数字
*/
public
static
Long
stringToLong
(
String
str
)
{
str
=
StringUtils
.
isEmpty
(
str
)
?
"0"
:
str
;
return
Long
.
valueOf
(
str
);
}
/**
* 数字转字符串
*
* @param l 数字
* @return 字符串
*/
public
static
String
longToString
(
Long
l
)
{
if
(
l
==
null
)
return
"0"
;
return
String
.
valueOf
(
l
);
}
/**
* 分转元去掉.0 ROUND_DOWN
*
* @param fen 分
* @return 元
*/
public
static
String
fenToYuanNoZero
(
Long
fen
)
{
String
ss
=
fenToYuan2
(
fen
);
return
noZero
(
ss
);
}
private
static
String
noZero
(
String
ss
)
{
if
(
ss
.
endsWith
(
".00"
))
{
ss
=
ss
.
replace
(
".00"
,
""
);
}
else
if
(
ss
.
endsWith
(
".0"
))
{
ss
=
ss
.
replace
(
".0"
,
""
);
}
else
if
(
ss
.
endsWith
(
"0"
))
{
ss
=
ss
.
substring
(
0
,
ss
.
length
()
-
1
);
}
return
ss
;
}
/**
* 分转元保留2位小數
*
* @param fen 分
* @return 元
*/
public
static
String
fenToYuan2
(
Long
fen
)
{
if
(
fen
==
null
)
{
return
"0.00"
;
}
BigDecimal
decimal
=
new
BigDecimal
(
fen
);
return
decimal
.
divide
(
new
BigDecimal
(
100
)).
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
).
toString
();
}
/**
* 折扣率转换最大100
*
* @param dis 分
* @return 元
*/
public
static
String
discount
(
Long
dis
)
{
if
(
dis
>
100
)
{
return
"10"
;
}
BigDecimal
decimal
=
new
BigDecimal
(
dis
);
return
decimal
.
divide
(
new
BigDecimal
(
10
)).
setScale
(
0
,
BigDecimal
.
ROUND_DOWN
).
toString
();
}
}
neptune/src/main/java/com/xingdata/pay/neptune/ipc/C.java
0 → 100644
View file @
7d15e35b
package
com
.
xingdata
.
pay
.
neptune
.
ipc
;
public
class
C
{
static
String
APP_ID
=
""
;
static
String
APP_NAME
=
""
;
/**
* 重试次数
*/
static
final
int
RETRY_COUNT
=
6
;
/**
* 重试延迟时间
*/
static
final
int
RETRY_DELAY_TIME
=
5
*
1000
;
class
CODE
{
/**
* 成功
*/
final
static
String
SUCC
=
"0"
;
/**
* 自定义的错误信息的标识
*/
final
static
String
FAIL_CUSTOM
=
"999"
;
}
/**
* 支付方式
*/
class
PAY_MODE
{
/**
* 银联支付
*/
final
static
String
UNIONPAY
=
"UNIONPAY"
;
/**
* 微信支付
*/
final
static
String
WECHAT
=
"WECHAT"
;
/**
* 支付宝
*/
final
static
String
ALIPAY
=
"ALIPAY"
;
/**
* 百富支付
*/
final
static
String
PAXPAY
=
"PAXPAY"
;
/**
* 百度钱包
*/
final
static
String
BAIFUBAO
=
"BAIFUBAO"
;
/**
* 银联二维码
*/
final
static
String
UCODEPAY
=
"UCODEPAY"
;
/**
* QQ钱包
*/
final
static
String
QQPAY
=
"QQPAY"
;
/**
* 京东支付
*/
final
static
String
JDPAY
=
"JDPAY"
;
/**
* 翼支付
*/
final
static
String
BESTPAY
=
"BESTPAY"
;
}
/**
* 交易类型
*/
class
TRANS_TYPE
{
/**
* 消费
*/
final
static
String
SALE
=
"SALE"
;
/**
* 撤销
*/
final
static
String
VOID
=
"VOID"
;
/**
* 退货
*/
final
static
String
REFUND
=
"REFUND"
;
/**
* 预授权
*/
final
static
String
AUTH
=
"AUTH"
;
/**
* 预授权撤销
*/
final
static
String
AUTH_VOID
=
"AUTH_VOID"
;
/**
* 预授权完成请求
*/
final
static
String
AUTH_CM
=
"AUTH_CM"
;
/**
* 预授权完成请求撤销
*/
final
static
String
AUTH_CM_VOID
=
"AUTH_CM_VOID"
;
}
}
neptune/src/main/java/com/xingdata/pay/neptune/ipc/Factory.java
0 → 100644
View file @
7d15e35b
package
com
.
xingdata
.
pay
.
neptune
.
ipc
;
import
android.app.Service
;
import
android.content.ComponentName
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.ServiceConnection
;
import
android.os.IBinder
;
import
android.os.RemoteException
;
import
com.alibaba.fastjson.JSON
;
import
com.blankj.utilcode.util.LogUtils
;
import
com.pax.pay.service.aidl.PayService
;
import
com.xingdata.pay.neptune.NeptuneCenter
;
import
com.xingdata.pay.neptune.Response
;
import
io.reactivex.Observable
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.schedulers.Schedulers
;
public
class
Factory
{
private
static
PayService
mPayService
;
private
static
class
FactoryHolder
{
private
static
final
Factory
INSTANCE
=
new
Factory
();
}
private
static
int
mRetry
;
public
static
Factory
getInstance
()
{
return
Factory
.
FactoryHolder
.
INSTANCE
;
}
public
void
init
(
Context
context
)
{
LogUtils
.
e
(
"开始初始化"
);
ServiceConnection
conn
=
new
ServiceConnection
()
{
@Override
public
void
onServiceConnected
(
ComponentName
componentName
,
IBinder
iBinder
)
{
LogUtils
.
e
(
"Service Connected!"
);
mPayService
=
PayService
.
Stub
.
asInterface
(
iBinder
);
}
@Override
public
void
onServiceDisconnected
(
ComponentName
componentName
)
{
LogUtils
.
e
(
"Service Disconnected!"
);
}
};
Intent
intent
=
new
Intent
();
intent
.
setAction
(
"com.pax.cashier.PayService"
);
context
.
bindService
(
intent
,
conn
,
Service
.
BIND_AUTO_CREATE
);
}
/**
* @param payChannel 支付渠道
* @param orderAmt 支付金额
* @return 交易结果
*/
public
static
Observable
<
Response
>
pay
(
int
payChannel
,
Long
orderAmt
)
{
IRequest
iRequest
=
IRequest
.
create
();
iRequest
.
setTransType
(
C
.
TRANS_TYPE
.
SALE
);
iRequest
.
setOrderNo
(
String
.
valueOf
(
NeptuneCenter
.
getInstance
().
mShopppp
.
getPosppp
().
getHposTrace
()));
switch
(
payChannel
)
{
case
com
.
xingdata
.
pay
.
neptune
.
C
.
PAY_CHANNEL
.
ALI
:
iRequest
.
setPayMode
(
C
.
PAY_MODE
.
ALIPAY
);
break
;
case
com
.
xingdata
.
pay
.
neptune
.
C
.
PAY_CHANNEL
.
WECHAT
:
iRequest
.
setPayMode
(
C
.
PAY_MODE
.
WECHAT
);
break
;
}
iRequest
.
setTransAmount
(
String
.
valueOf
(
orderAmt
));
return
run
(
Observable
.
just
(
iRequest
).
flatMap
(
iRequest1
->
{
while
(
mPayService
==
null
)
{
LogUtils
.
e
(
"PayService获取失败,"
+
C
.
RETRY_DELAY_TIME
+
"ms后尝试重连"
);
if
(
mRetry
<
C
.
RETRY_COUNT
)
{
Thread
.
sleep
(
C
.
RETRY_DELAY_TIME
);
}
else
{
return
Observable
.
just
(
new
IResponse
(
C
.
CODE
.
SUCC
,
"初始化失败"
));
}
}
IResponse
iResponse
;
try
{
iResponse
=
JSON
.
parseObject
(
mPayService
.
doTrans
(
JSON
.
toJSONString
(
iRequest1
)),
IResponse
.
class
);
}
catch
(
RemoteException
e
)
{
iResponse
=
new
IResponse
();
}
return
Observable
.
just
(
iResponse
);
}).
map
(
new
ResultFilter
()));
}
public
static
<
T
>
Observable
<
T
>
run
(
Observable
<
T
>
observable
)
{
return
observable
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
());
}
}
neptune/src/main/java/com/xingdata/pay/neptune/ipc/IRequest.java
0 → 100644
View file @
7d15e35b
package
com
.
xingdata
.
pay
.
neptune
.
ipc
;
class
IRequest
{
private
IRequest
()
{
}
public
static
IRequest
create
()
{
IRequest
iRequest
=
new
IRequest
();
iRequest
.
setAppName
(
C
.
APP_NAME
);
iRequest
.
setAppId
(
C
.
APP_ID
);
return
iRequest
;
}
/**
* 应用ID
*/
private
String
appId
;
/**
* 应用名称
*/
private
String
appName
;
/**
* 交易类型
*/
private
String
transType
;
/**
* 订单号
*/
private
String
orderNo
;
/**
* 交易金额
*/
private
String
transAmount
;
/**
* 支付方式
*/
private
String
payMode
;
/**
* 原交易唯一标识
*/
private
String
transUniqueIDString
;
public
String
getAppId
()
{
return
appId
;
}
public
void
setAppId
(
String
appId
)
{
this
.
appId
=
appId
;
}
public
String
getAppName
()
{
return
appName
;
}
public
void
setAppName
(
String
appName
)
{
this
.
appName
=
appName
;
}
public
String
getTransType
()
{
return
transType
;
}
public
void
setTransType
(
String
transType
)
{
this
.
transType
=
transType
;
}
public
String
getOrderNo
()
{
return
orderNo
;
}
public
void
setOrderNo
(
String
orderNo
)
{
this
.
orderNo
=
orderNo
;
}
public
String
getTransAmount
()
{
return
transAmount
;
}
public
void
setTransAmount
(
String
transAmount
)
{
this
.
transAmount
=
transAmount
;
}
public
String
getPayMode
()
{
return
payMode
;
}
public
void
setPayMode
(
String
payMode
)
{
this
.
payMode
=
payMode
;
}
public
String
getTransUniqueIDString
()
{
return
transUniqueIDString
;
}
public
void
setTransUniqueIDString
(
String
transUniqueIDString
)
{
this
.
transUniqueIDString
=
transUniqueIDString
;
}
}
neptune/src/main/java/com/xingdata/pay/neptune/ipc/IResponse.java
0 → 100644
View file @
7d15e35b
package
com
.
xingdata
.
pay
.
neptune
.
ipc
;
class
IResponse
{
/**
* 应用ID
*/
private
String
appId
;
/**
* 交易类型
*/
private
String
transType
;
/**
* 订单号
*/
private
String
orderNo
;
/**
* 应答码
*/
private
String
rspCode
;
/**
* 应答信息
*/
private
String
rspMsg
;
public
IResponse
()
{
}
public
IResponse
(
String
rspCode
,
String
rspMsg
)
{
this
.
rspCode
=
"999"
;
this
.
rspMsg
=
rspMsg
;
}
public
String
getAppId
()
{
return
appId
;
}
public
void
setAppId
(
String
appId
)
{
this
.
appId
=
appId
;
}
public
String
getTransType
()
{
return
transType
;
}
public
void
setTransType
(
String
transType
)
{
this
.
transType
=
transType
;
}
public
String
getOrderNo
()
{
return
orderNo
;
}
public
void
setOrderNo
(
String
orderNo
)
{
this
.
orderNo
=
orderNo
;
}
public
String
getRspCode
()
{
return
rspCode
;
}
public
void
setRspCode
(
String
rspCode
)
{
this
.
rspCode
=
rspCode
;
}
public
String
getRspMsg
()
{
return
rspMsg
;
}
public
void
setRspMsg
(
String
rspMsg
)
{
this
.
rspMsg
=
rspMsg
;
}
}
neptune/src/main/java/com/xingdata/pay/neptune/ipc/ResultFilter.java
0 → 100644
View file @
7d15e35b
package
com
.
xingdata
.
pay
.
neptune
.
ipc
;
import
com.xingdata.pay.neptune.Response
;
import
io.reactivex.functions.Function
;
class
ResultFilter
implements
Function
<
IResponse
,
Response
>
{
@Override
public
Response
apply
(
IResponse
iResponse
)
throws
Exception
{
return
null
;
}
}
\ No newline at end of file
neptune/src/main/java/com/xingdata/pay/neptune/model/Host.java
0 → 100644
View file @
7d15e35b
package
com
.
xingdata
.
pay
.
neptune
.
model
;
import
android.support.annotation.Nullable
;
import
java.util.Date
;
public
class
Host
{
private
Integer
hostMapId
;
@Nullable
private
String
hostName
;
@Nullable
private
String
hostAddr
;
@Nullable
private
String
hostPort
;
@Nullable
private
Byte
hostStatus
;
@Nullable
private
String
hostCompany
;
@Nullable
private
String
hostLawyer
;
@Nullable
private
String
hostLawyerContact
;
@Nullable
private
String
hostContractNumber
;
@Nullable
private
Long
hostCostsRate
;
@Nullable
private
Long
hostClearDate
;
@Nullable
private
Long
hostTotalAmt
;
@Nullable
private
String
hostKeyWechat
;
@Nullable
private
String
hostKeyAlipay
;
@Nullable
private
String
hostKeyUnipay
;
@Nullable
private
String
hostNotiUrl
;
@Nullable
private
String
hostAcqCode
;
private
Date
updateTime
;
private
Date
createTime
;
public
Integer
getHostMapId
()
{
return
hostMapId
;
}
public
void
setHostMapId
(
Integer
hostMapId
)
{
this
.
hostMapId
=
hostMapId
;
}
@Nullable
public
String
getHostName
()
{
return
hostName
;
}
public
void
setHostName
(
@Nullable
String
hostName
)
{
this
.
hostName
=
hostName
;
}
@Nullable
public
String
getHostAddr
()
{
return
hostAddr
;
}
public
void
setHostAddr
(
@Nullable
String
hostAddr
)
{
this
.
hostAddr
=
hostAddr
;
}
@Nullable
public
String
getHostPort
()
{
return
hostPort
;
}
public
void
setHostPort
(
@Nullable
String
hostPort
)
{
this
.
hostPort
=
hostPort
;
}
@Nullable
public
Byte
getHostStatus
()
{
return
hostStatus
;
}
public
void
setHostStatus
(
@Nullable
Byte
hostStatus
)
{
this
.
hostStatus
=
hostStatus
;
}
@Nullable
public
String
getHostCompany
()
{
return
hostCompany
;
}
public
void
setHostCompany
(
@Nullable
String
hostCompany
)
{
this
.
hostCompany
=
hostCompany
;
}
@Nullable
public
String
getHostLawyer
()
{
return
hostLawyer
;
}
public
void
setHostLawyer
(
@Nullable
String
hostLawyer
)
{
this
.
hostLawyer
=
hostLawyer
;
}
@Nullable
public
String
getHostLawyerContact
()
{
return
hostLawyerContact
;
}
public
void
setHostLawyerContact
(
@Nullable
String
hostLawyerContact
)
{
this
.
hostLawyerContact
=
hostLawyerContact
;
}
@Nullable
public
String
getHostContractNumber
()
{
return
hostContractNumber
;
}
public
void
setHostContractNumber
(
@Nullable
String
hostContractNumber
)
{
this
.
hostContractNumber
=
hostContractNumber
;
}
@Nullable
public
Long
getHostCostsRate
()
{
return
hostCostsRate
;
}
public
void
setHostCostsRate
(
@Nullable
Long
hostCostsRate
)
{
this
.
hostCostsRate
=
hostCostsRate
;
}
@Nullable
public
Long
getHostClearDate
()
{
return
hostClearDate
;
}
public
void
setHostClearDate
(
@Nullable
Long
hostClearDate
)
{
this
.
hostClearDate
=
hostClearDate
;
}
@Nullable
public
Long
getHostTotalAmt
()
{
return
hostTotalAmt
;
}
public
void
setHostTotalAmt
(
@Nullable
Long
hostTotalAmt
)
{
this
.
hostTotalAmt
=
hostTotalAmt
;
}
@Nullable
public
String
getHostKeyWechat
()
{
return
hostKeyWechat
;
}
public
void
setHostKeyWechat
(
@Nullable
String
hostKeyWechat
)
{
this
.
hostKeyWechat
=
hostKeyWechat
;
}
@Nullable
public
String
getHostKeyAlipay
()
{
return
hostKeyAlipay
;
}
public
void
setHostKeyAlipay
(
@Nullable
String
hostKeyAlipay
)
{
this
.
hostKeyAlipay
=
hostKeyAlipay
;
}
@Nullable
public
String
getHostKeyUnipay
()
{
return
hostKeyUnipay
;
}
public
void
setHostKeyUnipay
(
@Nullable
String
hostKeyUnipay
)
{
this
.
hostKeyUnipay
=
hostKeyUnipay
;
}
@Nullable
public
String
getHostNotiUrl
()
{
return
hostNotiUrl
;
}
public
void
setHostNotiUrl
(
@Nullable
String
hostNotiUrl
)
{
this
.
hostNotiUrl
=
hostNotiUrl
;
}
@Nullable
public
String
getHostAcqCode
()
{
return
hostAcqCode
;
}
public
void
setHostAcqCode
(
@Nullable
String
hostAcqCode
)
{
this
.
hostAcqCode
=
hostAcqCode
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
}
\ No newline at end of file
neptune/src/main/java/com/xingdata/pay/neptune/model/Posppp.java
0 → 100644
View file @
7d15e35b
package
com
.
xingdata
.
pay
.
neptune
.
model
;
import
android.support.annotation.Nullable
;
import
java.util.Date
;
public
class
Posppp
{
private
Integer
id
;
private
Integer
hostMapId
;
@Nullable
private
Long
opMapId
;
@Nullable
private
Long
channelMapId
;
private
Long
merMapId
;
@Nullable
private
String
hshopName
;
@Nullable
private
String
hshopNameabcn
;
private
Long
casherId
;
private
String
hshopNo
;
@Nullable
private
String
hposNo
;
private
Byte
pppFlag
;
@Nullable
private
Integer
hposBatch
;
@Nullable
private
Integer
hposTrace
;
@Nullable
private
String
hposKey
;
private
Date
updateTime
;
private
Date
createTime
;
@Nullable
private
String
hostName
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getHostMapId
()
{
return
hostMapId
;
}
public
void
setHostMapId
(
Integer
hostMapId
)
{
this
.
hostMapId
=
hostMapId
;
}
@Nullable
public
Long
getOpMapId
()
{
return
opMapId
;
}
public
void
setOpMapId
(
@Nullable
Long
opMapId
)
{
this
.
opMapId
=
opMapId
;
}
@Nullable
public
Long
getChannelMapId
()
{
return
channelMapId
;
}
public
void
setChannelMapId
(
@Nullable
Long
channelMapId
)
{
this
.
channelMapId
=
channelMapId
;
}
public
Long
getMerMapId
()
{
return
merMapId
;
}
public
void
setMerMapId
(
Long
merMapId
)
{
this
.
merMapId
=
merMapId
;
}
@Nullable
public
String
getHshopName
()
{
return
hshopName
;
}
public
void
setHshopName
(
@Nullable
String
hshopName
)
{
this
.
hshopName
=
hshopName
;
}
@Nullable
public
String
getHshopNameabcn
()
{
return
hshopNameabcn
;
}
public
void
setHshopNameabcn
(
@Nullable
String
hshopNameabcn
)
{
this
.
hshopNameabcn
=
hshopNameabcn
;
}
public
Long
getCasherId
()
{
return
casherId
;
}
public
void
setCasherId
(
Long
casherId
)
{
this
.
casherId
=
casherId
;
}
public
String
getHshopNo
()
{
return
hshopNo
;
}
public
void
setHshopNo
(
String
hshopNo
)
{
this
.
hshopNo
=
hshopNo
;
}
@Nullable
public
String
getHposNo
()
{
return
hposNo
;
}
public
void
setHposNo
(
@Nullable
String
hposNo
)
{
this
.
hposNo
=
hposNo
;
}
public
Byte
getPppFlag
()
{
return
pppFlag
;
}
public
void
setPppFlag
(
Byte
pppFlag
)
{
this
.
pppFlag
=
pppFlag
;
}
@Nullable
public
Integer
getHposBatch
()
{
return
hposBatch
;
}
public
void
setHposBatch
(
@Nullable
Integer
hposBatch
)
{
this
.
hposBatch
=
hposBatch
;
}
@Nullable
public
Integer
getHposTrace
()
{
return
hposTrace
;
}
public
void
setHposTrace
(
@Nullable
Integer
hposTrace
)
{
this
.
hposTrace
=
hposTrace
;
}
@Nullable
public
String
getHposKey
()
{
return
hposKey
;
}
public
void
setHposKey
(
@Nullable
String
hposKey
)
{
this
.
hposKey
=
hposKey
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
@Nullable
public
String
getHostName
()
{
return
hostName
;
}
public
void
setHostName
(
@Nullable
String
hostName
)
{
this
.
hostName
=
hostName
;
}
}
\ No newline at end of file
neptune/src/main/java/com/xingdata/pay/neptune/model/Shopppp.java
0 → 100644
View file @
7d15e35b
package
com
.
xingdata
.
pay
.
neptune
.
model
;
import
android.support.annotation.Nullable
;
import
java.util.Date
;
public
class
Shopppp
{
private
Integer
id
;
private
Integer
hostMapId
;
@Nullable
private
Long
opMapId
;
@Nullable
private
Long
channelMapId
;
private
Long
merMapId
;
@Nullable
private
String
hshopName
;
@Nullable
private
String
hshopNameabcn
;
@Nullable
private
String
hshopNo
;
private
Byte
pppFlag
;
@Nullable
private
String
shopAppidDisp
;
@Nullable
private
String
shopAppidScan
;
@Nullable
private
String
hshopKeyWechat
;
@Nullable
private
String
hshopKeyAlipay
;
@Nullable
private
String
hshopKeyUnipay
;
private
Date
updateTime
;
private
Date
createTime
;
@Nullable
private
String
hostName
;
@Nullable
private
Posppp
posppp
;
@Nullable
private
Host
host
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getHostMapId
()
{
return
hostMapId
;
}
public
void
setHostMapId
(
Integer
hostMapId
)
{
this
.
hostMapId
=
hostMapId
;
}
@Nullable
public
Long
getOpMapId
()
{
return
opMapId
;
}
public
void
setOpMapId
(
@Nullable
Long
opMapId
)
{
this
.
opMapId
=
opMapId
;
}
@Nullable
public
Long
getChannelMapId
()
{
return
channelMapId
;
}
public
void
setChannelMapId
(
@Nullable
Long
channelMapId
)
{
this
.
channelMapId
=
channelMapId
;
}
public
Long
getMerMapId
()
{
return
merMapId
;
}
public
void
setMerMapId
(
Long
merMapId
)
{
this
.
merMapId
=
merMapId
;
}
@Nullable
public
String
getHshopName
()
{
return
hshopName
;
}
public
void
setHshopName
(
@Nullable
String
hshopName
)
{
this
.
hshopName
=
hshopName
;
}
@Nullable
public
String
getHshopNameabcn
()
{
return
hshopNameabcn
;
}
public
void
setHshopNameabcn
(
@Nullable
String
hshopNameabcn
)
{
this
.
hshopNameabcn
=
hshopNameabcn
;
}
@Nullable
public
String
getHshopNo
()
{
return
hshopNo
;
}
public
void
setHshopNo
(
@Nullable
String
hshopNo
)
{
this
.
hshopNo
=
hshopNo
;
}
public
Byte
getPppFlag
()
{
return
pppFlag
;
}
public
void
setPppFlag
(
Byte
pppFlag
)
{
this
.
pppFlag
=
pppFlag
;
}
@Nullable
public
String
getShopAppidDisp
()
{
return
shopAppidDisp
;
}
public
void
setShopAppidDisp
(
@Nullable
String
shopAppidDisp
)
{
this
.
shopAppidDisp
=
shopAppidDisp
;
}
@Nullable
public
String
getShopAppidScan
()
{
return
shopAppidScan
;
}
public
void
setShopAppidScan
(
@Nullable
String
shopAppidScan
)
{
this
.
shopAppidScan
=
shopAppidScan
;
}
@Nullable
public
String
getHshopKeyWechat
()
{
return
hshopKeyWechat
;
}
public
void
setHshopKeyWechat
(
@Nullable
String
hshopKeyWechat
)
{
this
.
hshopKeyWechat
=
hshopKeyWechat
;
}
@Nullable
public
String
getHshopKeyAlipay
()
{
return
hshopKeyAlipay
;
}
public
void
setHshopKeyAlipay
(
@Nullable
String
hshopKeyAlipay
)
{
this
.
hshopKeyAlipay
=
hshopKeyAlipay
;
}
@Nullable
public
String
getHshopKeyUnipay
()
{
return
hshopKeyUnipay
;
}
public
void
setHshopKeyUnipay
(
@Nullable
String
hshopKeyUnipay
)
{
this
.
hshopKeyUnipay
=
hshopKeyUnipay
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
@Nullable
public
String
getHostName
()
{
return
hostName
;
}
public
void
setHostName
(
@Nullable
String
hostName
)
{
this
.
hostName
=
hostName
;
}
@Nullable
public
Posppp
getPosppp
()
{
return
posppp
;
}
public
void
setPosppp
(
@Nullable
Posppp
posppp
)
{
this
.
posppp
=
posppp
;
}
@Nullable
public
Host
getHost
()
{
return
host
;
}
public
void
setHost
(
@Nullable
Host
host
)
{
this
.
host
=
host
;
}
}
\ No newline at end of file
neptune/src/main/res/values/strings.xml
0 → 100644
View file @
7d15e35b
<resources>
<string
name=
"app_name"
>
neptune
</string>
</resources>
neptune/src/test/java/com/xingdata/pay/neptune/ExampleUnitTest.java
0 → 100644
View file @
7d15e35b
package
com
.
xingdata
.
pay
.
neptune
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public
class
ExampleUnitTest
{
@Test
public
void
addition_isCorrect
()
throws
Exception
{
assertEquals
(
4
,
2
+
2
);
}
}
\ No newline at end of file
settings.gradle
View file @
7d15e35b
include
':app'
,
':pay'
include
':app'
,
':pay'
,
':neptune'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment