Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
TopUpCambodian-java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
TopUpCambodian-java
Commits
d3588770
Commit
d3588770
authored
Apr 16, 2021
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复paygo通道
parent
346342bd
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
45 deletions
+52
-45
src/com/library/service/Impl/AutomaticCodeServiceImpl.java
+25
-29
src/com/library/test/PaygoTest2.java
+0
-0
src/com/library/test/PaygoUtils.java
+17
-7
src/com/library/util/Paygo24Utils.java
+1
-1
src/exchangerate.properties
+2
-7
src/jdbc.properties
+7
-1
No files found.
src/com/library/service/Impl/AutomaticCodeServiceImpl.java
View file @
d3588770
package
com
.
library
.
service
.
Impl
;
package
com
.
library
.
service
.
Impl
;
import
com.library.TopUp.Statel.SeatelSentUtils
;
import
com.library.TopUp.cellcard.CellcardSentUtils
;
import
com.library.TopUp.mefont.MetfoneSentUtils
;
import
com.library.TopUp.model.ResultsModel
;
import
com.library.TopUp.model.ResultsModel
;
import
com.library.TopUp.smart.SmartSentUtils
;
import
com.library.config.NameValue
;
import
com.library.config.NameValue
;
import
com.library.mapper.AutomaticQueueMapper
;
import
com.library.mapper.AutomaticQueueMapper
;
import
com.library.mapper.CurrencyMapper
;
import
com.library.mapper.CurrencyMapper
;
import
com.library.model.AutomaticQueueModel
;
import
com.library.model.AutomaticQueueModel
;
import
com.library.model.OrderLogModel
;
import
com.library.model.OrderLogModel
;
import
com.library.model.OrderModel
;
import
com.library.model.OrderModel
;
import
com.library.model.SegmentModel
;
import
com.library.service.AutomaticCodeService
;
import
com.library.service.AutomaticCodeService
;
import
com.library.util.Paygo24Utils
;
import
com.library.util.Paygo24Utils
;
import
com.library.util.TransformationTools
;
import
com.library.util.TransformationTools
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
...
@@ -22,10 +22,6 @@ import java.util.Date;
...
@@ -22,10 +22,6 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
import
javax.annotation.Resource
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
@Service
@Service
@Transactional
@Transactional
...
@@ -117,25 +113,25 @@ public class AutomaticCodeServiceImpl implements AutomaticCodeService {
...
@@ -117,25 +113,25 @@ public class AutomaticCodeServiceImpl implements AutomaticCodeService {
Map
<
String
,
Object
>
map
=
this
.
automaticQueueMapper
.
selectSegment
(
phoneThree
);
Map
<
String
,
Object
>
map
=
this
.
automaticQueueMapper
.
selectSegment
(
phoneThree
);
//1.先判断这是哪个公司的充值订单,然后发起充值
//1.先判断这是哪个公司的充值订单,然后发起充值
//
SegmentModel
segmentModel
=
(
SegmentModel
)
TransformationTools
.
ToObjectOne
(
SegmentModel
.
class
,
map
);
//
SegmentModel segmentModel = (SegmentModel)TransformationTools.ToObjectOne(SegmentModel.class, map);
if
(
segmentModel
.
getOperator
().
equals
(
"Cellcard"
))
{
//
if (segmentModel.getOperator().equals("Cellcard")) {
//Cellcard的手机号,则选择Cellcard公司的api发起充值
//
//Cellcard的手机号,则选择Cellcard公司的api发起充值
//
resultsModel
=
CellcardSentUtils
.
sentTopUp
(
automaticQueueModel
.
getOrder_phone
(),
top_up_datetime
,
automaticQueueModel
.
getOrder_money
().
intValue
());
//
resultsModel = CellcardSentUtils.sentTopUp(automaticQueueModel.getOrder_phone(), top_up_datetime, automaticQueueModel.getOrder_money().intValue());
resultsModel
.
setTopUpNum
(
top_up_datetime
);
//
resultsModel.setTopUpNum(top_up_datetime);
}
else
if
(
segmentModel
.
getOperator
().
equals
(
"Metfone"
))
{
//
} else if (segmentModel.getOperator().equals("Metfone")) {
resultsModel
=
MetfoneSentUtils
.
sentTopUp
(
automaticQueueModel
.
getOrder_phone
(),
automaticQueueModel
.
getOrder_money
().
intValue
(),
top_up_datetime
);
//
resultsModel = MetfoneSentUtils.sentTopUp(automaticQueueModel.getOrder_phone(), automaticQueueModel.getOrder_money().intValue(), top_up_datetime);
resultsModel
.
setTopUpNum
(
top_up_datetime
);
//
resultsModel.setTopUpNum(top_up_datetime);
}
else
if
(
segmentModel
.
getOperator
().
equals
(
"Smart"
))
{
//
} else if (segmentModel.getOperator().equals("Smart")) {
resultsModel
=
SmartSentUtils
.
sentTopUp
(
automaticQueueModel
.
getOrder_phone
(),
automaticQueueModel
.
getOrder_money
().
intValue
(),
top_up_datetime
);
//
resultsModel = SmartSentUtils.sentTopUp(automaticQueueModel.getOrder_phone(), automaticQueueModel.getOrder_money().intValue(), top_up_datetime);
resultsModel
.
setTopUpNum
(
top_up_datetime
);
//
resultsModel.setTopUpNum(top_up_datetime);
}
else
if
(
segmentModel
.
getOperator
().
equals
(
"Seatel"
))
{
//
} else if (segmentModel.getOperator().equals("Seatel")) {
resultsModel
=
SeatelSentUtils
.
sentTopUp
(
automaticQueueModel
.
getOrder_phone
(),
automaticQueueModel
.
getOrder_money
().
intValue
());
//
resultsModel = SeatelSentUtils.sentTopUp(automaticQueueModel.getOrder_phone(), automaticQueueModel.getOrder_money().intValue());
//
//这个不用返回订单num,里面已经做了处理
//
//这个不用返回订单num,里面已经做了处理
//
}
else
{
//
} else {
Paygo24Utils
paygo
=
new
Paygo24Utils
();
Paygo24Utils
paygo
=
new
Paygo24Utils
();
String
result
=
paygo
.
payment
(
automaticQueueModel
.
getOrder_phone
(),
automaticQueueModel
.
getSegment_id
(),
automaticQueueModel
.
getOrder_money
());
String
result
=
paygo
.
payment
(
automaticQueueModel
.
getOrder_phone
(),
automaticQueueModel
.
getSegment_id
(),
automaticQueueModel
.
getOrder_money
());
resultsModel
=
new
ResultsModel
();
resultsModel
=
new
ResultsModel
();
...
@@ -147,7 +143,7 @@ public class AutomaticCodeServiceImpl implements AutomaticCodeService {
...
@@ -147,7 +143,7 @@ public class AutomaticCodeServiceImpl implements AutomaticCodeService {
}
}
resultsModel
.
setTopUpNum
(
top_up_datetime
);
resultsModel
.
setTopUpNum
(
top_up_datetime
);
}
//
}
return
resultsModel
;
return
resultsModel
;
}
catch
(
Exception
var10
)
{
}
catch
(
Exception
var10
)
{
...
...
src/com/library/test/PaygoTest2.java
deleted
100644 → 0
View file @
346342bd
This diff is collapsed.
Click to expand it.
src/com/library/test/Paygo
Test
.java
→
src/com/library/test/Paygo
Utils
.java
View file @
d3588770
...
@@ -25,7 +25,7 @@ import java.util.UUID;
...
@@ -25,7 +25,7 @@ import java.util.UUID;
import
java.util.logging.Level
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
public
class
Paygo
Test
{
public
class
Paygo
Utils
{
// test
// test
...
@@ -36,19 +36,30 @@ public class PaygoTest {
...
@@ -36,19 +36,30 @@ public class PaygoTest {
// prod
// prod
private
static
final
String
mAddress
=
"https://processing2.paygo24.com/paygoservice.asmx"
;
private
static
final
String
mAddress
=
"https://processing2.paygo24.com/paygoservice.asmx"
;
private
static
final
String
mUsername
=
"451717"
;
private
static
final
String
mUsername
=
"451717"
;
// iWoQosQ+z9YFXqKuyPyRNg==
private
static
final
String
mPassword
=
encodePass
(
"Ws8GsJZu"
);
private
static
final
String
mPassword
=
encodePass
(
"Ws8GsJZu"
);
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
// 3 CELLCARD 012885610
// 2 SMART 098375667
// 4 metfone 0887038371
top_up
(
"0887038371"
);
}
private
static
void
top_up
(
String
mAccount
)
{
Date
now
=
new
Date
();
Date
now
=
new
Date
();
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
SimpleDateFormat
ticket_format
=
new
SimpleDateFormat
(
"HHmmss"
);
SimpleDateFormat
ticket_format
=
new
SimpleDateFormat
(
"HHmmss"
);
SimpleDateFormat
format3339
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
);
SimpleDateFormat
format3339
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
);
Paygo
Test
test
=
new
PaygoTest
();
Paygo
Utils
test
=
new
PaygoUtils
();
Payment
payment
=
new
Payment
();
Payment
payment
=
new
Payment
();
payment
.
setId
(
UUID
.
randomUUID
().
toString
());
payment
.
setId
(
UUID
.
randomUUID
().
toString
());
payment
.
setAccount
(
"098375667"
);
payment
.
setServiceId
(
"2"
);
payment
.
setAccount
(
mAccount
);
payment
.
setServiceId
(
"4"
);
payment
.
setCommission
(
"0.00"
);
payment
.
setCommission
(
"0.00"
);
payment
.
setValue
(
"1.00"
);
payment
.
setValue
(
"1.00"
);
payment
.
setTicket
(
ticket_format
.
format
(
now
));
payment
.
setTicket
(
ticket_format
.
format
(
now
));
...
@@ -58,7 +69,7 @@ public class PaygoTest {
...
@@ -58,7 +69,7 @@ public class PaygoTest {
payment
.
setCurrency
(
"USD"
);
payment
.
setCurrency
(
"USD"
);
payment
.
setPaymentTool
(
"1"
);
payment
.
setPaymentTool
(
"1"
);
List
<
Payment
.
PaymentParam
>
params
=
new
ArrayList
<>();
List
<
Payment
.
PaymentParam
>
params
=
new
ArrayList
<>();
params
.
add
(
new
Payment
.
PaymentParam
(
"account"
,
"098375667"
));
params
.
add
(
new
Payment
.
PaymentParam
(
"account"
,
mAccount
));
//account parameter
//account parameter
payment
.
setParams
(
params
);
payment
.
setParams
(
params
);
try
{
try
{
...
@@ -90,9 +101,8 @@ public class PaygoTest {
...
@@ -90,9 +101,8 @@ public class PaygoTest {
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
Logger
.
getLogger
(
Paygo
Test
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
Logger
.
getLogger
(
Paygo
Utils
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
}
}
}
}
private
static
final
String
encodePass
(
String
pass
)
{
private
static
final
String
encodePass
(
String
pass
)
{
...
...
src/com/library/util/Paygo24Utils.java
View file @
d3588770
...
@@ -77,7 +77,7 @@ public class Paygo24Utils {
...
@@ -77,7 +77,7 @@ public class Paygo24Utils {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
Paygo24Utils
paygo24Utils
=
new
Paygo24Utils
();
Paygo24Utils
paygo24Utils
=
new
Paygo24Utils
();
String
result
=
paygo24Utils
.
payment
(
"0
887038371"
,
4
,
new
BigDecimal
(
1.0
));
String
result
=
paygo24Utils
.
payment
(
"0
98375667"
,
2
,
new
BigDecimal
(
1.0
));
System
.
out
.
println
(
"result:"
+
result
);
System
.
out
.
println
(
"result:"
+
result
);
}
}
...
...
src/exchangerate.properties
View file @
d3588770
...
@@ -3,11 +3,5 @@
...
@@ -3,11 +3,5 @@
hasPrintlnUrl
=
true
hasPrintlnUrl
=
true
phone.regularly
=
^1(3[0-9]|4[57]|5[0-35-9]|7[0135678]|8[0-9])
\\
d{8}$
phone.regularly
=
^1(3[0-9]|4[57]|5[0-35-9]|7[0135678]|8[0-9])
\\
d{8}$
test.account
=
11,15
test.account
=
11,15
#paygo.pointid=46
#paygo.password=4QrcOUm6Wau+VuBX8g+IPg==
#wcRvX9plNOAb95br0y4vVQ==
paygo.pointid
=
326386
paygo.password
=
5TNO+4kpAXtphf1eIlGCLw==
paygo.test.is
=
true
paygo.start.is
=
true
sms.domestic.submail
=
false
sms.domestic.submail
=
false
\ No newline at end of file
src/jdbc.properties
View file @
d3588770
#jdbc.driverClassName=com.mysql.jdbc.Driver
#jdbc.driverClassName=com.mysql.jdbc.Driver
#jdbc.url=jdbc:mysql://localhost:3306/comb_top?useUnicode=true&characterEncoding=utf8&autoReconnect=true
#jdbc.url=jdbc:mysql://localhost:3306/comb_top?useUnicode=true&characterEncoding=utf8&autoReconnect=true
#本地
#jdbc.username=root
#jdbc.username=root
#jdbc.password=123
#jdbc.password=123
...
@@ -11,7 +12,12 @@
...
@@ -11,7 +12,12 @@
jdbc.driverClassName
=
com.mysql.jdbc.Driver
jdbc.driverClassName
=
com.mysql.jdbc.Driver
#jdbc.url=jdbc:mysql://localhost:3306/discuz?useUnicode=true&characterEncoding=utf8&autoReconnect=true
jdbc.url
=
jdbc:mysql://localhost:3306/recharge_sys?useUnicode=true&characterEncoding=utf8&autoReconnect=true
jdbc.url
=
jdbc:mysql://localhost:3306/recharge_sys?useUnicode=true&characterEncoding=utf8&autoReconnect=true
jdbc.username
=
recharge_sys
jdbc.username
=
recharge_sys
#正式
jdbc.password
=
cK2bPBkwLtKNeGRc
jdbc.password
=
cK2bPBkwLtKNeGRc
# 测试外网
#jdbc.password=FEeDirZZ4EP8rADM
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