Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
A
Afrishop refactored project
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Whispa
Afrishop refactored project
Commits
0e2fdb8d
提交
0e2fdb8d
authored
11月 07, 2020
作者:
Whispa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
commit commit
上级
a10b01a8
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
30 行增加
和
14 行删除
+30
-14
CardCharge.java
src/main/java/com/example/afrishop_v3/config/CardCharge.java
+19
-14
Charge.java
src/main/java/com/example/afrishop_v3/config/Charge.java
+11
-0
没有找到文件。
src/main/java/com/example/afrishop_v3/config/CardCharge.java
浏览文件 @
0e2fdb8d
...
...
@@ -70,17 +70,22 @@ public class CardCharge {
return
json
;
}
private
JSONObject
getPhoneJSON
()
{
JSONObject
json
=
new
JSONObject
();
private
ApiQuery
getPhoneJSON
()
{
String
alg
=
"3DES-24"
;
ApiQuery
json
=
new
ApiQuery
();
try
{
json
.
put
(
"txRef"
,
this
.
getTxRef
());
json
.
put
(
"amount"
,
this
.
getAmount
());
json
.
put
(
"currency"
,
this
.
getCurrency
());
json
.
put
(
"network"
,
"MTN"
);
json
.
put
(
"customer_email"
,
this
.
getEmail
());
json
.
put
(
"customer_phone"
,
this
.
getPhonenumber
());
json
.
put
(
"fullname"
,
this
.
getFullname
());
json
.
put
Params
(
"txRef"
,
this
.
getTxRef
());
json
.
put
Params
(
"amount"
,
this
.
getAmount
());
json
.
put
Params
(
"currency"
,
this
.
getCurrency
());
json
.
put
Params
(
"network"
,
"MTN"
);
json
.
put
Params
(
"customer_email"
,
this
.
getEmail
());
json
.
put
Params
(
"customer_phone"
,
this
.
getPhonenumber
());
json
.
put
Params
(
"fullname"
,
this
.
getFullname
());
}
catch
(
JSONException
ex
)
{
ex
.
getMessage
();
}
...
...
@@ -137,10 +142,10 @@ public class CardCharge {
public
JSONObject
chargeMobileMoney
()
throws
JSONException
{
JSONObject
json
=
getPhoneJSON
();
json
.
put
(
"PBFPubKey"
,
RaveConstant
.
PUBLIC_KEY
);
json
.
put
(
"redirect_url"
,
this
.
getRedirect_url
());
json
.
put
(
"payment_options"
,
"account"
);
ApiQuery
json
=
getPhoneJSON
();
json
.
put
Params
(
"PBFPubKey"
,
RaveConstant
.
PUBLIC_KEY
);
json
.
put
Params
(
"redirect_url"
,
this
.
getRedirect_url
());
json
.
put
Params
(
"payment_options"
,
"account"
);
System
.
out
.
println
(
json
.
toString
());
String
message
=
json
.
toString
();
...
...
@@ -150,7 +155,7 @@ public class CardCharge {
Charge
ch
=
new
Charge
();
return
ch
.
charge
(
client
,
ed
.
getChargeEndPoint
());
return
ch
.
charge
(
json
,
ed
.
getChargeEndPoint
());
}
...
...
src/main/java/com/example/afrishop_v3/config/Charge.java
浏览文件 @
0e2fdb8d
...
...
@@ -40,8 +40,19 @@ public class Charge {
api
.
putParams
(
"client"
,
client
);
api
.
putParams
(
"alg"
,
alg
);
return
this
.
apiConnection
.
connectAndQuery
(
api
);
}
//for all charges
public
JSONObject
charge
(
ApiQuery
api
,
String
endpoint
){
this
.
apiConnection
=
new
ApiConnection
(
endpoint
);
return
this
.
apiConnection
.
connectAndQuery
(
api
);
}
/**
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论