Browse Source

ray for keypad / top

pull/1/head
Jeongbae Kong 5 years ago
parent
commit
0a5074d5f4
  1. BIN
      .DS_Store
  2. 14
      GME Remit/Modules/ExchangeRates/User Interface/View/ExchangeRates.storyboard
  3. 82
      GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/Application Logic/Service/PhoneCardRechargeService.swift
  4. 45
      GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/Presenter/PhoneCardRechargePresenter.swift
  5. 24
      GME Remit/Modules/PowerCallModules/RechargePayment/User Interface/View/RechargePaymentViewController.swift
  6. 4
      GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyVerification/User Interface/View/SendMoneyVerification.storyboard

BIN
.DS_Store

14
GME Remit/Modules/ExchangeRates/User Interface/View/ExchangeRates.storyboard

@ -156,7 +156,7 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="You Send" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xpj-lv-YQd"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="You Send" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xpj-lv-YQd">
<rect key="frame" x="0.0" y="6" width="222" height="14.5"/>
<rect key="frame" x="0.0" y="6.5" width="222" height="14"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/> <fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/>
<color key="textColor" name="ThemeText"/> <color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
@ -178,7 +178,7 @@
<rect key="frame" x="222" y="0.0" width="125" height="60.5"/> <rect key="frame" x="222" y="0.0" width="125" height="60.5"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="jYO-er-b2S"> <stackView opaque="NO" contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="jYO-er-b2S">
<rect key="frame" x="25.5" y="17.5" width="74" height="26"/>
<rect key="frame" x="24" y="17.5" width="77" height="26"/>
<subviews> <subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Korea" translatesAutoresizingMaskIntoConstraints="NO" id="9Oe-hg-7XR"> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Korea" translatesAutoresizingMaskIntoConstraints="NO" id="9Oe-hg-7XR">
<rect key="frame" x="0.0" y="0.0" width="26" height="26"/> <rect key="frame" x="0.0" y="0.0" width="26" height="26"/>
@ -188,7 +188,7 @@
</constraints> </constraints>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="KRW" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="HcJ-nJ-muV"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="KRW" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="HcJ-nJ-muV">
<rect key="frame" x="36" y="0.0" width="38" height="26"/>
<rect key="frame" x="36" y="0.0" width="41" height="26"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Bold" family="San Francisco Display" pointSize="18"/> <fontDescription key="fontDescription" name="SanFranciscoDisplay-Bold" family="San Francisco Display" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
@ -317,7 +317,7 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Recepient Gets" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZLj-5v-cJU"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Recepient Gets" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZLj-5v-cJU">
<rect key="frame" x="0.0" y="6" width="222" height="14.5"/>
<rect key="frame" x="0.0" y="6.5" width="222" height="14"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/> <fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/>
<color key="textColor" name="ThemeText"/> <color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
@ -341,7 +341,7 @@
<rect key="frame" x="0.0" y="0.0" width="125" height="60.5"/> <rect key="frame" x="0.0" y="0.0" width="125" height="60.5"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="i9R-m1-avp"> <stackView opaque="NO" contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="i9R-m1-avp">
<rect key="frame" x="7.5" y="17.5" width="110" height="26"/>
<rect key="frame" x="6" y="17.5" width="113" height="26"/>
<subviews> <subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Korea" translatesAutoresizingMaskIntoConstraints="NO" id="rbh-s6-5yG"> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Korea" translatesAutoresizingMaskIntoConstraints="NO" id="rbh-s6-5yG">
<rect key="frame" x="0.0" y="0.0" width="26" height="26"/> <rect key="frame" x="0.0" y="0.0" width="26" height="26"/>
@ -351,13 +351,13 @@
</constraints> </constraints>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="KRW" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="Tu7-d6-vev"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="KRW" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="Tu7-d6-vev">
<rect key="frame" x="36" y="0.0" width="38" height="26"/>
<rect key="frame" x="36" y="0.0" width="41" height="26"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Bold" family="San Francisco Display" pointSize="18"/> <fontDescription key="fontDescription" name="SanFranciscoDisplay-Bold" family="San Francisco Display" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_dropdownSmall" translatesAutoresizingMaskIntoConstraints="NO" id="buU-Ck-s8m"> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_dropdownSmall" translatesAutoresizingMaskIntoConstraints="NO" id="buU-Ck-s8m">
<rect key="frame" x="84" y="0.0" width="26" height="26"/>
<rect key="frame" x="87" y="0.0" width="26" height="26"/>
<color key="tintColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="tintColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="26" id="lDj-76-8TX"/> <constraint firstAttribute="height" constant="26" id="lDj-76-8TX"/>

