Browse Source

Merge branch '1_reward'

pull/1/head
james 5 years ago
parent
commit
9d69d64f9a
  1. 1
      GMERemittance/Extension/DataRequestExtension.swift
  2. 2
      GMERemittance/Module/RewardModules/Reward/User Interface/View/Cell/RewardItemCollectionViewCell.swift
  3. 4
      GMERemittance/Module/SendMoney/SendMoneyParent/User Interface/View/SendMoneyParentViewController.swift
  4. 4
      GMERemittance/Module/SendMoney/SendMoneyPaymentMode/User Interface/View/SendMoneyPaymentMode.storyboard
  5. 7
      GMERemittance/Module/SendMoney/SendMoneyVerification/Application Logic/Interactor/SendMoneyVerificationInteractor.swift
  6. 4
      GMERemittance/Module/SendMoney/SendMoneyVerification/Application Logic/Service/SendMoneyVerificationServiceType.swift
  7. 16
      GMERemittance/Module/SendMoney/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift

1
GMERemittance/Extension/DataRequestExtension.swift

@ -48,6 +48,7 @@ extension DataRequest {
MainWireframe.logoutWarningAlert(message: "You will be logout because you are connected from another device.") MainWireframe.logoutWarningAlert(message: "You will be logout because you are connected from another device.")
return return
} }
failure(error)
} }
} }
} }

2
GMERemittance/Module/RewardModules/Reward/User Interface/View/Cell/RewardItemCollectionViewCell.swift

