Skip to content

experiment - using spm for demo app#2565

Draft
robertdalmeida wants to merge 6 commits into
developfrom
chore/move-to-using-package-for-demo
Draft

experiment - using spm for demo app#2565
robertdalmeida wants to merge 6 commits into
developfrom
chore/move-to-using-package-for-demo

Conversation

@robertdalmeida

@robertdalmeida robertdalmeida commented May 28, 2026

Copy link
Copy Markdown
Contributor

Just challenging te status quo, why do we need to have the framework targets in Adyen.xcodeproj at all?

Why can't the test app directly use the SPM Package.swift (like an sdk integrator).

Would there any concerns to this approach?

image

Consideratins:

  • We need to re-look at the library evolution test. The purpose of it - as it currently builds dropin framework from the Adyen.xcodeproj. Not sure why.

  • The demo app cannot directly access many things which were package earlier. Which i feel is already a good thing to know. In this PR i've made them public, but they should remain package and we should find another way to have it in the demo app.

  • This MR should not be merged, as it is just an experiment to prove it is possible and check if this setup is developer friendly.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This pull request does not contain a valid label. Please add one of the following labels: ['new', 'changed', 'fixed', 'removed', 'deprecated', 'chore', 'improvement']

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request primarily transitions several APIs and types from package or internal access levels to public across multiple modules (such as Adyen, AdyenActions, AdyenCard, and AdyenSession). It also consolidates and refactors the Swift Package Manager (SPM) and non-SPM bundle resource extensions into unified files using conditional compilation (#if SWIFT_PACKAGE). The review feedback recommends marking helper properties like coreBundle, actions, and cardBundle as private within their respective bundle extensions to prevent polluting the Bundle namespace.

/// This will be available when using swift packages, open the `Package.swift` file and see.
package static let coreInternalResources: Bundle = .module
#else
static let coreBundle: Bundle = .init(for: AdyenContext.self)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The coreBundle property is only used within this extension to resolve coreInternalResources. It should be marked as private to avoid polluting the Bundle namespace package-wide.

Suggested change
static let coreBundle: Bundle = .init(for: AdyenContext.self)
private static let coreBundle: Bundle = .init(for: AdyenContext.self)

/// This will be available when using swift packages, open the `Package.swift` file and see.
static let actionsInternalResources: Bundle = .module
#else
static let actions: Bundle = .init(for: RedirectComponent.self)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The actions property is only used within this extension to resolve actionsInternalResources. It should be marked as private to avoid polluting the Bundle namespace within the AdyenActions module.

Suggested change
static let actions: Bundle = .init(for: RedirectComponent.self)
private static let actions: Bundle = .init(for: RedirectComponent.self)

/// This will be available when using swift packages, open the `Package.swift` file and see.
static let cardInternalResources: Bundle = .module
#else
static let cardBundle: Bundle = .init(for: CardComponent.self)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The cardBundle property was previously private in CardBundleExtension.swift. Since it is only used internally within this extension to resolve cardInternalResources, it should be marked as private to prevent polluting the Bundle namespace within the AdyenCard module.

Suggested change
static let cardBundle: Bundle = .init(for: CardComponent.self)
private static let cardBundle: Bundle = .init(for: CardComponent.self)

@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

ℹ️ No baseline data found for 'develop'.

Framework Size
AdyenAuthentication.framework 347 KB
AdyenWeChatPayInternal.framework 678 KB
TwintSDK.framework 97 KB
Adyen3DS2.framework 919 KB
total 2041 KB

@github-actions

Copy link
Copy Markdown
Contributor

👀 26 public changes detected

Comparing chore/move-to-using-package-for-demo to develop
Platform: iOS

❇️26 Additions

Adyen

❇️ Added

final public class PublicKeyFetcher {
  final public func fetchPublicKey(
    apiClient: any Adyen.APIClientKeyRequestProtocol,
    clientKey: Swift.String
  ) async throws -> Swift.String
  final public func fetchPublicKey(
    apiClient: any Adyen.APIClientKeyRequestProtocol,
    clientKey: Swift.String,
    completion: @escaping (Swift.Result<Swift.String, any Swift.Error>) -> Swift.Void
  ) -> Swift.Void
  public init()
}
public enum APIErrorType: Swift.Decodable, Swift.String {
  case `internal`
  case configuration
  case noInternet
  case security
  case sessionExpired
  case urlError
  case validation
  public init?(rawValue: Swift.String)
  public typealias RawValue = Swift.String
  public var rawValue: Swift.String { get }
}
public enum AdyenAssertion {
  public static func assert(
    message: @autoclosure () -> Swift.String,
    condition: @autoclosure () -> Swift.Bool
  ) -> Swift.Void
  public static func assertionFailure(message: @autoclosure () -> Swift.String) -> Swift.Void
}
public protocol APIClientKeyRequestProtocol {
  func perform(
    request: Adyen.ClientKeyRequest,
    completionHandler: @escaping (Swift.Result<Adyen.ClientKeyResponse, any Swift.Error>) -> Swift.Void
  ) -> Swift.Void
}
public protocol APIRequest: AdyenNetworking.Request where Self.ErrorResponseType == Adyen.APIError
public struct APIError: AdyenNetworking.ErrorResponse, Foundation.LocalizedError {
  public init(from decoder: any Swift.Decoder) throws
  public let errorCode: Swift.String { get }
  public let errorMessage: Swift.String { get }
  public let status: Swift.Int? { get }
  public let type: Adyen.APIErrorType { get }
  public var errorDescription: Swift.String? { get }
}
public struct ClientKeyRequest: Adyen.APIRequest {
  public func encode(to encoder: any Swift.Encoder) throws -> Swift.Void
  public init(clientKey: Swift.String)
  public let clientKey: Swift.String { get }
  public let method: AdyenNetworking.HTTPMethod { get }
  public let queryParameters: [Foundation.URLQueryItem] { get }
  public typealias ErrorResponseType = Adyen.APIError
  public typealias ResponseType = Adyen.ClientKeyResponse
  public var counter: Swift.UInt
  public var headers: [Swift.String : Swift.String]
  public var path: Swift.String { get }
}
public struct ClientKeyResponse: AdyenNetworking.Response {
  public init(from decoder: any Swift.Decoder) throws
  public let cardPublicKey: Swift.String { get }
}

APIClient

❇️ Added

extension AdyenNetworking.APIClient: Adyen.APIClientKeyRequestProtocol {
  final public func perform(
    request: Adyen.ClientKeyRequest,
    completionHandler: @escaping (Swift.Result<Adyen.ClientKeyResponse, any Swift.Error>) -> Swift.Void
  ) -> Swift.Void
}

APIErrorType

❇️ Added

extension Adyen.APIErrorType: Swift.Equatable
extension Adyen.APIErrorType: Swift.Hashable
extension Adyen.APIErrorType: Swift.RawRepresentable

AdyenContext

❇️ Added

convenience public init(
  apiContext: Adyen.APIContext,
  amount: Adyen.Amount?,
  publicKey: Swift.String,
  checkoutAttemptId: Swift.String?,
  analyticsAPIContext: Adyen.APIContext?,
  analyticsConfiguration: Adyen.AnalyticsConfiguration = .init()
)

AsyncAPIClientProtocol

❇️ Added

extension AdyenNetworking.AsyncAPIClientProtocol {
  public func performAsync<R>(_ request: R) async throws -> R.ResponseType where R : AdyenNetworking.Request
}

SessionResponse

❇️ Added

public let id: Swift.String { get }
public let sessionData: Swift.String { get }

UniqueAssetAPIClient

❇️ Added

extension AdyenNetworking.UniqueAssetAPIClient: Adyen.APIClientKeyRequestProtocol where ResponseType == Adyen.ClientKeyResponse {
  final public func perform(
    request: Adyen.ClientKeyRequest,
    completionHandler: @escaping (Swift.Result<Adyen.ClientKeyResponse, any Swift.Error>) -> Swift.Void
  ) -> Swift.Void
}

AdyenActions

AuthenticationConfiguration

❇️ Added

public struct DelegatedAuthentication {
  public init(relyingPartyIdentifier: Swift.String)
}
public var delegatedAuthentication: AdyenActions.AuthenticationConfiguration.DelegatedAuthentication?
public var requestorAppURL: Foundation.URL?

AdyenCheckout

CheckoutConfiguration

❇️ Added

public static func createAnalyticsAPIContext(apiContext: Adyen.APIContext) -> Adyen.APIContext?

AdyenSession

❇️ Added

final public class Session {
  final public var state: AdyenSession.Session.State { get }
  public struct State {
    public let paymentMethods: Adyen.PaymentMethods { get }
  }
}

AdyenUI

❇️ Added

public struct AdyenColors: Swift.Equatable {
  public init(
    background: UIKit.UIColor? = nil,
    container: UIKit.UIColor? = nil,
    containerOutline: UIKit.UIColor? = nil,
    primary: UIKit.UIColor? = nil,
    textOnPrimary: UIKit.UIColor? = nil,
    highlight: UIKit.UIColor? = nil,
    destructive: UIKit.UIColor? = nil,
    success: UIKit.UIColor? = nil,
    textOnDestructive: UIKit.UIColor? = nil,
    disabled: UIKit.UIColor? = nil,
    textOnDisabled: UIKit.UIColor? = nil,
    separator: UIKit.UIColor? = nil,
    text: UIKit.UIColor? = nil,
    textSecondary: UIKit.UIColor? = nil,
    supportShadow: UIKit.UIColor? = nil
  )
  public static func ==(
    a: AdyenUI.AdyenColors,
    b: AdyenUI.AdyenColors
  ) -> Swift.Bool
  public static var `default`: AdyenUI.AdyenColors
}

CheckoutTheme

❇️ Added

public func colors(_ colors: AdyenUI.AdyenColors) -> AdyenUI.CheckoutTheme
public func cornerRadius(_ cornerRadius: CoreFoundation.CGFloat) -> AdyenUI.CheckoutTheme
public init(colors: AdyenUI.AdyenColors = .default)

Analyzed targets: Adyen, AdyenActions, AdyenCard, AdyenCardScanner, AdyenCashAppPay, AdyenCheckout, AdyenComponents, AdyenDelegatedAuthentication, AdyenDropIn, AdyenEncryption, AdyenSession, AdyenSwiftUI, AdyenTwint, AdyenUI, AdyenWeChatPay

@robertdalmeida robertdalmeida changed the title prototyping - using spm for demo app experiment - using spm for demo app May 28, 2026
@atmamont atmamont added the chore a pull request that has chore changes that shouldn't be in the release notes label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore a pull request that has chore changes that shouldn't be in the release notes size:small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants