Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Connect] docs fixes #4384

Merged
merged 10 commits into from
Dec 20, 2024
37 changes: 21 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@

The Stripe iOS SDK makes it quick and easy to build an excellent payment experience in your iOS app. We provide powerful and customizable UI screens and elements that can be used out-of-the-box to collect your users' payment details. We also expose the low-level APIs that power those UIs so that you can build fully custom experiences.

Get started with our [📚 integration guides](https://stripe.com/docs/payments/accept-a-payment?platform=ios) and [example projects](#examples), or [📘 browse the SDK reference](https://stripe.dev/stripe-ios/docs/index.html).
Get started with our [📚 integration guides](https://stripe.com/docs/payments/accept-a-payment?platform=ios) and [example projects](#Examples), or [📘 browse the SDK reference](https://stripe.dev/stripe-ios/docs/index.html).

> Updating to a newer version of the SDK? See our [migration guide](https://github.com/stripe/stripe-ios/blob/master/MIGRATING.md) and [changelog](https://github.com/stripe/stripe-ios/blob/master/CHANGELOG.md).

Table of contents
=================

<!-- NOTE: Use case-sensitive anchor links for docc compatibility -->
<!--ts-->
* [Features](#features)
* [Releases](#releases)
* [Requirements](#requirements)
* [Getting started](#getting-started)
* [Integration](#integration)
* [Examples](#examples)
* [Building from source](#building-from-source)
* [Card scanning](#card-scanning)
* [Contributing](#contributing)
* [Migrating](#migrating-from-older-versions)
* [Code Stye](#code-style)
* [Licenses](#licenses)
* [Features](#Features)
* [Releases](#Releases)
* [Requirements](#Requirements)
* [Getting started](#Getting-started)
* [Integration](#Integration)
* [Examples](#Examples)
* [Building from source](#Building-from-source)
* [Card scanning](#Card-scanning)
* [Contributing](#Contributing)
* [Migrating](#Migrating-from-older-versions)
* [Code Stye](#Code-style)
* [Licenses](#Licenses)

<!--te-->

Expand All @@ -47,7 +47,7 @@ Table of contents

**Stripe API**: [StripePayments](StripePayments/README.md) provides [low-level APIs](https://stripe.dev/stripe-ios/docs/Classes/STPAPIClient.html) that correspond to objects and methods in the Stripe API. You can build your own entirely custom UI on top of this layer, while still taking advantage of utilities like [STPCardValidator](https://stripe.dev/stripe-ios/docs/Classes/STPCardValidator.html) to validate your user’s input.

**Card scanning**: We support card scanning on iOS 13 and higher. See our [Card scanning](#card-scanning) section.
**Card scanning**: We support card scanning on iOS 13 and higher. See our [Card scanning](#Card-scanning) section.

**App Clips**: The `StripeApplePay` module provides a [lightweight SDK for offering Apple Pay in an App Clip](https://stripe.com/docs/apple-pay#app-clips).

Expand All @@ -66,7 +66,12 @@ The Stripe iOS SDK collects data to help us improve our products and prevent fra
For help with Apple's App Privacy Details form in App Store Connect, visit [Stripe iOS SDK Privacy Details](https://support.stripe.com/questions/stripe-ios-sdk-privacy-details).

## Modules
<!-- Pad `Size` col with &nbsp; to prevent table from shrinking badge images and maintain readability -->
<!--
EmergeTools project must be made public before adding to this table:
https://www.emergetools.com/settings?tab=app-display-options&cards=public_org_apps

NOTE: Pad `Size` col with &nbsp; to prevent table from shrinking badge images and maintain readability
-->
| Module | Description | Size&nbsp;([Download&nbsp;→&nbsp;Install](https://docs.emergetools.com/docs/ios-app-size#download-vs-install-size))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
|--------|-------------|------|
| [StripePaymentSheet](StripePaymentSheet) | Stripe's [prebuilt payment UI](https://stripe.com/docs/payments/accept-a-payment?platform=ios&ui=payment-sheet). | [![StripePaymentSheet size](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fwww.emergetools.com%2Fapi%2Fv2%2Fpublic_new_build%3FexampleId%3Dcom.stripe.StripePaymentSheetSize%26platform%3Dios%26badgeOption%3Ddownload_and_install_size%26buildType%3Drelease&query=$.badgeMetadata&label=StripePaymentSheet&logo=apple)](https://www.emergetools.com/app/example/ios/com.stripe.StripePaymentSheetSize/release?utm_campaign=badge-data) |
Expand Down
16 changes: 8 additions & 8 deletions StripeApplePay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
StripeApplePay is a lightweight Apple Pay SDK intended for building App Clips or other size-constrained apps.

## Table of contents

<!-- NOTE: Use case-sensitive anchor links for docc compatibility -->
<!--ts-->
- [Stripe Apple Pay iOS SDK](#stripe-apple-pay-ios-sdk)
- [Table of contents](#table-of-contents)
- [Requirements](#requirements)
- [Getting started](#getting-started)
- [Integration](#integration)
- [Example](#example)
- [Manual linking](#manual-linking)
- [Stripe Apple Pay iOS SDK](#Stripe-Apple-Pay-iOS-SDK)
- [Table of contents](#Table-of-contents)
- [Requirements](#Requirements)
- [Getting started](#Getting-started)
- [Integration](#Integration)
- [Example](#Example)
- [Manual linking](#Manual-linking)

<!--te-->

Expand Down
14 changes: 7 additions & 7 deletions StripeConnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ Use Connect embedded components to add connected account dashboard functionality
> Access to the StripeConnect iOS SDK is currently invite only and is limited to only certain connected account types. To request an invitation and get the latest information on supported account types, see our [iOS integration guide](https://docs.stripe.com/connect/get-started-connect-embedded-components?platform=ios).

## Table of contents

<!-- NOTE: Use case-sensitive anchor links for docc compatibility -->
<!--ts-->
* [Supported components](#supported-components)
* [Requirements](#requirements)
* [Getting started](#getting-started)
* [Integration](#integration)
* [Example](#example)
* [Manual linking](#manual-linking)
* [Supported components](#Supported-components)
* [Requirements](#Requirements)
* [Getting started](#Getting-started)
* [Integration](#Integration)
* [Example](Example)
* [Manual linking](#Manual-linking)

<!--te-->

Expand Down
4 changes: 4 additions & 0 deletions StripeConnect/StripeConnect.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
E65691222CA52D5900E0DB00 /* StripeConnect+Exports.swift in Sources */ = {isa = PBXBuildFile; fileRef = E65691212CA52D5900E0DB00 /* StripeConnect+Exports.swift */; };
E65691252CA52F9D00E0DB00 /* NotificationBannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E65691232CA52F8600E0DB00 /* NotificationBannerViewController.swift */; };
E65691272CA533CD00E0DB00 /* OnNotificationsChangeHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = E65691262CA533CD00E0DB00 /* OnNotificationsChangeHandler.swift */; };
E65A28822D14009000B606F4 /* Docs.docc in Sources */ = {isa = PBXBuildFile; fileRef = E65A28812D14009000B606F4 /* Docs.docc */; };
E6660CF92CC2F343002A7631 /* OpenFinancialConnectionsMessageHandlerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6660CF82CC2F340002A7631 /* OpenFinancialConnectionsMessageHandlerTests.swift */; };
E6660CFB2CC2F438002A7631 /* SetCollectMobileFinancialConnectionsResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6660CFA2CC2F436002A7631 /* SetCollectMobileFinancialConnectionsResultTests.swift */; };
E6660CFD2CC2F9A7002A7631 /* FinancialConnectionsPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6660CFC2CC2F99C002A7631 /* FinancialConnectionsPresenter.swift */; };
Expand Down Expand Up @@ -249,6 +250,7 @@
E65691212CA52D5900E0DB00 /* StripeConnect+Exports.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "StripeConnect+Exports.swift"; sourceTree = "<group>"; };
E65691232CA52F8600E0DB00 /* NotificationBannerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationBannerViewController.swift; sourceTree = "<group>"; };
E65691262CA533CD00E0DB00 /* OnNotificationsChangeHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnNotificationsChangeHandler.swift; sourceTree = "<group>"; };
E65A28812D14009000B606F4 /* Docs.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = Docs.docc; sourceTree = "<group>"; };
E6660CF82CC2F340002A7631 /* OpenFinancialConnectionsMessageHandlerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenFinancialConnectionsMessageHandlerTests.swift; sourceTree = "<group>"; };
E6660CFA2CC2F436002A7631 /* SetCollectMobileFinancialConnectionsResultTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetCollectMobileFinancialConnectionsResultTests.swift; sourceTree = "<group>"; };
E6660CFC2CC2F99C002A7631 /* FinancialConnectionsPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinancialConnectionsPresenter.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -613,6 +615,7 @@
41D17A422C5A73A6007C6EE6 /* StripeConnect */ = {
isa = PBXGroup;
children = (
E65A28812D14009000B606F4 /* Docs.docc */,
41A2A5602C5A97130077FC74 /* Source */,
41D17A432C5A73A6007C6EE6 /* StripeConnect.h */,
);
Expand Down Expand Up @@ -875,6 +878,7 @@
413987E12C641688001D375E /* PageDidLoadMessageHandler.swift in Sources */,
4171B1592C9A5EEC00547F7D /* AccountOnboardingViewController.swift in Sources */,
41054E432C989AAD00383C09 /* Font+Extension.swift in Sources */,
E65A28822D14009000B606F4 /* Docs.docc in Sources */,
E6EF91C72CBA3BED0082DD1B /* UIViewController+StripeConnect.swift in Sources */,
E6660DC92CE43BE6002A7631 /* UnexpectedNavigationEvent.swift in Sources */,
41542A692C88B6F2004E728E /* JSONEncoder+extension.swift in Sources */,
Expand Down
3 changes: 3 additions & 0 deletions StripeConnect/StripeConnect/Docs.docc/StripeConnect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ``StripeConnect``

Placeholder
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
import UIKit

/// A view controller representing an account-onboarding component
/// - Seealso: https://docs.stripe.com/connect/supported-embedded-components/account-onboarding
/// - Important: Include `@_spi(PrivateBetaConnect)` on import to gain access to this API.
/// - Seealso: [Account onboarding component documentation](https://docs.stripe.com/connect/supported-embedded-components/account-onboarding?platform=ios)
@_spi(PrivateBetaConnect)
@_documentation(visibility: public)
@available(iOS 15, *)
public class AccountOnboardingViewController: UIViewController {

Expand All @@ -32,6 +34,7 @@ public class AccountOnboardingViewController: UIViewController {
}

/// Delegate that receives callbacks for this component
@_documentation(visibility: public)
public weak var delegate: AccountOnboardingViewControllerDelegate?

private(set) var webVC: ConnectComponentWebViewController!
Expand Down Expand Up @@ -68,13 +71,16 @@ public class AccountOnboardingViewController: UIViewController {
}

/// Delegate of an `AccountOnboardingViewController`
/// - Important: Include `@_spi(PrivateBetaConnect)` on import to gain access to this API.
@_spi(PrivateBetaConnect)
@_documentation(visibility: public)
@available(iOS 15, *)
public protocol AccountOnboardingViewControllerDelegate: AnyObject {
/**
The connected account has exited the onboarding process
- Parameters accountOnboarding: The account onboarding component that the account exited
*/
@_documentation(visibility: public)
func accountOnboardingDidExit(_ accountOnboarding: AccountOnboardingViewController)

/**
Expand All @@ -83,15 +89,21 @@ public protocol AccountOnboardingViewControllerDelegate: AnyObject {
- accountOnboarding: The account onboarding component that errored when loading
- error: The error that occurred when loading the component
*/
@_documentation(visibility: public)
func accountOnboarding(_ accountOnboarding: AccountOnboardingViewController,
didFailLoadWithError error: Error)

}

@available(iOS 15, *)
@_documentation(visibility: public)
public extension AccountOnboardingViewControllerDelegate {
// Add default implementation of delegate methods to make them optional

@_documentation(visibility: public)
func accountOnboardingDidExit(_ accountOnboarding: AccountOnboardingViewController) { }

@_documentation(visibility: public)
func accountOnboarding(_ accountOnboarding: AccountOnboardingViewController,
didFailLoadWithError error: Error) { }
Comment on lines +99 to 108
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were all needed so docc would mark them as "Default implementation provided"

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ import UIKit

/**
The balance summary, the payout schedule, and a list of payouts for the connected account. It can also allow the user to perform instant or manual payouts.
- Important: Include `@_spi(PrivateBetaConnect)` on import to gain access to this API.
- Seealso: [Payouts component documentation](https://docs.stripe.com/connect/supported-embedded-components/payouts?platform=ios)
*/
@_spi(PrivateBetaConnect)
@_documentation(visibility: public)
@available(iOS 15, *)
public class PayoutsViewController: UIViewController {
private(set) var webVC: ConnectComponentWebViewController!

@_documentation(visibility: public)
public weak var delegate: PayoutsViewControllerDelegate?

init(componentManager: EmbeddedComponentManager,
Expand All @@ -40,7 +44,9 @@ public class PayoutsViewController: UIViewController {
}

/// Delegate of an `PayoutsViewController`
/// - Important: Include `@_spi(PrivateBetaConnect)` on import to gain access to this API.
@_spi(PrivateBetaConnect)
@_documentation(visibility: public)
@available(iOS 15, *)
public protocol PayoutsViewControllerDelegate: AnyObject {

Expand All @@ -50,14 +56,17 @@ public protocol PayoutsViewControllerDelegate: AnyObject {
- payouts: The payouts component that errored when loading
- error: The error that occurred when loading the component
*/
@_documentation(visibility: public)
func payouts(_ payouts: PayoutsViewController,
didFailLoadWithError error: Error)

}

@available(iOS 15, *)
@_documentation(visibility: public)
public extension PayoutsViewControllerDelegate {
// Default implementation to make optional
@_documentation(visibility: public)
func payouts(_ payouts: PayoutsViewController,
didFailLoadWithError error: Error) { }
}
18 changes: 11 additions & 7 deletions StripeConnect/StripeConnect/Source/CustomFontSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
import UIKit

@_spi(PrivateBetaConnect)
@_documentation(visibility: public)
@available(iOS 15, *)
extension EmbeddedComponentManager {

/// Use a `CustomFontSource` pass custom fonts embedded in your app's binary when initializing a
/// `EmbeddedComponentManager`.
/// - Seealso: https://docs.stripe.com/connect/get-started-connect-embedded-components#customize-the-look-of-connect-embedded-components
/// - Seealso: https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app
/**
Use a `CustomFontSource` pass custom fonts embedded in your app's binary when initializing a
`EmbeddedComponentManager`.
- Seealso: [Customizing the look of connect embedded components](https://docs.stripe.com/connect/get-started-connect-embedded-components?platform=ios#customize-the-look-of-connect-embedded-components) and [Adding custom fonts to your app]( https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app)
*/
@_documentation(visibility: public)
public struct CustomFontSource {
let family: String
let style: String?
Expand All @@ -24,14 +27,15 @@ extension EmbeddedComponentManager {
/**
Initializes a CustomFontSource from a base font and its original file URL
- Parameters:
- font: A custom font embedded into your app's binary
- fileUrl: The local file URL corresponding to the custom font
- font: A custom font embedded into your app's binary
- fileUrl: The local file URL corresponding to the custom font

- Note: The font's size does not impact the appearance of the component.
To adjust the font sizes used in components, use `EmbeddedComponentManager.Appearance`

- Throws: Error if the font couldn't be loaded from the given URL
*/
@_documentation(visibility: public)
public init(font: UIFont, fileUrl: URL) throws {
guard fileUrl.isFileURL else {
throw FontLoadError.notFileURL
Expand Down
Loading
Loading