[v5] UPI Smart Intent - UPI Apps detection#2483
[v5] UPI Smart Intent - UPI Apps detection#2483nauaros merged 25 commits intofeature/COSDK-1089_UPI_Smart_Intentfrom
Conversation
/// Default implementation using UIApplication.
@_spi(AdyenInternal)
public struct DefaultURLSchemeChecker: URLSchemeChecking {
public init() {}
public func canOpen(scheme: String) -> Bool {
guard let url = URL(string: scheme + "://") else {
return false
}
return UIApplication.shared.canOpenURL(url)
}
}
|
ℹ️ No baseline data found for 'feature/COSDK-1089_UPI_Smart_Intent'.
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for detecting installed UPI apps on the device to improve the user experience in the UPI component. Key changes include the introduction of a URL scheme checking protocol, a new UPI app model, and updates to the UPI component to filter and display available apps based on their installation status. I have identified several areas for improvement: the breaking change to the public API in UPIPaymentMethod, the presence of commented-out code in CodingKeys, the need for proper localization of UI strings, a potential layout issue with FormSpacerItem, and an incorrect method call for dismissing the keyboard.
|
| ❇️ | 3 Additions |
| 🔀 | 2 Modifications |
| ❌ | 1 Removal |
Adyen
Issuer
❇️ Added
public let appIdentifier: Adyen.Issuer.AppIdentifier? { get }public struct AppIdentifier: Swift.Codable, Swift.Equatable {
public enum CodingKeys: Swift.CodingKey, Swift.Equatable, Swift.Hashable, Swift.RawRepresentable, Swift.String {
case scheme
public init?(intValue: Swift.Int)
public init?(rawValue: Swift.String)
public init?(stringValue: Swift.String)
public typealias RawValue = Swift.String
public var intValue: Swift.Int? { get }
public var rawValue: Swift.String { get }
public var stringValue: Swift.String { get }
}
public func encode(to encoder: any Swift.Encoder) throws -> Swift.Void
public init(from decoder: any Swift.Decoder) throws
public let scheme: Swift.String { get }
public static func ==(
a: Adyen.Issuer.AppIdentifier,
b: Adyen.Issuer.AppIdentifier
) -> Swift.Bool
}AdyenComponents
❇️ Added
public enum UPIFlowType: Swift.Equatable, Swift.Hashable, Swift.Int, Swift.RawRepresentable {
@available(*, deprecated, renamed: "upiCollect", message: "The `.qrCode` is deprecated and not available any more. Use, `.upiIntent` instead.")
case qrCode
@available(*, deprecated, renamed: "upiIntent", message: "Use `.upiIntent` instead.")
case upiApps
case upiCollect
case upiIntent
public init?(rawValue: Swift.Int)
public typealias RawValue = Swift.Int
public var rawValue: Swift.Int { get }
}UPIComponent
🔀 Modified
// From
@Adyen.AdyenObservable
@_projectedValueProperty($selectedUPIFlow)
final public var selectedUPIFlow: AdyenComponents.UPIComponent.UPIFlowType { get }
// To
@Adyen.AdyenObservable
@_projectedValueProperty($selectedUPIFlow)
final public var selectedUPIFlow: AdyenComponents.UPIFlowType { get }
/**
Changes:
- Modified type from `AdyenComponents.UPIComponent.UPIFlowType` to `AdyenComponents.UPIFlowType`
*/// From
final public var $selectedUPIFlow: Adyen.AdyenObservable<AdyenComponents.UPIComponent.UPIFlowType> { get }
// To
final public var $selectedUPIFlow: Adyen.AdyenObservable<AdyenComponents.UPIFlowType> { get }
/**
Changes:
- Modified type from `Adyen.AdyenObservable<AdyenComponents.UPIComponent.UPIFlowType>` to `Adyen.AdyenObservable<AdyenComponents.UPIFlowType>`
*/❌ Removed
public enum UPIFlowType: Swift.Equatable, Swift.Hashable, Swift.Int, Swift.RawRepresentableAnalyzed targets: Adyen, AdyenActions, AdyenCard, AdyenCardScanner, AdyenCashAppPay, AdyenComponents, AdyenDelegatedAuthentication, AdyenDropIn, AdyenEncryption, AdyenSession, AdyenSwiftUI, AdyenTwint, AdyenWeChatPay
7988d2b
into
feature/COSDK-1089_UPI_Smart_Intent
Summary
Introduces UPI app detection logic to
UPIComponent. The component now detects locally installed UPI apps and prioritizes them in the UI, falling back to all apps from thepaymentMethodsresponse if none are installed.Behavior
paymentMethodsresponseKnown Limitations
paymentMethodsresponse changes are ready.Other Changes
Info.plistwith supported UPI app URL schemesFuture work
UPIComponentto track app detection. ([v5] UPI Smart Intent - Analytics Events #2486)Demo
Scenario 1: No UPI Apps detected on device
upi-smart-intent-no-apps.mov
Scenario 2: UPI Apps detected on device
upi-smart-intent-apps.mp4
Ticket
COSDK-1089Checklist