Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
A
Afrishop refactored project
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Whispa
Afrishop refactored project
Commits
524f2f41
提交
524f2f41
authored
11月 07, 2020
作者:
Whispa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
commit commit
上级
eaa0f9f1
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
21 行增加
和
5 行删除
+21
-5
CardCharge.java
src/main/java/com/example/afrishop_v3/config/CardCharge.java
+4
-3
FlutterWaveController.java
...xample/afrishop_v3/controllers/FlutterWaveController.java
+1
-1
OrderController.java
.../com/example/afrishop_v3/controllers/OrderController.java
+16
-1
没有找到文件。
src/main/java/com/example/afrishop_v3/config/CardCharge.java
浏览文件 @
524f2f41
...
@@ -78,13 +78,14 @@ public class CardCharge {
...
@@ -78,13 +78,14 @@ public class CardCharge {
json
.
put
(
"orderRef"
,
this
.
getTxRef
());
json
.
put
(
"orderRef"
,
this
.
getTxRef
());
json
.
put
(
"amount"
,
this
.
getAmount
());
json
.
put
(
"amount"
,
this
.
getAmount
());
json
.
put
(
"currency"
,
this
.
getCurrency
());
json
.
put
(
"currency"
,
this
.
getCurrency
());
json
.
put
(
"network"
,
"
RWF
"
);
json
.
put
(
"network"
,
"
MTN
"
);
json
.
put
(
"country"
,
"NG"
);
json
.
put
(
"country"
,
"NG"
);
json
.
put
(
"payment_type"
,
"mobilemoney
gh
"
);
json
.
put
(
"payment_type"
,
"mobilemoney
zambia
"
);
json
.
put
(
"is_mobile_money_gh"
,
"1"
);
json
.
put
(
"is_mobile_money_gh"
,
"1"
);
json
.
put
(
"email"
,
this
.
getEmail
());
json
.
put
(
"email"
,
this
.
getEmail
());
json
.
put
(
"phonenumber"
,
this
.
getPhonenumber
());
json
.
put
(
"phonenumber"
,
this
.
getPhonenumber
());
json
.
put
(
"fullname"
,
this
.
getFullname
());
json
.
put
(
"firstname"
,
this
.
getFirstname
());
json
.
put
(
"lastname"
,
this
.
getLastname
());
}
catch
(
JSONException
ex
)
{
}
catch
(
JSONException
ex
)
{
ex
.
getMessage
();
ex
.
getMessage
();
}
}
...
...
src/main/java/com/example/afrishop_v3/controllers/FlutterWaveController.java
浏览文件 @
524f2f41
...
@@ -147,7 +147,7 @@ public class FlutterWaveController extends Controller {
...
@@ -147,7 +147,7 @@ public class FlutterWaveController extends Controller {
CardCharge
ch
=
new
CardCharge
();
CardCharge
ch
=
new
CardCharge
();
ch
.
setCardno
(
flutterWaveCard
.
getCard
())
ch
.
setCardno
(
flutterWaveCard
.
getCard
())
.
setCvv
(
flutterWaveCard
.
getCvv
())
.
setCvv
(
flutterWaveCard
.
getCvv
())
.
setCurrency
(
"
RWF
"
)
.
setCurrency
(
"
ZMW
"
)
.
setCountry
(
"NG"
)
.
setCountry
(
"NG"
)
.
setAmount
(
orderEntity
.
getRealityPay
().
toString
())
.
setAmount
(
orderEntity
.
getRealityPay
().
toString
())
.
setRedirect_url
(
REDIRECT_URL
+
"/"
+
orderId
)
.
setRedirect_url
(
REDIRECT_URL
+
"/"
+
orderId
)
...
...
src/main/java/com/example/afrishop_v3/controllers/OrderController.java
浏览文件 @
524f2f41
...
@@ -9,6 +9,7 @@ import com.example.afrishop_v3.repository.*;
...
@@ -9,6 +9,7 @@ import com.example.afrishop_v3.repository.*;
import
com.example.afrishop_v3.security.services.AuthenticationUser
;
import
com.example.afrishop_v3.security.services.AuthenticationUser
;
import
com.example.afrishop_v3.util.IdUtil
;
import
com.example.afrishop_v3.util.IdUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.domain.Sort
;
...
@@ -34,15 +35,17 @@ public class OrderController extends Controller {
...
@@ -34,15 +35,17 @@ public class OrderController extends Controller {
private
final
TbCfStationItemRepository
itemRepository
;
private
final
TbCfStationItemRepository
itemRepository
;
private
final
TbCfItemCommentRepository
commentRepository
;
private
final
TbCfItemCommentRepository
commentRepository
;
private
final
TbCfExpressTemplateRepository
templateRepository
;
private
final
TbCfExpressTemplateRepository
templateRepository
;
private
final
TbCfExchangeRepository
exchangeRepository
;
private
final
AuthenticationUser
user
;
private
final
AuthenticationUser
user
;
public
OrderController
(
TbCfOrderRepository
repository
,
TbCfCartRecordRRepository
cartRepository
,
TbCfToicouponRepository
toicouponRepository
,
TbCfStationItemRepository
itemRepository
,
TbCfItemCommentRepository
commentRepository
,
TbCfExpressTemplateRepository
templateRepository
,
AuthenticationUser
user
)
{
public
OrderController
(
TbCfOrderRepository
repository
,
TbCfCartRecordRRepository
cartRepository
,
TbCfToicouponRepository
toicouponRepository
,
TbCfStationItemRepository
itemRepository
,
TbCfItemCommentRepository
commentRepository
,
TbCfExpressTemplateRepository
templateRepository
,
@Qualifier
(
"tbCfExchangeRepository"
)
TbCfExchangeRepository
exchangeRepository
,
AuthenticationUser
user
)
{
this
.
repository
=
repository
;
this
.
repository
=
repository
;
this
.
cartRepository
=
cartRepository
;
this
.
cartRepository
=
cartRepository
;
this
.
toicouponRepository
=
toicouponRepository
;
this
.
toicouponRepository
=
toicouponRepository
;
this
.
itemRepository
=
itemRepository
;
this
.
itemRepository
=
itemRepository
;
this
.
commentRepository
=
commentRepository
;
this
.
commentRepository
=
commentRepository
;
this
.
templateRepository
=
templateRepository
;
this
.
templateRepository
=
templateRepository
;
this
.
exchangeRepository
=
exchangeRepository
;
this
.
user
=
user
;
this
.
user
=
user
;
}
}
...
@@ -63,6 +66,18 @@ public class OrderController extends Controller {
...
@@ -63,6 +66,18 @@ public class OrderController extends Controller {
}
}
@GetMapping
(
"currencyConversion"
)
public
Result
convert
(
@RequestParam
(
"price"
)
BigDecimal
price
,
@RequestParam
(
"currency"
)
String
currency
){
TbCfExchange
exchangeEntity
=
exchangeRepository
.
findByExchangeCurrency
(
currency
.
toUpperCase
());
if
(
exchangeEntity
==
null
){
return
new
Result
(
ResultCodeEnum
.
ILLEGAL_ARGUMENT
.
getCode
(),
"Currency Not Found"
);
}
BigDecimal
rate
=
exchangeEntity
.
getExchangeRate
();
BigDecimal
resultPrice
=
price
.
multiply
(
rate
);
return
new
Result
<>(
resultPrice
);
}
@GetMapping
(
"/payNow"
)
@GetMapping
(
"/payNow"
)
public
Result
<
TbCfOrder
>
payNow
(
@RequestParam
(
"itemId"
)
String
itemId
,
public
Result
<
TbCfOrder
>
payNow
(
@RequestParam
(
"itemId"
)
String
itemId
,
@RequestParam
(
"itemNum"
)
Integer
itemNum
,
@RequestParam
(
"itemNum"
)
Integer
itemNum
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论