From 7b19f4970d51b6d7fe45273ad97f4ed0bb19fe8a Mon Sep 17 00:00:00 2001 From: Andrei Solovev Date: Wed, 13 Mar 2024 18:10:06 +0700 Subject: [PATCH] Rename authorizedURL to authorizeURL --- ExampleApp/Views/ProductDetailViewController.swift | 4 ++-- OmiseSDK/Sources/OmiseSDK.swift | 6 +++--- .../AuthorizingPaymentViewController.swift | 10 +++++----- README.md | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ExampleApp/Views/ProductDetailViewController.swift b/ExampleApp/Views/ProductDetailViewController.swift index 91543dcc..d308ae72 100644 --- a/ExampleApp/Views/ProductDetailViewController.swift +++ b/ExampleApp/Views/ProductDetailViewController.swift @@ -46,7 +46,7 @@ class ProductDetailViewController: BaseViewController { @IBAction private func handlingAuthorizingPayment(_ sender: UIBarButtonItem) { let alertController = UIAlertController(title: "Authorizing Payment", - message: "Please input your given authorized URL", + message: "Please input your given authorize URL", preferredStyle: .alert) alertController.addTextField(configurationHandler: nil) alertController.addAction(UIAlertAction(title: "Cancel", style: UIAlertAction.Style.cancel, handler: nil)) @@ -59,7 +59,7 @@ class ProductDetailViewController: BaseViewController { self.omiseSDK.presentAuthorizedController( from: self, - authorizedURL: url, + authorizeURL: url, expectedReturnURLPatterns: [expectedReturnURL], delegate: self ) diff --git a/OmiseSDK/Sources/OmiseSDK.swift b/OmiseSDK/Sources/OmiseSDK.swift index 57163247..772ee8bc 100644 --- a/OmiseSDK/Sources/OmiseSDK.swift +++ b/OmiseSDK/Sources/OmiseSDK.swift @@ -157,21 +157,21 @@ public class OmiseSDK { /// - Parameters: /// - from: ViewController is used to present Choose Payment Methods /// - animated: Presents controller with animation if `true` - /// - authorizedURL: The authorized URL given in `Charge` object + /// - authorizeURL: The authorize URL given in `Charge` object /// - expectedReturnURLPatterns: The expected return URL patterns. /// - delegate: A delegate object that will recieved authorizing payment events. @available(iOSApplicationExtension, unavailable) public func presentAuthorizedController( from topViewController: UIViewController, animated: Bool = true, - authorizedURL: URL, + authorizeURL: URL, expectedReturnURLPatterns: [URLComponents], delegate: AuthorizingPaymentViewControllerDelegate ) { dismiss(animated: false) let viewController = AuthorizingPaymentViewController(nibName: nil, bundle: .omiseSDK) - viewController.authorizedURL = authorizedURL + viewController.authorizeURL = authorizeURL viewController.expectedReturnURLPatterns = expectedReturnURLPatterns viewController.delegate = delegate viewController.applyNavigationBarStyle() diff --git a/OmiseSDK/Sources/Views/Screens/Authorizing Payment/AuthorizingPaymentViewController.swift b/OmiseSDK/Sources/Views/Screens/Authorizing Payment/AuthorizingPaymentViewController.swift index 7e43bf4f..831e0bad 100644 --- a/OmiseSDK/Sources/Views/Screens/Authorizing Payment/AuthorizingPaymentViewController.swift +++ b/OmiseSDK/Sources/Views/Screens/Authorizing Payment/AuthorizingPaymentViewController.swift @@ -22,8 +22,8 @@ public protocol AuthorizingPaymentViewControllerDelegate: AnyObject { */ @available(iOSApplicationExtension, unavailable) public class AuthorizingPaymentViewController: UIViewController { - /// Authorized URL given from Omise in the created `Charge` object. - var authorizedURL: URL? { + /// Authorize URL given from Omise in the created `Charge` object. + var authorizeURL: URL? { didSet { guard isViewLoaded else { return @@ -82,14 +82,14 @@ public class AuthorizingPaymentViewController: UIViewController { } private func startAuthorizingPaymentProcess() { - guard let authorizedURL = authorizedURL, !expectedReturnURLPatterns.isEmpty else { + guard let authorizeURL = authorizeURL, !expectedReturnURLPatterns.isEmpty else { assertionFailure("Insufficient authorizing payment information") os_log("Refusing to initialize sdk client with a non-public key: %{private}@", log: uiLogObject, type: .error) return } - os_log("Starting the authorizing process with %{private}@ URL", log: uiLogObject, type: .info, authorizedURL.absoluteString) - let request = URLRequest(url: authorizedURL, cachePolicy: .reloadIgnoringLocalAndRemoteCacheData, timeoutInterval: 60.0) + os_log("Starting the authorizing process with %{private}@ URL", log: uiLogObject, type: .info, authorizeURL.absoluteString) + let request = URLRequest(url: authorizeURL, cachePolicy: .reloadIgnoringLocalAndRemoteCacheData, timeoutInterval: 60.0) webView.load(request) } diff --git a/README.md b/README.md index e278e9f5..72888829 100644 --- a/README.md +++ b/README.md @@ -331,19 +331,19 @@ extension ProductDetailViewController: ChoosePaymentMethodDelegate { ### Authorizing payment -Some payment methods require customers to authorize the payment uaing an authorized URL. This includes [3-D Secure verification](https://docs.opn.ooo/fraud-protection#3-d-secure), [Internet Banking payment](https://docs.opn.ooo/internet-banking), and [Alipay](https://docs.opn.ooo/alipay). The Opn Payments iOS SDK provides a built-in class to authorize payments. +Some payment methods require customers to authorize the payment using an authorize URL. This includes [3-D Secure verification](https://docs.opn.ooo/fraud-protection#3-d-secure), [Internet Banking payment](https://docs.opn.ooo/internet-banking), and [Alipay](https://docs.opn.ooo/alipay). The Opn Payments iOS SDK provides a built-in class to authorize payments. On payment methods that require opening the external application (e.g., mobile banking application) to authorize the transaction, set the *return_uri* to a **deep link** or **app link** to be able to open the merchant application. Otherwise, after the cardholder authorizes the transaction on the external application, the flow redirects to the normal link in the *return_uri*, and opens it on the browser application, resulting in the payment not being completed. #### Using built-in authorizing payment view controller -You can use the built-in authorizing payment view controller with the `authorized URL` provided with the charge and expected `return URL` patterns you create. +You can use the built-in authorizing payment view controller with the `authorizeURL` provided with the charge and expected `return URL` patterns you create. ```swift omiseSDK.presentAuthorizedController( from: self, - authorizedURL: url, + authorizeURL: url, expectedReturnURLPatterns: [expectedReturnURL], delegate: self )