캔 충전 - 결제수단 카카오페이 추가

This commit is contained in:
Yu Sung 2024-08-30 17:00:05 +09:00
parent f5445a3c48
commit ca9dee5574
6 changed files with 84 additions and 35 deletions

View File

@ -6,7 +6,7 @@ target 'SodaLive' do
use_frameworks!
# Pods for SodaLive
pod 'BootpayUI', '4.3.0'
pod 'BootpayUI', '4.4.0'
pod 'ObjectBox'
end
@ -16,7 +16,7 @@ target 'SodaLive-dev' do
use_frameworks!
# Pods for SodaLive-dev
pod 'BootpayUI', '4.3.0'
pod 'BootpayUI', '4.4.0'
pod 'ObjectBox'
end

View File

@ -1,27 +1,31 @@
PODS:
- Alamofire (5.7.1)
- Bootpay (4.2.9):
- Alamofire (5.9.1)
- Bootpay (4.4.4):
- CryptoSwift
- NVActivityIndicatorView
- ObjectMapper
- BootpayUI (4.3.0):
- BootpayUI (4.4.0):
- Alamofire
- Bootpay (~> 4.2.8)
- Bootpay (~> 4.4.0)
- CryptoSwift
- JGProgressHUD
- ObjectMapper
- SCLAlertView
- SnapKit
- SwiftyJSON
- CryptoSwift (1.7.1)
- CryptoSwift (1.8.3)
- JGProgressHUD (2.2)
- NVActivityIndicatorView (5.2.0):
- NVActivityIndicatorView/Base (= 5.2.0)
- NVActivityIndicatorView/Base (5.2.0)
- ObjectBox (1.8.1)
- ObjectMapper (4.2.0)
- ObjectMapper (4.4.2)
- SCLAlertView (0.8)
- SnapKit (5.6.0)
- SwiftyJSON (5.0.1)
- SnapKit (5.7.1)
- SwiftyJSON (5.0.2)
DEPENDENCIES:
- BootpayUI (= 4.3.0)
- BootpayUI (= 4.4.0)
- ObjectBox
SPEC REPOS:
@ -31,6 +35,7 @@ SPEC REPOS:
- BootpayUI
- CryptoSwift
- JGProgressHUD
- NVActivityIndicatorView
- ObjectBox
- ObjectMapper
- SCLAlertView
@ -38,17 +43,18 @@ SPEC REPOS:
- SwiftyJSON
SPEC CHECKSUMS:
Alamofire: 0123a34370cb170936ae79a8df46cc62b2edeb88
Bootpay: d753088334a16ce99094142beb66a6610a15d84b
BootpayUI: 54dcbe59a23e0d91b07a8add8115e1a6deace0f0
CryptoSwift: d3d18dc357932f7e6d580689e065cf1f176007c1
Alamofire: f36a35757af4587d8e4f4bfa223ad10be2422b8c
Bootpay: ed9b04d0061931d4bb0c6a2e14dc44222168fde6
BootpayUI: 58e4c9a23ffb65b8023ef9f3dcb1d70090599e69
CryptoSwift: 967f37cea5a3294d9cce358f78861652155be483
JGProgressHUD: d83d7a981b85d11205e19ff8ad5bb9c40571c847
NVActivityIndicatorView: fe52a6a68664c2df8991d7d9e3d86d8d19453c53
ObjectBox: a7900d5335218cd437cbc080b7ccc38a5211f7b4
ObjectMapper: 1eb41f610210777375fa806bf161dc39fb832b81
ObjectMapper: e6e4d91ff7f2861df7aecc536c92d8363f4c9677
SCLAlertView: 6a77bb2edfc65e04dbe57725546cb4107a506b85
SnapKit: e01d52ebb8ddbc333eefe2132acf85c8227d9c25
SwiftyJSON: 2f33a42c6fbc52764d96f13368585094bfd8aa5e
SnapKit: d612e99e678a2d3b95bf60b0705ed0a35c03484a
SwiftyJSON: f5b1bf1cd8dd53cd25887ac0eabcfd92301c6a5a
PODFILE CHECKSUM: cdff30c96e85662f4de75ddd8d54358311c1e629
PODFILE CHECKSUM: 48980f586cd82e7704768a64fd3ca78a3c3cb0c6
COCOAPODS: 1.14.3
COCOAPODS: 1.15.2

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_kakaopay.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -107,7 +107,7 @@ struct CanPgPaymentView: View {
Text("카드")
.font(.custom( viewModel.paymentMethod == .card ? Font.bold.rawValue : Font.medium.rawValue, size: 16.7))
.foregroundColor(viewModel.paymentMethod == .card ? Color.button : Color.grayee)
.frame(width: (screenSize().width - 40) / 2)
.frame(maxWidth: .infinity)
.padding(.vertical, 16.7)
.background(
viewModel.paymentMethod == .card ?
@ -130,7 +130,7 @@ struct CanPgPaymentView: View {
Text("계좌이체")
.font(.custom( viewModel.paymentMethod == .bank ? Font.bold.rawValue : Font.medium.rawValue, size: 16.7))
.foregroundColor(viewModel.paymentMethod == .bank ? Color.button : Color.grayee)
.frame(width: (screenSize().width - 40) / 2)
.frame(maxWidth: .infinity)
.padding(.vertical, 16.7)
.background(
viewModel.paymentMethod == .bank ?
@ -156,7 +156,7 @@ struct CanPgPaymentView: View {
Text("휴대폰 결제")
.font(.custom( viewModel.paymentMethod == .phone ? Font.bold.rawValue : Font.medium.rawValue, size: 16.7))
.foregroundColor(viewModel.paymentMethod == .phone ? Color.button : Color.grayee)
.frame(width: (screenSize().width - 40) / 2)
.frame(maxWidth: .infinity)
.padding(.vertical, 16.7)
.background(
viewModel.paymentMethod == .phone ?
@ -175,7 +175,26 @@ struct CanPgPaymentView: View {
}
}
Spacer()
Image("ic_kakaopay")
.foregroundColor(viewModel.paymentMethod == .kakaopay ? Color.button : Color.grayee)
.frame(maxWidth: .infinity)
.padding(.vertical, 8.3)
.background(
viewModel.paymentMethod == .kakaopay ?
Color.button.opacity(0.3) :
Color.gray23
)
.cornerRadius(10)
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(lineWidth: 1)
.foregroundColor(viewModel.paymentMethod == .kakaopay ? Color.button : Color.gray77)
)
.onTapGesture {
if viewModel.paymentMethod != .kakaopay {
viewModel.paymentMethod = .kakaopay
}
}
}
.frame(width: screenSize().width - 26.7)
.padding(.top, 16.7)

View File

@ -14,6 +14,7 @@ enum PaymentMethod: String {
case card = "카드"
case bank = "계좌이체"
case phone = "휴대폰"
case kakaopay = "카카오페이"
}
final class CanPgPaymentViewModel: ObservableObject {
@ -51,22 +52,24 @@ final class CanPgPaymentViewModel: ObservableObject {
if let data = decoded.data, decoded.success {
payload.applicationId = BOOTPAY_APP_HECTO_ID
payload.pg = "세틀뱅크"
payload.pg = paymentMethod == .kakaopay ? "카카오" : "세틀뱅크"
payload.orderId = "\(data.chargeId)"
payload.method = paymentMethod!.rawValue
var username = UserDefaults.string(forKey: .nickname)
if paymentMethod != .kakaopay {
var username = UserDefaults.string(forKey: .nickname)
if username.count > 10 {
username = "\(username.prefix(6))..."
if username.count > 10 {
username = "\(username.prefix(6))..."
}
let bootUser = BootUser()
bootUser.userId = "\(UserDefaults.int(forKey: .userId))"
bootUser.username = UserDefaults.string(forKey: .nickname)
payload.user = bootUser
}
let bootUser = BootUser()
bootUser.userId = "\(UserDefaults.int(forKey: .userId))"
bootUser.username = UserDefaults.string(forKey: .nickname)
payload.user = bootUser
onSuccess()
} else {
if let message = decoded.message {