Browse Source

connected recharge history api

pull/1/head
InKwon James Kim 5 years ago
parent
commit
ff40dea55f
  1. 34
      GME Remit/APIs/Router/APIRouter.swift
  2. 24
      GME Remit/AppDelegate.swift
  3. 8
      GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/Presenter/PhoneCardRechargePresenter.swift
  4. 27
      GME Remit/Modules/PowerCallModules/LocalTopup/PhoneCardRecharge/User Interface/View/PhoneCardRechargeViewController.swift
  5. 19
      GME Remit/Modules/PowerCallModules/RechargeHistory/Application Logic/Service/RechargeHistoryService.swift
  6. 85
      GME Remit/Modules/PowerCallModules/RechargeHistory/User Interface/View/RechargeHistory.storyboard
  7. 2
      GME Remit/Modules/PowerCallModules/RechargePayment/Application Logic/Interactor/RechargePaymentInteractor.swift
  8. 2
      GME Remit/Modules/PowerCallModules/RechargePayment/Application Logic/Interactor/RechargePaymentInteractorIO.swift
  9. 2
      GME Remit/Modules/PowerCallModules/RechargePayment/Application Logic/Service/RechargePaymentService.swift
  10. 2
      GME Remit/Modules/PowerCallModules/RechargePayment/Application Logic/Service/RechargePaymentServiceType.swift
  11. 8
      GME Remit/Modules/PowerCallModules/RechargePayment/User Interface/Presenter/RechargePaymentPresenter.swift
  12. 16
      GME Remit/Modules/PowerCallModules/RechargePayment/User Interface/View/RechargePaymentViewController.swift
  13. 1061
      GME Remit/Modules/SideMenu/SideMenu.storyboard
  14. 24
      GME Remit/Utilities/CustomUI/GMEAlert/GMEAlertViewController.xib

34
GME Remit/APIs/Router/APIRouter.swift

