Skip to content

Commit

Permalink
Merge pull request #6 from jo030225/master
Browse files Browse the repository at this point in the history
경고 메시지 안 나게 코드 수정
  • Loading branch information
JosephNK authored Dec 22, 2021
2 parents b746775 + 7fd0cf5 commit 50443db
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions SwiftyIamport/Source/IAMPortPay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ public class IAMPortPay {
// MARK: - Application Helper
public extension IAMPortPay {
// for iOS below 9.0
public func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
return self.applicationOpenUrl(url: url)
}

public func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
return self.applicationOpenUrl(url: url)
}

Expand All @@ -211,16 +211,16 @@ public extension IAMPortPay {
// MARK: - WebView Delegate Helper
public extension IAMPortPay {
@available(*, deprecated, message: "Use: requestRedirectUrl method")
public func webViewRedirectUrl(shouldStartLoadWith request: URLRequest, parser: @escaping (_ data: Data?, _ response: URLResponse?, _ error: Error?) -> Any?, completion: @escaping (_ pasingData: Any?) -> Void) {
func webViewRedirectUrl(shouldStartLoadWith request: URLRequest, parser: @escaping (_ data: Data?, _ response: URLResponse?, _ error: Error?) -> Any?, completion: @escaping (_ pasingData: Any?) -> Void) {
self.requestRedirectUrl(for: request, parser: parser, completion: completion)
}

@available(*, deprecated, message: "Use: requestAction method")
public func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebView.NavigationType) -> Bool {
func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebView.NavigationType) -> Bool {
return self.requestAction(for: request)
}

public func requestRedirectUrl(for request: URLRequest, parser: @escaping (_ data: Data?, _ response: URLResponse?, _ error: Error?) -> Any?, completion: @escaping (_ pasingData: Any?) -> Void) {
func requestRedirectUrl(for request: URLRequest, parser: @escaping (_ data: Data?, _ response: URLResponse?, _ error: Error?) -> Any?, completion: @escaping (_ pasingData: Any?) -> Void) {
let urlString = request.url?.absoluteString ?? ""
if let redirect_url = self.m_redirect_url {
if urlString.hasPrefix(redirect_url) {
Expand All @@ -235,7 +235,7 @@ public extension IAMPortPay {
}
}

public func requestAction(for request: URLRequest) -> Bool {
func requestAction(for request: URLRequest) -> Bool {
guard let url = request.url else {
return false
}
Expand Down Expand Up @@ -274,7 +274,7 @@ public extension IAMPortPay {
return self.webViewRequestWithForNicePay(request: request)
}

public func requestIAMPortPayWebViewDidFinishLoad(_ webView: UIWebView, completion: @escaping (_ error: IAMPortPayError?) -> Void) {
func requestIAMPortPayWebViewDidFinishLoad(_ webView: UIWebView, completion: @escaping (_ error: IAMPortPayError?) -> Void) {
if webView.stringByEvaluatingJavaScript(from: "document.readyState") == "complete" {
let url = webView.request?.url

Expand Down Expand Up @@ -306,7 +306,7 @@ public extension IAMPortPay {
}
}

public func requestIAMPortPayWKWebViewDidFinishLoad(_ wkWebView: WKWebView, completion: @escaping (_ error: IAMPortPayError?) -> Void) {
func requestIAMPortPayWKWebViewDidFinishLoad(_ wkWebView: WKWebView, completion: @escaping (_ error: IAMPortPayError?) -> Void) {
wkWebView.evaluateJavaScript("document.readyState == \"complete\"") { (any, error) in
let url = wkWebView.url

Expand Down Expand Up @@ -347,15 +347,15 @@ public extension IAMPortPay {
}
}

public func setCancelListenerForNicePay(_ handler: (() -> Void)?) {
func setCancelListenerForNicePay(_ handler: (() -> Void)?) {
self.addCancelHandler = handler
}

}

fileprivate extension IAMPortPay {

fileprivate func makeParameters(for url: URL?) -> (param: IAMPortParameters?, error: IAMPortPayError?) {
func makeParameters(for url: URL?) -> (param: IAMPortParameters?, error: IAMPortPayError?) {
if let currentURL = url?.absoluteString {
#if DEBUG
print("### WebView currentURL: \(currentURL)")
Expand Down Expand Up @@ -412,7 +412,7 @@ fileprivate extension IAMPortPay {
return (nil, IAMPortPayError.parametersNone)
}

fileprivate func isNotSupportValidation(_ pgType: IAMPortPGType?, _ parameters: IAMPortParameters) -> Bool {
func isNotSupportValidation(_ pgType: IAMPortPGType?, _ parameters: IAMPortParameters) -> Bool {
if let pg = pgType, let pm = parameters["pay_method"] as? IAMPortPayMethod {
var isNotSupport = false
switch pg {
Expand Down Expand Up @@ -471,7 +471,7 @@ fileprivate extension IAMPortPay {
return false
}

fileprivate func applicationOpenUrlForNicePay(url: URL) -> Bool {
func applicationOpenUrlForNicePay(url: URL) -> Bool {
var redirectURL = url.absoluteString

#if DEBUG
Expand Down Expand Up @@ -530,7 +530,7 @@ fileprivate extension IAMPortPay {
return true
}

fileprivate func webViewRequestWithForNicePay(request: URLRequest) -> Bool {
func webViewRequestWithForNicePay(request: URLRequest) -> Bool {
let url = request.url
let urlString = url?.absoluteString ?? ""

Expand Down Expand Up @@ -574,7 +574,7 @@ fileprivate extension IAMPortPay {
return true
}

fileprivate func requestBankPayResultForNicePay(_ webView: UIWebView?, urlString: String?, bodyString: String?) {
func requestBankPayResultForNicePay(_ webView: UIWebView?, urlString: String?, bodyString: String?) {
guard let webView = webView, let urlString = urlString, let bodyString = bodyString else {
return
}
Expand All @@ -591,7 +591,7 @@ fileprivate extension IAMPortPay {
}
}

fileprivate func requestISPPayResultForNicePay(_ webView: UIWebView?, urlString: String?) {
func requestISPPayResultForNicePay(_ webView: UIWebView?, urlString: String?) {
guard let webView = webView, let urlString = urlString else {
return
}
Expand Down

0 comments on commit 50443db

Please sign in to comment.