Browse Source

Done for Powercall. Need to test

pull/1/head
Jeongbae Kong 5 years ago
parent
commit
af0d089e76
  1. 4
      GME Remit/APIs/Router/APIRouter.swift
  2. 1
      GME Remit/Modules/BiometricAuthModules/BiometricAuthentication/User Interface/View/BiometricAuthenticationViewController.swift
  3. 8
      GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/Application Logic/Model/RechargeModel.swift
  4. 19
      GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/Presenter/PhoneCardRechargePresenter.swift
  5. 6
      GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/View/PhoneCardRechargeViewController.swift
  6. 11
      GME Remit/Modules/PowerCallModules/RechargePayment/User Interface/View/RechargePaymentViewController.swift
  7. 8
      GME Remit/Modules/RemittanceModules/DomesticModules/DomesticRemit/User Interface/View/DomesticRemit.storyboard

4
GME Remit/APIs/Router/APIRouter.swift

@ -839,7 +839,9 @@ extension APIRouter {
"PhoneNo" : model.mobile,
"ProductPrice" : model.productPrice ?? "",
"UseBalancePrice" : model.useBalancePrice ?? "",
"PassWord": model.password ?? ""
"PassWord": model.password ?? "",
"FintechUseNo": model.fintechUseNo ?? "",
"TranType": model.paymentType ?? ""
]
case .fetchRechargeHistory(let from, let to):
let senderID = GMEDB.shared.user.string(.senderId) ?? ""

1
GME Remit/Modules/BiometricAuthModules/BiometricAuthentication/User Interface/View/BiometricAuthenticationViewController.swift

@ -142,7 +142,6 @@ final class BiometricAuthenticationViewController: UIViewController, BiometricAu
DispatchQueue.main.async {
self.delegate?.didComplete(self)
}
#else
guard
let isUseBiometricAuth = KeyChain.shared.get(key: .biometricAuth),

8
GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/Application Logic/Model/RechargeModel.swift