@ -67,6 +67,7 @@ enum APIRouter {
// MARK: - Recharge Prepiad Phone
case fetchCardList(type: String, mobile: String)
case verificationAndBuy(model: RechargeModel)
case fetchRechargeHistory(from: String, to: String)
}
// MARK: - Request
@ -137,8 +138,9 @@ extension APIRouter: ApiServiceType {
headers: needsAuthorization ? afterLoginHeader : beforeLoginHeader
).handle(
success: { (response: ResponseContainer<Void>) in
if (response.errorCode ?? "") == "1" {
let error = NSError(domain: "Network", code: 0, message: response.message ?? "")
if (response.errorCode ?? "") != "0" {
let code = Int(response.errorCode ?? "1") ?? 1
let error = NSError(domain: "Network", code: code, message: response.message ?? "")
failure(error)
} else {
success()
@ -173,8 +175,9 @@ extension APIRouter: ApiServiceType {
headers: needsAuthorization ? afterLoginHeader : beforeLoginHeader
).handle(
success: { (response: ResponseContainer<Element>) in
if (response.errorCode ?? "") == "1" {
let error = NSError(domain: "Network", code: 0, message: response.message ?? "")
if (response.errorCode ?? "") != "0" {
let code = Int(response.errorCode ?? "1") ?? 1
let error = NSError(domain: "Network", code: code, message: response.message ?? "")
failure(error)
} else {
guard let data = response.data else {
@ -215,8 +218,9 @@ extension APIRouter: ApiServiceType {
)
.handle(
success: { (response: ResponseContainerObject<Element>) in
if (response.errorCode ?? "") == "1" {
let error = NSError(domain: "Network", code: 0, message: response.message ?? "")
if (response.errorCode ?? "") != "0" {
let code = Int(response.errorCode ?? "1") ?? 1
let error = NSError(domain: "Network", code: code, message: response.message ?? "")
failure(error)
} else {
guard let data = response.data else {
@ -257,8 +261,9 @@ extension APIRouter: ApiServiceType {
)
.handle(
success: { (response: ResponseContainerArray<Element>) in
if (response.errorCode ?? "") == "1" {
let error = NSError(domain: "Network", code: 0, message: response.message ?? "")
if (response.errorCode ?? "") != "0" {
let code = Int(response.errorCode ?? "1") ?? 1
let error = NSError(domain: "Network", code: code, message: response.message ?? "")
failure(error)
} else {
guard let data = response.data else {
@ -458,6 +463,8 @@ extension APIRouter {
return "\(baseUrl)/powerCall/GetCardList/"
case .verificationAndBuy:
return "\(baseUrl)/powerCall/VerificationAndBuy/"
case .fetchRechargeHistory:
return "\(baseUrl)/powerCall/GetChargeHistory/"
}
}
}
@ -526,6 +533,8 @@ extension APIRouter {
return .post
case .verificationAndBuy:
return .post
case .fetchRechargeHistory:
return .post
}
}
@ -729,7 +738,9 @@ extension APIRouter {
]
case .fetchCardList(let type, let mobile):
let senderID = GMEDB.shared.user.string(.senderId) ?? ""
return [
"CustomerId" : senderID,
"getcardType": type,
"phoneNo": mobile
]
@ -749,6 +760,13 @@ extension APIRouter {
"UseBalancePrice" : model.useBalancePrice ?? "",
"PassWord": model.password ?? ""
]
case .fetchRechargeHistory(let from, let to):
let senderID = GMEDB.shared.user.string(.senderId) ?? ""
return [
"CustomerId": senderID,
"FromDate" : from,
"ToDate": to
]
default: return nil
}

24
GME Remit/AppDelegate.swift

@ -56,14 +56,20 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let center = UNUserNotificationCenter.current()
center.delegate = self
center.requestAuthorization(options: [.alert, .sound, .badge]) { (_, _) in}
application.registerForRemoteNotifications()
center.requestAuthorization(options: [.alert, .sound, .badge]) { (granted, _) in
guard granted else { return }
center.getNotificationSettings { settings in
print("Notification settings: \(settings)")
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
}
}
}
// Initialize ChannelIO
ChannelIO.initialize()
self.window?.rootViewController = LauncherScreenWireframe().getMainView()
GMEDB
.shared
.app
@ -71,6 +77,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
StoreReviewHelper.shared.incrementAppOpenedCount()
self.window?.rootViewController = LauncherScreenWireframe().getMainView()
// Check launch from notification.
// let notificationOption = launchOptions?[.remoteNotification]
// if let notification = notificationOption as? [String: AnyObject],
// let aps = notification["aps"] as? [String: AnyObject] {
//
// (window?.rootViewController as? UITabBarController)?.selectedIndex = 3
// }
return true
}

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

@ -60,7 +60,7 @@ class PhoneCardRechargePresenter: ViewModelType {
let isError: Driver<Error>
let isProgress: Driver<Bool>
let isEnableNext: Driver<Status>
let isSuccessPayment: Driver<VerificationAndBuy>
let isSuccessPayment: Driver<Void>
let regularModel: Driver<[PriceModel]>
let fixedModel: Driver<[MainCardInformation]>
let carrierPlanModel: Driver<[CardInformation]>
@ -72,7 +72,7 @@ class PhoneCardRechargePresenter: ViewModelType {
private let progressLinker = PublishSubject<Bool>()
private let errorLinker = PublishSubject<Error>()
private let isSuccessPayment = PublishSubject<VerificationAndBuy>()
private let isSuccessPayment = PublishSubject<Void>()
private let regularModel = BehaviorSubject<[PriceModel]>(value: [])
private let fixedModel = BehaviorSubject<[MainCardInformation]>(value: [])
@ -209,7 +209,7 @@ extension PhoneCardRechargePresenter: PhoneCardRechargeWireframeOutput {
}
extension PhoneCardRechargePresenter: RechargePayementDelegate {
func rechargePayment(_ viewController: UIViewController, didComplete data: VerificationAndBuy) {
isSuccessPayment.onNext(data)
func rechargePayment(_ viewController: UIViewController) {
isSuccessPayment.onNext(())
}
}

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

@ -171,7 +171,20 @@ extension PhoneCardRechargeViewController {
output.isError
.drive(
onNext: { self.alert(type: .error, message: $0.localizedDescription) }
onNext: { [weak self] in
let error = $0 as NSError
if error.code == 5 {
self?.alert(
type: .error,
message: "You have a recent request for recharging.\nWait for the results of this request."
) {
self?.navigationController?.popToRootViewController(animated: true)
}
} else {
self?.alert(type: .error, message: $0.localizedDescription)
}
}
).disposed(by: disposeBag)
output.isProgress
@ -181,9 +194,15 @@ extension PhoneCardRechargeViewController {
output.isSuccessPayment
.drive(
onNext: {[weak self] receipt in
print("receipt: \(receipt)")
self?.navigationController?.popToRootViewController(animated: true)
onNext: {[weak self] in
self?.alertWithOk(
type: .success,
message: "The recharge request successfuly.\nYou can check it's result at Recharge History",
title: "Recharge Request Success",
okTitle: "Ok"
) {
self?.navigationController?.popToRootViewController(animated: true)
}
}).disposed(by: disposeBag)
output.isEnableNext

19
GME Remit/Modules/PowerCallModules/RechargeHistory/Application Logic/Service/RechargeHistoryService.swift

@ -91,14 +91,17 @@ class RechargeHistoryService: RechargeHistoryServiceType {
]
}
"""
guard
let json = ResponseContainerArray<RechargeHistory>(JSONString: text),
let data = json.data else {
let error = NSError(domain: "TEST data error", code: 0, message: "Wrong Test Data")
failure(error)
return
}
// guard
// let json = ResponseContainerArray<RechargeHistory>(JSONString: text),
// let data = json.data else {
// let error = NSError(domain: "TEST data error", code: 0, message: "Wrong Test Data")
// failure(error)
// return
// }
//
// success(data)
success(data)
APIRouter.fetchRechargeHistory(from: from, to: to)
.json(success: success, failure: failure)
}
}

85
GME Remit/Modules/PowerCallModules/RechargeHistory/User Interface/View/RechargeHistory.storyboard

@ -1,6 +1,6 @@
<?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" useSafeAreas="YES" colorMatched="YES" initialViewController="HSb-ou-7T5">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<device id="retina4_0" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15509"/>
@ -25,20 +25,20 @@
<objects>
<viewController storyboardIdentifier="RechargeHistoryViewController" title="RechargeHistory" id="HSb-ou-7T5" customClass="RechargeHistoryViewController" customModule="GME_Remit" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="9Uc-9s-KgO">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="wYq-sy-WtH">
<rect key="frame" x="10" y="10" width="355" height="647"/>
<rect key="frame" x="10" y="10" width="300" height="548"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GyV-RQ-S76">
<rect key="frame" x="0.0" y="0.0" width="355" height="50"/>
<rect key="frame" x="0.0" y="0.0" width="300" height="50"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FbO-fp-5M1">
<rect key="frame" x="0.0" y="0.0" width="305" height="50"/>
<rect key="frame" x="0.0" y="0.0" width="250" height="50"/>
<subviews>
<searchBar contentMode="redraw" searchBarStyle="minimal" translatesAutoresizingMaskIntoConstraints="NO" id="viD-UT-958">
<rect key="frame" x="0.0" y="0.0" width="305" height="50"/>
<rect key="frame" x="0.0" y="0.0" width="250" height="50"/>
<textInputTraits key="textInputTraits"/>
</searchBar>
</subviews>
@ -52,7 +52,7 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aJz-Qa-aaJ">
<rect key="frame" x="305" y="0.0" width="50" height="50"/>
<rect key="frame" x="250" y="0.0" width="50" height="50"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IRp-JR-dKF">
<rect key="frame" x="5" y="5" width="40" height="40"/>
@ -73,13 +73,13 @@
</constraints>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Yw9-cK-pIF">
<rect key="frame" x="0.0" y="60" width="355" height="35"/>
<rect key="frame" x="0.0" y="60" width="300" height="35"/>
<subviews>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="EHz-NG-QNu">
<rect key="frame" x="0.0" y="1" width="355" height="33"/>
<rect key="frame" x="0.0" y="1" width="300" height="33"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="VZm-PZ-6xT">
<rect key="frame" x="115" y="-8.5" width="125" height="50"/>
<rect key="frame" x="87" y="-8.5" width="126" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kXj-V1-9fF">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
@ -88,13 +88,13 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="~" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vc7-6n-qg3">
<rect key="frame" x="58" y="0.0" width="9" height="50"/>
<rect key="frame" x="58" y="0.0" width="10" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="16"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dwn-HQ-Zqv">
<rect key="frame" x="75" y="0.0" width="50" height="50"/>
<rect key="frame" x="76" y="0.0" width="50" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="16"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
@ -102,7 +102,7 @@
</subviews>
</stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mtc-x2-p8u">
<rect key="frame" x="330" y="9" width="15" height="15"/>
<rect key="frame" x="275" y="9" width="15" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="81h-kW-v0l"/>
<constraint firstAttribute="width" constant="15" id="nfu-bk-LLl"/>
@ -129,16 +129,16 @@
</constraints>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" allowsSelection="NO" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="kkE-JE-vKh">
<rect key="frame" x="0.0" y="105" width="355" height="501"/>
<rect key="frame" x="0.0" y="105" width="300" height="402"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="separatorColor" name="ThemeSeparate"/>
<inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
<view key="tableFooterView" contentMode="scaleToFill" id="sUn-Qd-aYI">
<rect key="frame" x="0.0" y="169" width="355" height="44"/>
<rect key="frame" x="0.0" y="169" width="300" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="There are no histories" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Om4-pB-2Ja">
<rect key="frame" x="112.5" y="13.5" width="130" height="17"/>
<rect key="frame" x="82.5" y="14" width="135" height="16.5"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
@ -152,35 +152,35 @@
</view>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="RechargeHistoryCell" rowHeight="113" id="swM-we-WxX" customClass="RechargeHistoryCell" customModule="GME_Remit" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="355" height="113"/>
<rect key="frame" x="0.0" y="28" width="300" height="113"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="swM-we-WxX" id="SyI-Yh-F6t">
<rect key="frame" x="0.0" y="0.0" width="355" height="113"/>
<rect key="frame" x="0.0" y="0.0" width="300" height="113"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="XEu-qK-Fq6">
<rect key="frame" x="5" y="10" width="345" height="93"/>
<rect key="frame" x="5" y="10" width="290" height="93"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="l51-EO-9in">
<rect key="frame" x="10" y="0.0" width="325" height="93"/>
<rect key="frame" x="10" y="0.0" width="270" height="93"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="e4B-m5-N2F">
<rect key="frame" x="0.0" y="0.0" width="162.5" height="93"/>
<rect key="frame" x="0.0" y="0.0" width="135" height="93"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2019-09-01" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="49V-na-ypy">
<rect key="frame" x="0.0" y="0.0" width="162.5" height="31"/>
<rect key="frame" x="0.0" y="0.0" width="135" height="31"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="01052850125" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yyY-9Y-N6Y">
<rect key="frame" x="0.0" y="31" width="162.5" height="31"/>
<rect key="frame" x="0.0" y="31" width="135" height="31"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="17"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="1fj-KC-kUK">
<rect key="frame" x="0.0" y="62" width="162.5" height="31"/>
<rect key="frame" x="0.0" y="62" width="135" height="31"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="MONTH CHARGE" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BBN-Ac-cxM">
<rect key="frame" x="0.0" y="0.0" width="48" height="31"/>
@ -201,7 +201,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="MyWorld(LG)" lineBreakMode="wordWrap" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tyc-aK-AO9">
<rect key="frame" x="63" y="0.0" width="99.5" height="31"/>
<rect key="frame" x="63" y="0.0" width="72" height="31"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
@ -211,25 +211,25 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="U8A-T1-eY7">
<rect key="frame" x="162.5" y="0.0" width="162.5" height="93"/>
<rect key="frame" x="135" y="0.0" width="135" height="93"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="19110509232455040154" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2Pu-nb-I9s">
<rect key="frame" x="0.0" y="0.0" width="162.5" height="31"/>
<rect key="frame" x="0.0" y="0.0" width="135" height="31"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="2dw-zT-2Pf">
<rect key="frame" x="0.0" y="31" width="162.5" height="31"/>
<rect key="frame" x="0.0" y="31" width="135" height="31"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="₩" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mgy-4U-TZj">
<rect key="frame" x="0.0" y="0.0" width="101.5" height="31"/>
<rect key="frame" x="0.0" y="0.0" width="74.5" height="31"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Bold" family="San Francisco Display" pointSize="18"/>
<color key="textColor" name="ThemeRed"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="39,900" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MM0-Z4-RVA">
<rect key="frame" x="106.5" y="0.0" width="56" height="31"/>
<rect key="frame" x="79.5" y="0.0" width="55.5" height="31"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Bold" family="San Francisco Display" pointSize="18"/>
<color key="textColor" name="ThemeRed"/>
<nil key="highlightedColor"/>
@ -237,10 +237,10 @@
</subviews>
</stackView>
<view opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Fek-GZ-fOJ">
<rect key="frame" x="0.0" y="62" width="162.5" height="31"/>
<rect key="frame" x="0.0" y="62" width="135" height="31"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SUCCESS" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HJ4-VI-zKR">
<rect key="frame" x="62.5" y="5" width="100" height="21"/>
<rect key="frame" x="35" y="5" width="100" height="21"/>
<color key="backgroundColor" name="ThemeBlue"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="yiS-nm-Rfh"/>
@ -293,32 +293,28 @@
</prototypes>
</tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="n1y-jr-cUl">
<rect key="frame" x="0.0" y="616" width="355" height="31"/>
<rect key="frame" x="0.0" y="517" width="300" height="31"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="7" translatesAutoresizingMaskIntoConstraints="NO" id="p4Y-mp-BXT">
<rect key="frame" x="0.0" y="5" width="355" height="21"/>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="7" translatesAutoresizingMaskIntoConstraints="NO" id="p4Y-mp-BXT">
<rect key="frame" x="0.0" y="5" width="300" height="21"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5Wn-gZ-2ei">
<rect key="frame" x="0.0" y="0.0" width="34" height="21"/>
<rect key="frame" x="0.0" y="0.0" width="70" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="WAITING" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="qBt-j3-Y9y">
<rect key="frame" x="41" y="0.0" width="100" height="21"/>
<rect key="frame" x="77" y="0.0" width="69.5" height="21"/>
<color key="backgroundColor" name="ThemeGreen"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="oDL-Tf-acl"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="14"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SUCCESS" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="JhP-It-2Dc">
<rect key="frame" x="148" y="0.0" width="100" height="21"/>
<rect key="frame" x="153.5" y="0.0" width="70" height="21"/>
<color key="backgroundColor" name="ThemeBlue"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="R2o-gL-D9Y"/>
<constraint firstAttribute="height" constant="21" id="nV0-Mc-HUY"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="14"/>
@ -326,11 +322,8 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="FAILURE" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="SyV-28-eMx">
<rect key="frame" x="255" y="0.0" width="100" height="21"/>
<rect key="frame" x="230.5" y="0.0" width="69.5" height="21"/>
<color key="backgroundColor" name="ThemeRed"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="Owv-Th-8g0"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="14"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>

2
GME Remit/Modules/PowerCallModules/RechargePayment/Application Logic/Interactor/RechargePaymentInteractor.swift

@ -35,7 +35,7 @@ extension RechargePaymentInteractor: RechargePaymentInteractorInput {
service.submit(
of: model,
success: { [weak self] in
self?.output?.setSubmitSuccess(with: $0)
self?.output?.setSubmitSuccess()
},
failure: {[weak self] in
self?.output?.setError(with: $0)

2
GME Remit/Modules/PowerCallModules/RechargePayment/Application Logic/Interactor/RechargePaymentInteractorIO.swift

@ -13,6 +13,6 @@ protocol RechargePaymentInteractorInput: class {
protocol RechargePaymentInteractorOutput: class {
func setModel(with model: RechargeModel?)
func setSubmitSuccess(with model: VerificationAndBuy)
func setSubmitSuccess()
func setError(with error: Error)
}

2
GME Remit/Modules/PowerCallModules/RechargePayment/Application Logic/Service/RechargePaymentService.swift

@ -11,7 +11,7 @@ import Foundation
class RechargePaymentService: RechargePaymentServiceType {
func submit(
of model: RechargeModel,
success: @escaping (VerificationAndBuy) -> Void,
success: @escaping () -> Void,
failure: @escaping (Error) -> Void
) {
APIRouter.verificationAndBuy(model: model).json(

2
GME Remit/Modules/PowerCallModules/RechargePayment/Application Logic/Service/RechargePaymentServiceType.swift

@ -9,7 +9,7 @@
protocol RechargePaymentServiceType: class {
func submit(
of model: RechargeModel,
success: @escaping (VerificationAndBuy) -> Void,
success: @escaping () -> Void,
failure: @escaping (Error) -> Void
)
}

8
GME Remit/Modules/PowerCallModules/RechargePayment/User Interface/Presenter/RechargePaymentPresenter.swift

@ -26,7 +26,7 @@ class RechargePaymentPresenter: ViewModelType {
let rechargeModel: Driver<RechargeModel?>
let paymentAmount: Driver<String>
let remainingBalance: Driver<String>
let submitSuccess: Driver<VerificationAndBuy>
let submitSuccess: Driver<Void>
}
private let disposeBag = DisposeBag()
@ -35,7 +35,7 @@ class RechargePaymentPresenter: ViewModelType {
private let errorLinker = PublishSubject<Error>()
private var model = BehaviorSubject<RechargeModel?>(value: nil)
private var submitSuccess = PublishSubject<VerificationAndBuy>()
private var submitSuccess = PublishSubject<Void>()
func transform(input: Input) -> Output {
@ -80,9 +80,9 @@ class RechargePaymentPresenter: ViewModelType {
// MARK: RechargePayment interactor output interface
extension RechargePaymentPresenter: RechargePaymentInteractorOutput {
func setSubmitSuccess(with model: VerificationAndBuy) {
func setSubmitSuccess() {
progressLinker.onNext(false)
submitSuccess.onNext(model)
submitSuccess.onNext(())
}
func setError(with error: Error) {

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

@ -18,7 +18,7 @@ enum RechargePaymentMode {
}
protocol RechargePayementDelegate: class {
func rechargePayment(_ viewController: UIViewController, didComplete data: VerificationAndBuy)
func rechargePayment(_ viewController: UIViewController)
}
class RechargePaymentViewController: UIViewController {
@ -122,18 +122,10 @@ extension RechargePaymentViewController {
.disposed(by: disposeBag)
output.submitSuccess
.drive(onNext: {[weak self] model in
.drive(onNext: {[weak self] in
guard let `self` = self else {return}
self.alertWithOk(
type: .success,
message: "You will receive message about recharge result through SMS.",
title: "Payment Request completed",
okTitle: "Ok"
) {
self.dismiss(animated: true) {
self.delegate?.rechargePayment(self, didComplete: model)
}
self.dismiss(animated: true) {
self.delegate?.rechargePayment(self)
}
}).disposed(by: disposeBag)

1061
GME Remit/Modules/SideMenu/SideMenu.storyboard
File diff suppressed because it is too large
View File

24
GME Remit/Utilities/CustomUI/GMEAlert/GMEAlertViewController.xib

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15400" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15404"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15509"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@ -39,10 +39,10 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<subviews>
<view opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bog-Yc-fSF">
<rect key="frame" x="37.5" y="176" width="300" height="315"/>
<rect key="frame" x="37.5" y="179" width="300" height="309"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="ivh-OD-kSD">
<rect key="frame" x="0.0" y="0.0" width="300" height="315"/>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="ivh-OD-kSD">
<rect key="frame" x="0.0" y="0.0" width="300" height="309"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wjc-TX-aEf">
<rect key="frame" x="0.0" y="0.0" width="300" height="80"/>
@ -64,18 +64,18 @@
</constraints>
</view>
<view opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dwd-4A-fUB">
<rect key="frame" x="0.0" y="88" width="300" height="169"/>
<rect key="frame" x="0.0" y="85" width="300" height="169"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="61r-PG-8gH">
<rect key="frame" x="20" y="10" width="260" height="139"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Would you like to renew your token now?" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rfn-wg-MBE">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Would you like to renew your token now?" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="rfn-wg-MBE">
<rect key="frame" x="0.0" y="0.0" width="260" height="52"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="18"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vZn-aC-Kup">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="vZn-aC-Kup">
<rect key="frame" x="0.0" y="57" width="260" height="82"/>
<string key="text">Your auto debit token expires after 30 days.
@ -96,7 +96,7 @@
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TJL-Yy-ccg">
<rect key="frame" x="0.0" y="265" width="300" height="50"/>
<rect key="frame" x="0.0" y="259" width="300" height="50"/>
<subviews>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JWT-7G-nWP">
<rect key="frame" x="0.0" y="0.0" width="120" height="50"/>
@ -163,13 +163,13 @@
</objects>
<resources>
<namedColor name="ThemeMainBackground">
<color red="0.097999997437000275" green="0.097999997437000275" blue="0.097999997437000275" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="ThemeRed">
<color red="1" green="0.15299999713897705" blue="0.15299999713897705" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.92900002002716064" green="0.10599999874830246" blue="0.14100000262260437" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="ThemeText">
<color white="0.80299997329711914" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color red="0.28999999165534973" green="0.28999999165534973" blue="0.28999999165534973" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
Loading…
Cancel
Save