@ -56,7 +56,7 @@ class RewardItemCollectionViewCell: UICollectionViewCell {
let totalPoint = UserDefaults.standard.integer(forKey: UserKeys.rewardPoint) let totalPoint = UserDefaults.standard.integer(forKey: UserKeys.rewardPoint)
let isEnable = totalPoint > Int(self.model?.pointPrice ?? "") ?? 0
let isEnable = totalPoint >= Int(self.model?.pointPrice ?? "") ?? 0
self.redeemButton.backgroundColor = isEnable ? AppConstants.themeRedColor : .lightGray self.redeemButton.backgroundColor = isEnable ? AppConstants.themeRedColor : .lightGray
self.redeemButton.isEnabled = isEnable self.redeemButton.isEnabled = isEnable

4
GMERemittance/Module/SendMoney/SendMoneyParent/User Interface/View/SendMoneyParentViewController.swift

@ -297,11 +297,11 @@ extension SendMoneyParentViewController: SendMoneyParentViewInterface {
extension SendMoneyParentViewController: HUDStatusDelegate { extension SendMoneyParentViewController: HUDStatusDelegate {
func showLoading() { func showLoading() {
self.showProgressHud()
self.tabBarController?.showProgressHud()
} }
func hideLoading() { func hideLoading() {
self.hideProgressHud()
self.tabBarController?.hideProgressHud()
} }
} }

4
GMERemittance/Module/SendMoney/SendMoneyPaymentMode/User Interface/View/SendMoneyPaymentMode.storyboard

@ -192,11 +192,11 @@
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="XD6-uC-3cA"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="XD6-uC-3cA">
<rect key="frame" x="0.0" y="110" width="355" height="44"/> <rect key="frame" x="0.0" y="110" width="355" height="44"/>
<subviews> <subviews>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Account Number" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="hUc-L0-iaO">
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Account Number" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="hUc-L0-iaO">
<rect key="frame" x="0.0" y="0.0" width="355" height="44"/> <rect key="frame" x="0.0" y="0.0" width="355" height="44"/>
<color key="textColor" red="0.29019607843137252" green="0.29019607843137252" blue="0.29019607843137252" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.29019607843137252" green="0.29019607843137252" blue="0.29019607843137252" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/> <fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="12"/>
<textInputTraits key="textInputTraits" keyboardType="namePhonePad"/>
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
</textField> </textField>
</subviews> </subviews>
<constraints> <constraints>

7
GMERemittance/Module/SendMoney/SendMoneyVerification/Application Logic/Interactor/SendMoneyVerificationInteractor.swift

@ -59,15 +59,15 @@ extension SendMoneyVerificationInteractor: SendMoneyVerificationInteractorInput
return Notification.Name.init(AppConstants.yearlyLimitNotification) return Notification.Name.init(AppConstants.yearlyLimitNotification)
} }
func getParams(model: SendMoneyRequestModel, reciepient: Recipient) -> [String: String] {
func getParams(model: SendMoneyRequestModel, reciepient: Recipient) -> [String: Any] {
let _default = UserDefaults.standard let _default = UserDefaults.standard
guard let username = _default.value(forKey: UserKeys.userId) as? String else {return [:]} guard let username = _default.value(forKey: UserKeys.userId) as? String else {return [:]}
let senderId = _default.value(forKey: UserKeys.senderId) as? String let senderId = _default.value(forKey: UserKeys.senderId) as? String
let recieverId = reciepient.recipientId let recieverId = reciepient.recipientId
let isUseBiometric = KeyChain.shared.get(key: .biometricAuth) == "1" ? true : false
let params: [String: String] =
let params: [String: Any] =
[ [
"user": username, "user": username,
"senderId": senderId ?? "", "senderId": senderId ?? "",
@ -104,6 +104,7 @@ extension SendMoneyVerificationInteractor: SendMoneyVerificationInteractorInput
"txnPassword": model.transactionPassword ?? "", "txnPassword": model.transactionPassword ?? "",
"ReceiverAccountNo": model.paymemtMode?.accountNumber ?? "", "ReceiverAccountNo": model.paymemtMode?.accountNumber ?? "",
"KftcLogId": model.autoDebitAccount?.kftcLogId ?? "", "KftcLogId": model.autoDebitAccount?.kftcLogId ?? "",
"isUseBiometric": isUseBiometric
] ]
return params return params

4
GMERemittance/Module/SendMoney/SendMoneyVerification/Application Logic/Service/SendMoneyVerificationServiceType.swift

@ -14,12 +14,12 @@ protocol SendMoneyVerificationServiceType: class, SendMoneyVerificationSubmitApi
protocol SendMoneyVerificationSubmitApi: ApiServiceType { protocol SendMoneyVerificationSubmitApi: ApiServiceType {
func submit(params: [String: String], success: @escaping (SendMoneySubmitModelContainer?) -> (), failure: @escaping (Error) -> ())
func submit(params: [String: Any], success: @escaping (SendMoneySubmitModelContainer?) -> (), failure: @escaping (Error) -> ())
} }
extension SendMoneyVerificationSubmitApi { extension SendMoneyVerificationSubmitApi {
func submit(params: [String: String], success: @escaping (SendMoneySubmitModelContainer?) -> (), failure: @escaping (Error) -> ()) {
func submit(params: [String: Any], success: @escaping (SendMoneySubmitModelContainer?) -> (), failure: @escaping (Error) -> ()) {
let url = baseUrl + "/mobile/sendmoney/dotransaction" let url = baseUrl + "/mobile/sendmoney/dotransaction"
self.auth.request(method: .post, url: url, params: params, success: { (response: SendMoneySubmitModelContainer) in self.auth.request(method: .post, url: url, params: params, success: { (response: SendMoneySubmitModelContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {

16
GMERemittance/Module/SendMoney/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift

@ -235,17 +235,21 @@ class SendMoneyVerificationViewController: UITableViewController {
if (self.requestModel?.autoDebitAccount?.type ?? "").lowercased() == "wallet" { if (self.requestModel?.autoDebitAccount?.type ?? "").lowercased() == "wallet" {
if let isUseBiometricAuth = KeyChain.shared.get(key: .biometricAuth), isUseBiometricAuth == "1" {
if let isUseBiometric = KeyChain.shared.get(key: .biometricAuth), isUseBiometric == "1" {
let biometricAuthenticationWireframe = BiometricAuthenticationWireframe() let biometricAuthenticationWireframe = BiometricAuthenticationWireframe()
biometricAuthenticationWireframe.openWithDelegate(on: self, delegate: self) biometricAuthenticationWireframe.openWithDelegate(on: self, delegate: self)
} else { } else {
showQwertyTranskeyAction() showQwertyTranskeyAction()
} }
return
}
} else {
if let isUseBiometric = KeyChain.shared.get(key: .biometricAuth), isUseBiometric == "1" {
let biometricAuthenticationWireframe = BiometricAuthenticationWireframe()
biometricAuthenticationWireframe.openWithDelegate(on: self, delegate: self)
} else {
SendMoneyCodeWireframe().open(requestmodel: self.requestModel, completion: self.otpEntered, source: self) SendMoneyCodeWireframe().open(requestmodel: self.requestModel, completion: self.otpEntered, source: self)
} }
}
}
func otpEntered(otp: String) { func otpEntered(otp: String) {
self.password = otp self.password = otp
@ -260,7 +264,7 @@ class SendMoneyVerificationViewController: UITableViewController {
let hintStr = String(format:"pasword", 0) let hintStr = String(format:"pasword", 0)
let font = UIFont(name: "Arial", size: 15) let font = UIFont(name: "Arial", size: 15)
mQwertyTransKeyView?.mTK_SetHint(hintStr, font: font) mQwertyTransKeyView?.mTK_SetHint(hintStr, font: font)
// mQwertyTransKeyView?.mTK_ShowMessageIfMaxLength("16 .")i
// mQwertyTransKeyView?.mTK_ShowMessageIfMaxLength("16 .")i
mQwertyTransKeyView?.mTK_UseCursor(true) mQwertyTransKeyView?.mTK_UseCursor(true)
mQwertyTransKeyView?.mTK_UseAllDeleteButton(true) mQwertyTransKeyView?.mTK_UseAllDeleteButton(true)
mQwertyTransKeyView?.mTK_UseNavigationBar(true) mQwertyTransKeyView?.mTK_UseNavigationBar(true)
@ -329,7 +333,7 @@ extension SendMoneyVerificationViewController: SendMoneyVerificationViewInterfac
} }
func show(error: String) { func show(error: String) {
// self.presenter?.openReciept(transactionId: "1235")
// self.presenter?.openReciept(transactionId: "1235")
if isUsingBiometricAuth { if isUsingBiometricAuth {
if error.contains("Invalid Password") { if error.contains("Invalid Password") {
MainWireframe.logoutWarningAlert(message: "It is different from registered password.\nplease try to login again") MainWireframe.logoutWarningAlert(message: "It is different from registered password.\nplease try to login again")

Loading…
Cancel
Save