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. 10
      GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/View/PhoneCardRechargeViewController.swift
  6. 13
      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, "PhoneNo" : model.mobile,
"ProductPrice" : model.productPrice ?? "", "ProductPrice" : model.productPrice ?? "",
"UseBalancePrice" : model.useBalancePrice ?? "", "UseBalancePrice" : model.useBalancePrice ?? "",
"PassWord": model.password ?? ""
"PassWord": model.password ?? "",
"FintechUseNo": model.fintechUseNo ?? "",
"TranType": model.paymentType ?? ""
] ]
case .fetchRechargeHistory(let from, let to): case .fetchRechargeHistory(let from, let to):
let senderID = GMEDB.shared.user.string(.senderId) ?? "" 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 { DispatchQueue.main.async {
self.delegate?.didComplete(self) self.delegate?.didComplete(self)
} }
#else #else
guard guard
let isUseBiometricAuth = KeyChain.shared.get(key: .biometricAuth), 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 { struct RechargeModel {
let paymentType: String
let paymentType: String?
let fintechUseNo: String?
let bankName: String?
let type: String let type: String
let chargeType: String let chargeType: String
let cardName: String let cardName: String
@ -20,6 +22,8 @@ struct RechargeModel {
init( init(
paymentType: String, paymentType: String,
fintechUseNo: String,
bankName: String,
type: String, type: String,
chargeType: String, chargeType: String,
cardName: String, cardName: String,
@ -27,6 +31,8 @@ struct RechargeModel {
price: String price: String
) { ) {
self.paymentType = paymentType self.paymentType = paymentType
self.fintechUseNo = fintechUseNo
self.bankName = bankName
self.type = type self.type = type
self.chargeType = chargeType self.chargeType = chargeType
self.cardName = cardName 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 { enum PaymentType: String {
case wallet = "GME Wallet"
case wallet = "wallet"
case autodebit = "autodebit" case autodebit = "autodebit"
} }
@ -90,6 +90,7 @@ class PhoneCardRechargePresenter: ViewModelType {
private let fixedModel = BehaviorSubject<[MainCardInformation]>(value: []) private let fixedModel = BehaviorSubject<[MainCardInformation]>(value: [])
private let dataOnlyModel = BehaviorSubject<[MainCardInformation]>(value: []) private let dataOnlyModel = BehaviorSubject<[MainCardInformation]>(value: [])
private var accountType: String? private var accountType: String?
private var accounts: Account?
func transform(input: Input) -> Output { func transform(input: Input) -> Output {
Driver.combineLatest(input.viewWillAppear, input.selectedMobile, input.selectedRechargeType) Driver.combineLatest(input.viewWillAppear, input.selectedMobile, input.selectedRechargeType)
@ -110,6 +111,7 @@ class PhoneCardRechargePresenter: ViewModelType {
.drive(onNext: { .drive(onNext: {
let fintechUseNumber = $0?.fintechUseNumber ?? "" let fintechUseNumber = $0?.fintechUseNumber ?? ""
let type = $0?.type ?? "autodebit" let type = $0?.type ?? "autodebit"
self.accountType = type
self.progressLinker.onNext(true) self.progressLinker.onNext(true)
self.interactor?.fetchBalanceForPowerCall(type: type, fintechUseNumber: fintechUseNumber) self.interactor?.fetchBalanceForPowerCall(type: type, fintechUseNumber: fintechUseNumber)
}).disposed(by: disposeBag) }).disposed(by: disposeBag)
@ -167,11 +169,15 @@ class PhoneCardRechargePresenter: ViewModelType {
input.nextTap input.nextTap
.withLatestFrom(combinedInput.asDriverOnErrorJustComplete()) {$1} .withLatestFrom(combinedInput.asDriverOnErrorJustComplete()) {$1}
.map { ( _, mobile, type, priceModel, _, carrierPlan, dataOnlyType) -> RechargeModel? in .map { ( _, mobile, type, priceModel, _, carrierPlan, dataOnlyType) -> RechargeModel? in
switch type { switch type {
case .regular: case .regular:
return RechargeModel( return RechargeModel(
paymentType: self.accountType ?? "",
paymentType: self.accounts?.type ?? "",
fintechUseNo: self.accounts?.fintechUseNumber ?? "",
bankName: self.accounts?.bankName ?? "",
type: type.value, type: type.value,
chargeType: "", chargeType: "",
cardName: "", cardName: "",
@ -180,7 +186,9 @@ class PhoneCardRechargePresenter: ViewModelType {
) )
case .fixed: case .fixed:
return RechargeModel( return RechargeModel(
paymentType: self.accountType ?? "",
paymentType: self.accounts?.type ?? "",
fintechUseNo: self.accounts?.fintechUseNumber ?? "",
bankName: self.accounts?.bankName ?? "",
type: type.value, type: type.value,
chargeType: carrierPlan?.cardType ?? "", chargeType: carrierPlan?.cardType ?? "",
cardName: carrierPlan?.cardName ?? "", cardName: carrierPlan?.cardName ?? "",
@ -189,7 +197,9 @@ class PhoneCardRechargePresenter: ViewModelType {
) )
case .dataOnly: case .dataOnly:
return RechargeModel( return RechargeModel(
paymentType: self.accountType ?? "",
paymentType: self.accounts?.type ?? "",
fintechUseNo: self.accounts?.fintechUseNumber ?? "",
bankName: self.accounts?.bankName ?? "",
type: type.value, type: type.value,
chargeType: dataOnlyType?.cardCode ?? "", chargeType: dataOnlyType?.cardCode ?? "",
cardName: dataOnlyType?.cardName ?? "", cardName: dataOnlyType?.cardName ?? "",
@ -232,6 +242,7 @@ extension PhoneCardRechargePresenter: PhoneCardRechargeInteractorOutput {
progressLinker.onNext(false) progressLinker.onNext(false)
bankModel.onNext(model) bankModel.onNext(model)
let selectedModel = model.first(where: {$0.type == "wallet"}) let selectedModel = model.first(where: {$0.type == "wallet"})
accounts = selectedModel
selectedPaymentMode.onNext(selectedModel) selectedPaymentMode.onNext(selectedModel)
} }

10
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.setTitleColor(.white, for: .normal)
self?.balanceCheckButton.titleLabel?.minimumScaleFactor = 0.1 self?.balanceCheckButton.titleLabel?.minimumScaleFactor = 0.1
self?.balanceCheckButton.titleLabel?.adjustsFontSizeToFitWidth = true self?.balanceCheckButton.titleLabel?.adjustsFontSizeToFitWidth = true
self?.balanceStackView.isHidden = 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) }).disposed(by: disposeBag)
@ -456,8 +460,8 @@ extension PhoneCardRechargeViewController {
.disposed(by: disposeBag) .disposed(by: disposeBag)
paymentTypeDropDownTap.rx.event.mapToVoid().asDriverOnErrorJustComplete() paymentTypeDropDownTap.rx.event.mapToVoid().asDriverOnErrorJustComplete()
.drive(onNext: {
self.selectPaymentType.onNext(())
.drive(onNext: {
self.selectPaymentType.onNext(())
}).disposed(by: disposeBag) }).disposed(by: disposeBag)
} }
} }

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

@ -161,11 +161,16 @@ extension RechargePaymentViewController {
guard let model = $0 else { guard let model = $0 else {
return 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)
}).disposed(by: disposeBag)
let tapGestureRecognizer = UITapGestureRecognizer() let tapGestureRecognizer = UITapGestureRecognizer()
tapGestureRecognizer.delegate = self tapGestureRecognizer.delegate = self

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"/> <rect key="frame" x="0.0" y="0.0" width="52.5" height="30"/>
<subviews> <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"> <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"/> <fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="14"/>
<color key="textColor" name="ThemeText"/> <color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </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"> <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"/> <fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<color key="textColor" name="ThemeText"/> <color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
@ -381,13 +381,13 @@
<rect key="frame" x="0.0" y="20" width="315" height="16"/> <rect key="frame" x="0.0" y="20" width="315" height="16"/>
<subviews> <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"> <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"/> <fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="13"/>
<nil key="textColor"/> <nil key="textColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </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"> <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"/> <fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="13"/>
<nil key="textColor"/> <nil key="textColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>

Loading…
Cancel
Save