@ -7,7 +7,9 @@
//
struct RechargeModel {
let paymentType: String
let paymentType: String?
let fintechUseNo: String?
let bankName: String?
let type: String
let chargeType: String
let cardName: String
@ -20,6 +22,8 @@ struct RechargeModel {
init(
paymentType: String,
fintechUseNo: String,
bankName: String,
type: String,
chargeType: String,
cardName: String,
@ -27,6 +31,8 @@ struct RechargeModel {
price: String
) {
self.paymentType = paymentType
self.fintechUseNo = fintechUseNo
self.bankName = bankName
self.type = type
self.chargeType = chargeType
self.cardName = cardName

19
GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/Presenter/PhoneCardRechargePresenter.swift

@ -24,7 +24,7 @@ enum RechargeType: Int {
}
enum PaymentType: String {
case wallet = "GME Wallet"
case wallet = "wallet"
case autodebit = "autodebit"
}
@ -90,6 +90,7 @@ class PhoneCardRechargePresenter: ViewModelType {
private let fixedModel = BehaviorSubject<[MainCardInformation]>(value: [])
private let dataOnlyModel = BehaviorSubject<[MainCardInformation]>(value: [])
private var accountType: String?
private var accounts: Account?
func transform(input: Input) -> Output {
Driver.combineLatest(input.viewWillAppear, input.selectedMobile, input.selectedRechargeType)
@ -110,6 +111,7 @@ class PhoneCardRechargePresenter: ViewModelType {
.drive(onNext: {
let fintechUseNumber = $0?.fintechUseNumber ?? ""
let type = $0?.type ?? "autodebit"
self.accountType = type
self.progressLinker.onNext(true)
self.interactor?.fetchBalanceForPowerCall(type: type, fintechUseNumber: fintechUseNumber)
}).disposed(by: disposeBag)
@ -167,11 +169,15 @@ class PhoneCardRechargePresenter: ViewModelType {
input.nextTap
.withLatestFrom(combinedInput.asDriverOnErrorJustComplete()) {$1}
.map { ( _, mobile, type, priceModel, _, carrierPlan, dataOnlyType) -> RechargeModel? in
switch type {
case .regular:
return RechargeModel(
paymentType: self.accountType ?? "",
paymentType: self.accounts?.type ?? "",
fintechUseNo: self.accounts?.fintechUseNumber ?? "",
bankName: self.accounts?.bankName ?? "",
type: type.value,
chargeType: "",
cardName: "",
@ -180,7 +186,9 @@ class PhoneCardRechargePresenter: ViewModelType {
)
case .fixed:
return RechargeModel(
paymentType: self.accountType ?? "",
paymentType: self.accounts?.type ?? "",
fintechUseNo: self.accounts?.fintechUseNumber ?? "",
bankName: self.accounts?.bankName ?? "",
type: type.value,
chargeType: carrierPlan?.cardType ?? "",
cardName: carrierPlan?.cardName ?? "",
@ -189,7 +197,9 @@ class PhoneCardRechargePresenter: ViewModelType {
)
case .dataOnly:
return RechargeModel(
paymentType: self.accountType ?? "",
paymentType: self.accounts?.type ?? "",
fintechUseNo: self.accounts?.fintechUseNumber ?? "",
bankName: self.accounts?.bankName ?? "",
type: type.value,
chargeType: dataOnlyType?.cardCode ?? "",
cardName: dataOnlyType?.cardName ?? "",
@ -232,6 +242,7 @@ extension PhoneCardRechargePresenter: PhoneCardRechargeInteractorOutput {
progressLinker.onNext(false)
bankModel.onNext(model)
let selectedModel = model.first(where: {$0.type == "wallet"})
accounts = selectedModel
selectedPaymentMode.onNext(selectedModel)
}

6
GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/View/PhoneCardRechargeViewController.swift

@ -292,8 +292,12 @@ extension PhoneCardRechargeViewController {
self?.balanceCheckButton.setTitleColor(.white, for: .normal)
self?.balanceCheckButton.titleLabel?.minimumScaleFactor = 0.1
self?.balanceCheckButton.titleLabel?.adjustsFontSizeToFitWidth = true
self?.balanceStackView.isHidden = true
guard let account = model.accountNumMasked else {
self?.mycashAmountLabel.text = "\(model.bankName ?? "")"
return
}
self?.mycashAmountLabel.text = "\(model.bankName ?? "") (\(account))"
}
}).disposed(by: disposeBag)

11
GME Remit/Modules/PowerCallModules/RechargePayment/User Interface/View/RechargePaymentViewController.swift

@ -161,9 +161,14 @@ extension RechargePaymentViewController {
guard let model = $0 else {
return
}
if model.paymentType == "" {
self?.gmeWalletTitleLabel.text = "Bank Name"
self?.balanceTitleLabel.text = "Expected \(self?.gmeWalletTitleLabel) Balance"
if model.paymentType == "autodebit" {
self?.gmeWalletTitleLabel.text = model.bankName
self?.balanceTitleLabel.text = "Expected \(model.bankName ?? "") Balance"
self?.rechargeButton.setTitle("pay using Autodebit account", for: .normal)
} else {
self?.gmeWalletTitleLabel.text = "gme_wallet_text".localized()
self?.balanceTitleLabel.text = "expected_gme_wallet_balance_text".localized()
self?.rechargeButton.setTitle("pay_using_gme_wallet_text".localized(), for: .normal)
}
}).disposed(by: disposeBag)

8
GME Remit/Modules/RemittanceModules/DomesticModules/DomesticRemit/User Interface/View/DomesticRemit.storyboard

@ -116,13 +116,13 @@
<rect key="frame" x="0.0" y="0.0" width="52.5" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="N/A" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="crF-eg-HNv">
<rect key="frame" x="0.0" y="0.0" width="22" height="30"/>
<rect key="frame" x="0.0" y="0.0" width="16.5" height="30"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="14"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" KRW" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JOx-My-xUB">
<rect key="frame" x="22" y="0.0" width="30.5" height="30"/>
<rect key="frame" x="16.5" y="0.0" width="36" height="30"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
@ -381,13 +381,13 @@
<rect key="frame" x="0.0" y="20" width="315" height="16"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="253" verticalHuggingPriority="251" text="●" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PQ8-Xe-tzc">
<rect key="frame" x="0.0" y="0.0" width="8" height="16"/>
<rect key="frame" x="0.0" y="0.0" width="8.5" height="16"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="13"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="It will deduct oooKRW (Amount + ServiceFee)" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="0rB-T2-pd1">
<rect key="frame" x="13" y="0.0" width="302" height="16"/>
<rect key="frame" x="13.5" y="0.0" width="301.5" height="16"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="13"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>

Loading…
Cancel
Save