Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## X.Y.Z - changes pending release

### CryptoOnramp (Beta)
* [Removed] Removed `CryptoOnrampCoordinator.authenticateUser()` in favor of `CryptoOnrampCoordinator.authorize()`.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note that this is in the "pending release" section. LMK if I should move it to today's release, but note that there's no rush for me to merge this before the release is made.

Copy link
Collaborator

Choose a reason for hiding this comment

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

LGTM! I think it's too late for today's release

### PaymentSheet
* [Fixed] Fixed build for visionOS 26.2 SDK.

Expand Down
1 change: 0 additions & 1 deletion StripeCryptoOnramp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ StripeCryptoOnramp helps you build a headless crypto onramp flow in your iOS app
**Link authentication**:
- Check if an email has a Link account with `hasLinkAccount(with:)`
- Register new users with `registerLinkUser(email:fullName:phone:country:)`
- Authenticate existing users with `authenticateUser(from:)`
- Authorize a Link auth intent with `authorize(linkAuthIntentId:from:)`
- Support seamless sign-in for returning users with `authenticateUserWithToken(_:)`

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public extension CryptoOnrampCoordinator {
case .invalidSelectedPaymentSource:
return "An unexpected error occurred internally. Selected payment source was not set to an expected value."
case .missingCryptoCustomerID:
return "A crypto customer ID is missing but required. A crypto customer ID must either be provided to the Crypto Onramp Coordinator in the `create` API, or generated during the onramp flow by verifying a Link account using the `registerLinkUser`, `authenticateUser`, or `authorize` APIs."
return "A crypto customer ID is missing but required. A crypto customer ID must either be provided to the Crypto Onramp Coordinator in the `create` API, or generated during the onramp flow by verifying a Link account using the `registerLinkUser`, `authenticateUserWithToken`, or `authorize` APIs."
case .linkAccountNotVerified:
return "No active Link consumer is available in a verified state."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,6 @@ protocol CryptoOnrampCoordinatorProtocol {
/// Throws if the auth token is expired, has already been used, has been revoked, or an API error occurs.
func authenticateUserWithToken(_ linkAuthTokenClientSecret: String) async throws

/// Presents Link UI to authenticate an existing Link user.
/// `hasLinkAccount` must be called before this.
///
/// - Parameter viewController: The view controller from which to present the authentication flow.
/// - Returns: An `AuthenticationResult` indicating whether authentication was completed or canceled.
/// If authentication completes, a crypto customer ID will be included in the result.
/// Throws if `hasLinkAccount` was not called prior to this, or an API error occurs after the view controller is presented.
func authenticateUser(from viewController: UIViewController) async throws -> AuthenticationResult

/// Authorizes a Link auth intent and authenticates the user if necessary.
/// - Parameters:
/// - linkAuthIntentId: The Link auth intent ID to authorize.
Expand Down Expand Up @@ -332,30 +323,6 @@ public final class CryptoOnrampCoordinator: NSObject, CryptoOnrampCoordinatorPro
}
}

public func authenticateUser(from viewController: UIViewController) async throws -> AuthenticationResult {
analyticsClient.log(.linkUserAuthenticationStarted)
do {
let verificationResult = try await linkController.presentForVerification(from: viewController)
switch verificationResult {
case .canceled:
return .canceled
case .completed:
do {
let customerId = try await apiClient.createCryptoCustomer(with: linkAccountInfo).id
await cryptoCustomerState.setCustomerId(customerId)
analyticsClient.log(.linkUserAuthenticationCompleted)
return .completed(customerId: customerId)
} catch {
analyticsClient.log(.errorOccurred(during: .authenticateUser, errorMessage: error.localizedDescription))
throw error
}
}
} catch {
analyticsClient.log(.errorOccurred(during: .authenticateUser, errorMessage: error.localizedDescription))
throw error
}
}

public func authorize(linkAuthIntentId: String, from viewController: UIViewController) async throws -> AuthorizationResult {
analyticsClient.log(.linkAuthorizationStarted)
do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ enum CryptoOnrampOperation: String {
case hasLinkAccount = "has_link_account"
case registerLinkUser = "register_link_user"
case updatePhoneNumber = "update_phone_number"
case authenticateUser = "authenticate_user"
case authenticateUserWithAuthToken = "authenticate_user_with_auth_token"
case authorize = "authorize"
case attachKycInfo = "attach_kyc_info"
Expand All @@ -30,8 +29,6 @@ enum CryptoOnrampAnalyticsEvent {
case linkAccountLookupCompleted(hasLinkAccount: Bool)
case linkRegistrationCompleted
case linkPhoneNumberUpdated
case linkUserAuthenticationStarted
case linkUserAuthenticationCompleted
case linkUserAuthenticationWithTokenCompleted
case linkAuthorizationStarted
case linkAuthorizationCompleted(consented: Bool)
Expand Down Expand Up @@ -59,10 +56,6 @@ enum CryptoOnrampAnalyticsEvent {
return "onramp.link_registration_completed"
case .linkPhoneNumberUpdated:
return "onramp.link_phone_number_updated"
case .linkUserAuthenticationStarted:
return "onramp.link_user_authentication_started"
case .linkUserAuthenticationCompleted:
return "onramp.link_user_authentication_completed"
case .linkUserAuthenticationWithTokenCompleted:
return "onramp.link_user_authentication_with_token_completed"
case .linkAuthorizationStarted:
Expand Down Expand Up @@ -103,8 +96,6 @@ enum CryptoOnrampAnalyticsEvent {
case .sessionCreated,
.linkRegistrationCompleted,
.linkPhoneNumberUpdated,
.linkUserAuthenticationStarted,
.linkUserAuthenticationCompleted,
.linkUserAuthenticationWithTokenCompleted,
.linkAuthorizationStarted,
.identityVerificationStarted,
Expand Down
Loading