Skip to content

Commit 64883d6

Browse files
authored
Merge pull request GoodSpace-Kr#139 from borntocode2/main
[modify] payment logic
2 parents 53272cd + ef9e896 commit 64883d6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/main/kotlin/goodspace/teaming/payment/service/PaymentService.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,15 @@ class PaymentService(
3030
){
3131
@Transactional
3232
fun requestApprove(paymentVerifyRespondDto: PaymentVerifyRespondDto): ResponseEntity<Void> {
33-
if (paymentVerifyRespondDto.authResultCode != "0000"){
34-
throw RuntimeException("카드사인증 인증 실패: ${paymentVerifyRespondDto.authResultCode} in requestApprove Service Layer")
33+
if (paymentVerifyRespondDto.authResultCode != "0000") {
34+
val platform = paymentVerifyRespondDto.mallReserved.split(":")[2]
35+
36+
val redirectUrl = if (platform == "APP") "teaming://payment/fail"
37+
else "https://teaming-three.vercel.app/payment/fail"
38+
39+
return ResponseEntity.status(HttpStatus.FOUND)
40+
.header("Location", redirectUrl)
41+
.build()
3542
}
3643

3744
val amount = paymentVerifyRespondDto.amount

0 commit comments

Comments
 (0)