Skip to content

Commit

Permalink
Fix rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumedebavelaere authored and guillaumedebavelaere committed Oct 17, 2018
1 parent 3154513 commit 28fe7e7
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 61 deletions.
18 changes: 1 addition & 17 deletions TradeItIosTicketSDK2/TradeItCryptoOrder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -248,28 +248,12 @@
previewOrderResult: TradeItCryptoPreviewTradeResult
) -> TradeItPlaceOrderHandlers {
return { onSuccess, onSecurityQuestion, onFailure in
let placeOrderRequest = TradeItPlaceTradeRequest(orderId: previewOrderResult.orderId)
let placeOrderRequest = TradeItPlaceTradeRequest(orderId: previewOrderResult.orderId, andInterAppAddressCallback: "")
let placeResponseHandler = YCombinator { handler in
{ (result: TradeItResult?) in
switch result {
case let placeOrderResult as TradeItPlaceOrderResult:
onSuccess(placeOrderResult)
case let securityQuestion as TradeItSecurityQuestionResult:
onSecurityQuestion(
securityQuestion,
{ securityQuestionAnswer in
self.linkedBrokerAccount?.cryptoTradeService?.answerSecurityQuestionPlaceOrder(securityQuestionAnswer, withCompletionBlock: handler)
},
{
handler(
TradeItErrorResult(
title: "Authentication failed",
message: "The security question was canceled.",
code: .sessionError
)
)
}
)
case let errorResult as TradeItErrorResult:
onFailure(errorResult)
default:
Expand Down
2 changes: 1 addition & 1 deletion TradeItIosTicketSDK2/TradeItLinkedBrokerAccount.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
onSuccess: @escaping () -> Void,
onVerifyUrl: @escaping (
URL,
_ complete1FA: @escaping () -> Void,
_ complete1FA: @escaping () -> Void
) -> Void,
onFailure: @escaping (TradeItErrorResult) -> Void
) {
Expand Down
4 changes: 2 additions & 2 deletions TradeItIosTicketSDK2/TradeItOrder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ public typealias TradeItPreviewOrderResult = TradeItPreviewTradeResult
public typealias TradeItPlaceOrderHandlers = (
_ onSuccess: @escaping (TradeItPlaceOrderResult) -> Void,
_ onVerifyUrl: @escaping (URL,
_ completeTradeChallenge: @escaping () -> Void,
_ completeTradeChallenge: @escaping () -> Void
) -> Void,
_ onFailure: @escaping (TradeItErrorResult) -> Void
) -> Void
Expand Down Expand Up @@ -238,7 +238,7 @@ public typealias TradeItPlaceOrderHandlers = (
onVerifyUrl(
oAuthUrl,
{
tradeService?.complete1FA(completionBlock: handler)
self.tradeService?.complete1FA(completionBlock: handler)
}
)
case let errorResult as TradeItErrorResult:
Expand Down
36 changes: 0 additions & 36 deletions TradeItIosTicketSDK2/TradeItYahooLauncher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,42 +111,6 @@ import SafariServices
}
}

@objc public func handleVerify1FACallback(
onTopmostViewController topMostViewController: UIViewController,
verify1FACallbackUrl: URL
) {
print("=====> handleVerify1FACallback: \(verify1FACallbackUrl.absoluteString)")

var originalViewController: UIViewController?

// Check for the OAuth "popup" screen
if topMostViewController is SFSafariViewController {
originalViewController = topMostViewController.presentingViewController
}

if let tradeItYahooTradePreviewViewController = originalViewController?.childViewControllers.last as? TradeItYahooTradePreviewViewController {
if let originalViewController = originalViewController {
originalViewController.dismiss(
animated: true,
completion: {
tradeItYahooTradePreviewViewController.handleTradeSecurityResponse()
}
)
}
}

if let cancelOrderViewController = originalViewController?.childViewControllers.last as? TradeItOrdersViewController {
if let originalViewController = originalViewController {
originalViewController.dismiss(
animated: true,
completion: {
cancelOrderViewController.handleCancelOrderSecurityResponse()
}
)
}
}
}

@objc public func launchTrading(
fromViewController viewController: UIViewController,
withOrder order: TradeItOrder,
Expand Down
5 changes: 0 additions & 5 deletions TradeItIosTicketSDK2/TradeService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ protocol TradeService {
_ data: TradeItPlaceTradeRequest,
withCompletionBlock completionBlock: @escaping (TradeItResult) -> Void
)

func answerSecurityQuestionPlaceOrder(
_ answer: String,
withCompletionBlock completionBlock: @escaping (TradeItResult) -> Void
)
}

extension TradeService {
Expand Down

0 comments on commit 28fe7e7

Please sign in to comment.