82
GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/Application Logic/Service/PhoneCardRechargeService.swift

@ -15,6 +15,40 @@ class PhoneCardRechargeService: PhoneCardRechargeServiceType {
success: @escaping (BalanceModel) -> Void, success: @escaping (BalanceModel) -> Void,
failure: @escaping (Error) -> Void failure: @escaping (Error) -> Void
) { ) {
// let testString =
// """
// {
// "ErrorCode": "0",
// "Msg": "SUCCESS",
// "Id": "",
// "Extra": "",
// "Extra2": "",
// "Data":
// {
// "product_name" : "",
// "fintech_use_num" : "199159136057870196816404",
// "available_amt" : "40000",
// "account_type" : "1",
// "rsp_message" : "",
// "rsp_code" : "A0000",
// "bank_tran_date" : "20161001",
// "api_tran_id" : "3dab9712-2c9e-455b-9277-22b943bd3087",
// "bank_code_tran" : "097",
// "balance_amt" : "40000",
// "api_tran_dtm" : "20200305163430079",
// "bank_rsp_code" : "000",
// "bank_tran_id" : "T991591360U163429234",
// "bank_rsp_message" : ""
// }
// }
// """
//
// let json = ResponseContainerObject<BalanceModel>(JSONString: testString)
// guard let test = json?.data else { return }
// success(test)
APIRouter.fetchBalace( APIRouter.fetchBalace(
type: type, type: type,
fintechUseNumber: fintechUseNumber fintechUseNumber: fintechUseNumber
@ -117,9 +151,7 @@ class PhoneCardRechargeService: PhoneCardRechargeServiceType {
let json = ResponseContainerArray<Account>(JSONString: testString) let json = ResponseContainerArray<Account>(JSONString: testString)
success(json?.data ?? []) success(json?.data ?? [])
//APIRouter.fetchBankListForPowerCall.json(success: success, failure: failure)
// APIRouter.fetchBankListForPowerCall.json(success: success, failure: failure)
} }
func fetchCardList( func fetchCardList(
@ -128,6 +160,50 @@ class PhoneCardRechargeService: PhoneCardRechargeServiceType {
success: @escaping (CardList) -> Void, success: @escaping (CardList) -> Void,
failure: @escaping (Error) -> Void failure: @escaping (Error) -> Void
) { ) {
// let testString =
// """
// {
// "Id" : "",
// "Extra" : "",
// "Extra2" : "",
// "Data" : {
// "CardListType" : "6",
// "CountryPriceCode" : null,
// "CardInfo" :
// "ButtonsGrid" : [
// {
// "Price" : "10000"
// },
// {
// "Price" : "20000"
// },
// {
// "Price" : "30000"
// },
// {
// "Price" : "40000"
// },
// {
// "Price" : "50000"
// },
// {
// "Price" : "100000"
// }
// ]
// },
// "ErrorCode" : "0",
// "Msg" : "Success"
// }
//"""
// let json = ResponseContainerObject<CardList>(JSONString: testString)
// guard let test = json?.data else { return }
// success(test)
APIRouter.fetchCardList(type: type, mobile: mobile) APIRouter.fetchCardList(type: type, mobile: mobile)
.json(success: success, failure: failure) .json(success: success, failure: failure)
} }

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

@ -89,7 +89,6 @@ class PhoneCardRechargePresenter: ViewModelType {
private let bankModel = BehaviorSubject<[Account]>(value: []) private let bankModel = BehaviorSubject<[Account]>(value: [])
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 accounts: Account? private var accounts: Account?
func transform(input: Input) -> Output { func transform(input: Input) -> Output {
@ -111,7 +110,6 @@ 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)
@ -131,20 +129,20 @@ class PhoneCardRechargePresenter: ViewModelType {
guard let index = tag, model.count > 0 else { return nil } guard let index = tag, model.count > 0 else { return nil }
return model[index] return model[index]
}, },
input.selectedCarrierType.asObservable(),
input.selectedCarrierPlan.asObservable(), input.selectedCarrierPlan.asObservable(),
input.selectedDataOnlyType.asObservable(), input.selectedDataOnlyType.asObservable(),
selectedPaymentMode.asObservable()
selectedPaymentMode.asObservable(),
getBalanceLinker.asObservable()
) )
let carrierPlanModel = input.selectedCarrierType.map { $0?.subCardInfo ?? [] } let carrierPlanModel = input.selectedCarrierType.map { $0?.subCardInfo ?? [] }
let detailCarrierPlanModel = input.selectedCarrierPlan.map { $0?.planInfo } let detailCarrierPlanModel = input.selectedCarrierPlan.map { $0?.planInfo }
let isEnableNext = combinedInput let isEnableNext = combinedInput
.map { balance, _, type, priceModel, _, carrierPlan, dataOnlyType, selectPaymentType -> Status in
.map { balance, _, type, priceModel, carrierPlan, dataOnlyType, selectedPaymentType, autoDebitBalance -> Status in
if selectPaymentType?.type == "wallet" {
if selectedPaymentType?.type == "wallet" {
switch type { switch type {
case .regular: case .regular:
@ -169,12 +167,45 @@ class PhoneCardRechargePresenter: ViewModelType {
return (true, amount <= balance) return (true, amount <= balance)
} }
} }
if selectedPaymentType?.type == "autodebit",
autoDebitBalance?.balance != nil
{
switch type {
case .regular:
guard
let paymentAmount = priceModel?.price,
let amount = Int(paymentAmount),
let setAutoDebitBalance = autoDebitBalance?.balance,
let autoDebitAmount = Int(setAutoDebitBalance) else { return (false, false) }
return (true, amount <= autoDebitAmount)
case .fixed:
guard
let paymentAmount = carrierPlan?.facePrice,
let amount = Int(paymentAmount),
let setAutoDebitBalance = autoDebitBalance?.balance,
let autoDebitAmount = Int(setAutoDebitBalance) else { return (false, false) }
return (true, amount <= autoDebitAmount)
case .dataOnly:
guard
let paymentAmount = dataOnlyType?.facePrice,
let amount = Int(paymentAmount),
let setAutoDebitBalance = autoDebitBalance?.balance,
let autoDebitAmount = Int(setAutoDebitBalance) else { return (false, false) }
return (true, amount <= autoDebitAmount)
}
}
return (true, true) return (true, true)
} }
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, selectPaymentType, _) -> RechargeModel? in
switch type { switch type {

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

@ -32,6 +32,7 @@ class RechargePaymentViewController: UIViewController {
private lazy var availableBalance = BehaviorSubject<String>(value: "0") private lazy var availableBalance = BehaviorSubject<String>(value: "0")
private lazy var rechargeSuccess = PublishSubject<CreditCardReceipt>() private lazy var rechargeSuccess = PublishSubject<CreditCardReceipt>()
private lazy var password = PublishSubject<String>() private lazy var password = PublishSubject<String>()
private var accounts: RechargeModel?
private var isFirst = true private var isFirst = true
// MARK: Computed Properties // MARK: Computed Properties
@ -167,8 +168,9 @@ extension RechargePaymentViewController {
} }
guard let `self` = self else { guard let `self` = self else {
return return
} }
self.accounts = model
//let message = "possessed_coupon_number_text".localized().replacingOccurrences(of: "xxx", with: "\(couponList?.count ?? 0)") //let message = "possessed_coupon_number_text".localized().replacingOccurrences(of: "xxx", with: "\(couponList?.count ?? 0)")
if model.paymentType == "autodebit" { if model.paymentType == "autodebit" {
self.gmeWalletStackView.isHidden = true self.gmeWalletStackView.isHidden = true
@ -239,9 +241,27 @@ extension RechargePaymentViewController: BiometricAuthenticationViewControllerDe
print("BiometricAuthenticationWireframe Error: \(errorMessage ?? "")") print("BiometricAuthenticationWireframe Error: \(errorMessage ?? "")")
viewController.dismiss(animated: true) { viewController.dismiss(animated: true) {
switch error { switch error {
case .userFallback: case .userFallback:
self.showSecureKeypad()
guard let type = self.accounts?.type else { return }
switch type {
case "wallet":
self.showSecureKeypad()
case "autodebit":
()
// SendMoneyCodeWireframe().open(
// requestmodel: nil,
// completion: (),
// source: self
// )
default:
break
}
case .biometryNotEnrolled, .notBeConfigured, .biometryNotAvailable: case .biometryNotEnrolled, .notBeConfigured, .biometryNotAvailable:
self.alert(type: .error, message: error.message) self.alert(type: .error, message: error.message)
default: default:

4
GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyVerification/User Interface/View/SendMoneyVerification.storyboard

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/> <device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
<capability name="Named colors" minToolsVersion="9.0"/> <capability name="Named colors" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>

Loading…
Cancel
Save