Skip to content

Commit

Permalink
feat(ad-hoc): update documentation (#358)
Browse files Browse the repository at this point in the history
* Update documentation
* Add missing UI deprecations in ProcessOut and UI modules
  • Loading branch information
andrii-vysotskyi-cko authored Oct 2, 2024
1 parent a721ff6 commit 744f05d
Show file tree
Hide file tree
Showing 47 changed files with 105 additions and 83 deletions.
21 changes: 14 additions & 7 deletions Sources/ProcessOut/ProcessOut.docc/3DS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@ package.

### 3DS Redirect

Method ``PO3DSService/handle(redirect:completion:)`` is a part of 3DS service that is responsible for handling web
based redirects.

We provide an extension of `SFSafariViewController` (defined in `ProcessOutUI` package) that can be used to create an
instance, capable of handling redirects.

For additional details on 3DS UI see dedicated [documentation.](https://swiftpackageindex.com/processout/processout-ios/documentation/processoutui/3ds)
In order to handle redirects your application should support deep links. When application receives incoming URL you
should notify ProcessOut SDK so it has a chance to handle it.

For example if you are using scene delegate it may look like following:

```swift
func scene(_ scene: UIScene, openURLContexts urlContexts: Set<UIOpenURLContext>) {
guard let url = urlContexts.first?.url else {
return
}
let isHandled = ProcessOut.shared.processDeepLink(url: url)
print(isHandled)
}
```
27 changes: 24 additions & 3 deletions Sources/ProcessOut/ProcessOut.docc/ProcessOut.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ProcessOut.configure(configuration: configuration)

- ``ProcessOut/ProcessOut``
- ``ProcessOutConfiguration``
- ``ProcessOutApi``
- ``ProcessOutApiConfiguration``
- <doc:Localizations>
- <doc:MigrationGuides>

Expand All @@ -29,9 +31,14 @@ All errors that could happen as a result of interaction with the SDK are represe
### 3DS

- <doc:3DS>
- ``PO3DSService``
- ``PO3DS2Service``
- ``PO3DS2Configuration``
- ``PO3DS2ConfigurationCardScheme``
- ``PO3DS2AuthenticationRequestParameters``
- ``PO3DS2ChallengeParameters``
- ``PO3DS2ChallengeResult``
- ``PO3DSServiceType``
- ``PO3DSService``
- ``PO3DS2AuthenticationRequest``
- ``PO3DS2Challenge``
- ``PO3DSRedirect``
Expand All @@ -49,12 +56,17 @@ All errors that could happen as a result of interaction with the SDK are represe
- ``PONativeAlternativePaymentMethodEvent``
- ``PONativeAlternativePaymentMethodDelegate``

### Alternative Payment Method
### Alternative Payments

- ``POAlternativePaymentMethodViewControllerBuilder``
- ``POAlternativePaymentsService``
- ``POAlternativePaymentAuthorizationRequest``
- ``POAlternativePaymentTokenizationRequest``
- ``POAlternativePaymentResponse``
- ``POAlternativePaymentMethodsService``
- ``POAlternativePaymentMethodsServiceType``
- ``POAlternativePaymentMethodRequest``
- ``POAlternativePaymentMethodResponse``
- ``POAlternativePaymentMethodViewControllerBuilder``

### Cards

Expand All @@ -70,12 +82,14 @@ All errors that could happen as a result of interaction with the SDK are represe
- ``POCardIssuerInformation``
- ``POCardCvcCheck``
- ``POCardScheme``
- ``POCardsServiceType``

### Customer Tokens

- ``POCustomerTokensService``
- ``POAssignCustomerTokenRequest``
- ``POCustomerToken``
- ``POCustomerTokensServiceType``

### Gateway Configurations

Expand All @@ -84,6 +98,7 @@ All errors that could happen as a result of interaction with the SDK are represe
- ``POAllGatewayConfigurationsRequest``
- ``POFindGatewayConfigurationRequest``
- ``POGatewayConfiguration``
- ``POGatewayConfigurationsRepositoryType``

### Invoices

Expand All @@ -99,6 +114,7 @@ All errors that could happen as a result of interaction with the SDK are represe
- ``PONativeAlternativePaymentMethodTransactionDetailsRequest``
- ``PONativeAlternativePaymentMethodParameterValues``
- ``PONativeAlternativePaymentMethodState``
- ``POInvoicesServiceType``
<!--- ``PODynamicCheckoutPaymentMethod``-->

### Appearance
Expand All @@ -119,6 +135,8 @@ Types that describe properties such as shadow and border. And style of higher le
- ``POActivityIndicatorStyle``
- ``POActivityIndicatorView``
- ``POActionsContainerStyle``
- ``POTextFieldStyle``
- ``POActivityIndicatorViewType``

### Images Utils

Expand All @@ -140,6 +158,9 @@ Types that describe properties such as shadow and border. And style of higher le
- ``POBillingAddressCollectionMode``
- ``PORepository``
- ``POService``
- ``POCancellableType``
- ``PORepositoryType``
- ``POServiceType``
- ``POAutoAsync``
- ``POAutoCompletion``

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
public typealias ProcessOutApiConfiguration = ProcessOutConfiguration

/// Defines configuration parameters that are used to create API singleton. In order to create instance
/// of this structure one should use ``ProcessOutConfiguration/production(projectId:appVersion:isDebug:)``
/// of this structure one should use ``ProcessOutConfiguration/init(projectId:application:isDebug:isTelemetryEnabled:)``
/// method.
public struct ProcessOutConfiguration {

Expand Down
8 changes: 3 additions & 5 deletions Sources/ProcessOut/Sources/Legacy/ProcessOutLegacyApi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public final class ProcessOutLegacyApi {
/// Initiate a payment authorization from a previously generated invoice and card token
///
/// - Parameters:
/// - AuthorizationRequest: contains all the necessary fields to initiate an authorisation request.
/// - request: contains all the necessary fields to initiate an authorisation request.
/// - handler: Custom 3DS2 handler (please refer to our documentation for this)
/// - with: UIViewController to display webviews and perform fingerprinting
public static func makeCardPayment(AuthorizationRequest request: AuthorizationRequest, handler: ThreeDSHandler, with: UIViewController) {
Expand Down Expand Up @@ -443,7 +443,7 @@ public final class ProcessOutLegacyApi {
/// Initiate an incremental payment authorization from a previously generated invoice and card token
///
/// - Parameters:
/// - AuthorizationRequest: contains all the necessary fields to initiate an authorisation request.
/// - request: contains all the necessary fields to initiate an authorisation request.
/// - handler: Custom 3DS2 handler (please refer to our documentation for this)
/// - with: UIViewController to display webviews and perform fingerprinting
public static func makeIncrementalAuthorizationPayment(AuthorizationRequest request: AuthorizationRequest, handler: ThreeDSHandler, with: UIViewController) {
Expand Down Expand Up @@ -502,7 +502,6 @@ public final class ProcessOutLegacyApi {
/// Create a customer token from a card ID
///
/// - Parameters:
/// - cardId: Card ID used for the customer token
/// - customerId: Customer ID created in backend
/// - tokenId: Token ID created in backend
/// - handler: 3DS2 handler
Expand Down Expand Up @@ -560,7 +559,6 @@ public final class ProcessOutLegacyApi {
/// Create a customer token from a card ID
///
/// - Parameters:
/// - cardId: Card ID used for the customer token
/// - customerId: Customer ID created in backend
/// - tokenId: Token ID created in backend
/// - thirdPartySDKVersion: Version of the 3rd party SDK being used for the calls. Can be blank if unused
Expand Down Expand Up @@ -620,7 +618,7 @@ public final class ProcessOutLegacyApi {
/// Create a customer token from a card ID
///
/// - Parameters:
/// - TokenRequest: contains all the fields necessary for the token request
/// - request: contains all the fields necessary for the token request
/// - handler: 3DS2 handler
/// - with: UIViewController to display webviews and perform fingerprinting
public static func makeCardToken(TokenRequest request: TokenRequest, handler: ThreeDSHandler, with: UIViewController) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit

@available(*, deprecated)
final class CollectionViewErrorCell: UICollectionViewCell {

override init(frame: CGRect) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit

@available(*, deprecated)
final class CollectionViewRadioCell: UICollectionViewCell {

override init(frame: CGRect) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit

@available(*, deprecated)
final class CollectionViewSectionHeaderView: UICollectionReusableView {

override init(frame: CGRect) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit

@available(*, deprecated)
final class CollectionViewTitleCell: UICollectionViewCell {

override init(frame: CGRect) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit

@available(*, deprecated)
extension UIActivityIndicatorView: POActivityIndicatorView {

public func setAnimating(_ isAnimating: Bool) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import UIKit
extension UIView {

/// Applies given border style to view's layer.
@available(*, deprecated)
func apply(style: POBorderStyle) {
layer.cornerRadius = style.radius
layer.borderWidth = style.width
layer.borderColor = style.color.cgColor
}

/// Applies given shadow style to view's layer.
@available(*, deprecated)
func apply(style: POShadowStyle, shadowOpacity: CGFloat = 1) {
layer.shadowColor = style.color.cgColor
layer.shadowOpacity = Float(shadowOpacity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import UIKit

/// Defines input's styling information in a specific state.
@available(*, deprecated, message: "Use ProcessOutUI module.")
public struct POInputStateStyle {

/// Text style.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import UIKit
public typealias POTextFieldStyle = POInputStyle

/// Defines input control style in both normal and error states.
@available(*, deprecated, message: "Use ProcessOutUI module.")
public struct POInputStyle {

/// Style for normal state.
Expand All @@ -26,6 +27,7 @@ public struct POInputStyle {
}
}

@available(*, deprecated)
extension POInputStyle {

/// Allows to create default input style with given typography.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import UIKit

/// Style that defines border appearance. Border is always a solid line.
@available(*, deprecated, message: "Use ProcessOutUI module.")
public struct POBorderStyle {

/// Corner radius.
Expand All @@ -26,6 +27,7 @@ public struct POBorderStyle {
}
}

@available(*, deprecated)
extension POBorderStyle {

/// Clear border of specified radius.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import UIKit

/// Style that defines shadow appearance.
@available(*, deprecated, message: "Use ProcessOutUI module.")
public struct POShadowStyle {

/// The color of the shadow.
Expand All @@ -26,6 +27,7 @@ public struct POShadowStyle {
}
}

@available(*, deprecated)
extension POShadowStyle {

/// Value represents no shadow.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit

@available(*, deprecated)
struct AttributedStringBuilder {

enum Text {
Expand Down Expand Up @@ -118,6 +119,7 @@ struct AttributedStringBuilder {
}
}

@available(*, deprecated)
extension AttributedStringBuilder {

func with(updates: (inout AttributedStringBuilder) -> Void) -> AttributedStringBuilder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import Foundation
import UIKit

@available(*, deprecated)
final class AttributedStringMarkdownVisitor: MarkdownVisitor {

init(builder: AttributedStringBuilder, level: Int = 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import UIKit

/// Text style.
@available(*, deprecated, message: "Use ProcessOutUI module.")
public struct POTextStyle {

/// Text foreground color.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import UIKit

/// Holds typesetting information that could be applied to displayed text.
@available(*, deprecated, message: "Use ProcessOutUI module.")
public struct POTypography {

/// Font associated with given typography.
Expand Down Expand Up @@ -48,6 +49,7 @@ public struct POTypography {
}
}

@available(*, deprecated)
extension POTypography {

enum Fixed {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit

@available(*, deprecated)
final class ActionsContainerView: UIView {

init(style: POActionsContainerStyle, horizontalInset: CGFloat) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import UIKit

/// Actions container style.
@available(*, deprecated, message: "Use ProcessOutUI module.")
public struct POActionsContainerStyle {

/// Style for primary button.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit

@available(*, deprecated)
final class ActivityIndicatorViewFactory {

func create(style: POActivityIndicatorStyle) -> POActivityIndicatorView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import UIKit

/// Possible activity indicator styles.
@available(*, deprecated, message: "Use ProcessOutUI module.")
public enum POActivityIndicatorStyle {

/// Custom activity indicator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public typealias POActivityIndicatorViewType = POActivityIndicatorView

/// Protocol that activity indicator should conform to in order to be used with
/// ``POActivityIndicatorStyle`` custom style.
@available(*, deprecated, message: "Use ProcessOutUI module.")
public protocol POActivityIndicatorView: UIView {

/// Changes animation state.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit

@available(*, deprecated)
final class Button: UIControl {

struct ViewModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import UIKit

/// Defines button's styling information in a specific state.
@available(*, deprecated, message: "Use ProcessOutUI module.")
public struct POButtonStateStyle {

/// Text typography.
Expand Down
Loading

0 comments on commit 744f05d

Please sign in to comment.