Skip to content

Commit

Permalink
Merge branch 'develop' into COIOS-802_identify_native_redirect_flow
Browse files Browse the repository at this point in the history
  • Loading branch information
nauaros committed Jan 21, 2025
2 parents 8528392 + 7a5814a commit 1271dbd
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 52 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/detect_api_changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,31 @@ on:
required: true

jobs:

build:
runs-on: macos-14 # Apple Silicon Runner
runs-on: macos-14

steps:
- uses: actions/checkout@v4
- uses: n1hility/cancel-previous-runs@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Select latest Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4'
xcode-version: '16.1'

- name: 🚚 Fetch repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 👾 Define Diff Versions
run: |
# Disabling this check from PRs of forked repositories because of insufficient access permissions
if [[ "${{ env.headGithubRepo }}" != "${{ env.baseGithubRepo }}" ]]; then
echo "The head repository is different from the base repository. Exiting..."
echo "skip_workflow=true" >> $GITHUB_ENV
exit 0
fi
NEW="${{ env.source }}~${{ env.headGithubRepo }}"
OLD="${{ env.target }}~${{ env.baseGithubRepo }}"
if [[ '${{ github.head_ref || env.noTargetBranch }}' == release/* ]]
if [[ '${{ env.targetBranchName || env.noTargetBranch }}' == release/* ]]
then
LATEST_TAG=$(git describe --tags --abbrev=0)
OLD="$LATEST_TAG~${{ env.baseGithubRepo }}"
Expand All @@ -59,11 +52,12 @@ jobs:
headGithubRepo: '${{github.server_url}}/${{ github.event.pull_request.head.repo.full_name || github.repository}}.git'
baseGithubRepo: '${{github.server_url}}/${{github.repository}}.git'
noTargetBranch: 'no target branch'
targetBranchName: '${{ github.head_ref }}'

# The github action automatically posts on a PR (if it's not a fork-PR)
# and/or outputs the diff to the $GITHUB_STEP_SUMMARY
- name: 🔍 Detect Changes
if: env.skip_workflow != 'true'
uses: Adyen/adyen-swift-public-api-diff@0.7.0
id: public_api_diff
uses: Adyen/adyen-swift-public-api-diff@0.8.1
with:
platform: "iOS"
new: ${{ env.NEW_VERSION }}
Expand Down
4 changes: 0 additions & 4 deletions Adyen.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@
A02AF3DF274FB30200E1636C /* ApplePayStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02AF3DE274FB30200E1636C /* ApplePayStyle.swift */; };
A02AF3E8275A0D0900E1636C /* DocumentComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02AF3E7275A0D0900E1636C /* DocumentComponent.swift */; };
A02AF3EA275A3A5100E1636C /* DocumentAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02AF3E9275A3A5100E1636C /* DocumentAction.swift */; };
A030E7952823B2A200C463F1 /* FormCardNumberContainerItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A030E7942823B2A200C463F1 /* FormCardNumberContainerItemView.swift */; };
A03EE72F2760A2E300470561 /* DocumentActionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A03EE72E2760A2E300470561 /* DocumentActionViewModel.swift */; };
A03EE7312761297800470561 /* DocumentComponentStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = A03EE7302761297800470561 /* DocumentComponentStyle.swift */; };
A03EE73327612BF300470561 /* DocumentActionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A03EE73227612BF300470561 /* DocumentActionView.swift */; };
Expand Down Expand Up @@ -1757,7 +1756,6 @@
A02AF3DE274FB30200E1636C /* ApplePayStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplePayStyle.swift; sourceTree = "<group>"; };
A02AF3E7275A0D0900E1636C /* DocumentComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DocumentComponent.swift; sourceTree = "<group>"; };
A02AF3E9275A3A5100E1636C /* DocumentAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DocumentAction.swift; sourceTree = "<group>"; };
A030E7942823B2A200C463F1 /* FormCardNumberContainerItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormCardNumberContainerItemView.swift; sourceTree = "<group>"; };
A03B7C9129B0C61500FDDDFC /* CashAppPayComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CashAppPayComponent.swift; sourceTree = "<group>"; };
A03EE72E2760A2E300470561 /* DocumentActionViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DocumentActionViewModel.swift; sourceTree = "<group>"; };
A03EE7302761297800470561 /* DocumentComponentStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DocumentComponentStyle.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3885,7 +3883,6 @@
A01DCF0A26BD67BB00BC35B3 /* FormCardExpiryDateItem.swift */,
A018094726FDD345003A8DE3 /* FormCardNumberContainerItem.swift */,
A09C704227032870004C01AA /* FormCardLogosItemView.swift */,
A030E7942823B2A200C463F1 /* FormCardNumberContainerItemView.swift */,
B6C9DA782D0C3F62005D65C7 /* DualBrandView.swift */,
);
path = Form;
Expand Down Expand Up @@ -7375,7 +7372,6 @@
E745175525FB6A59000BDCCF /* CardViewController.swift in Sources */,
E9240D6C2265EFE900FB57D0 /* StoredCardAlertManager.swift in Sources */,
A0F455A12968472B001742C7 /* PartialPaymentMethodDetails.swift in Sources */,
A030E7952823B2A200C463F1 /* FormCardNumberContainerItemView.swift in Sources */,
E7B627FD24ED32CC000CEC6E /* BinLookupService.swift in Sources */,
F9B8C49123FC286D00C4D0FB /* FormCardNumberItem.swift in Sources */,
E76EC682241125F5009C6E2F /* FormCardSecurityCodeItemView.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ open class FormVerticalStackItemView<FormItemType: FormItem>: FormItemView<FormI
observations.forEach(remove)
observations = []
}

override open var canBecomeFirstResponder: Bool {
views.first { $0.canBecomeFirstResponder } != nil
}

override open func becomeFirstResponder() -> Bool {
views.first { $0.canBecomeFirstResponder }?.becomeFirstResponder() ?? super.becomeFirstResponder()
}

}

Expand Down
9 changes: 6 additions & 3 deletions AdyenActions/AdyenActionComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,13 @@ public final class AdyenActionComponent: ActionComponent, ActionHandlingComponen
public var callbackAppScheme: String

/// The issuer number of the highest scheme you listed under `LSApplicationQueriesSchemes`.
/// E.g. pass 39, if you listed all schemes from "twint-issuer1" up to and including "twint-issuer39". The value is clamped between 0 and 39.
/// E.g. pass 39, if you listed all schemes from "twint-issuer1" up to and including "twint-issuer39".
/// The value is clamped between 0 and 39.
///
/// - Important: All apps above "twint-issuer39" will always be returned if one of these apps is installed. For this to work, `LSApplicationQueriesSchemes` must include "twint-extended".
/// If you configure any `maxIssuerNumber` below 39, the result will always contain all apps above `maxIssuerNumber` up to and including 39, even if none of them are installed.
/// - Important: All apps above "twint-issuer39" will always be returned if one of these apps is installed.
/// For this to work, `LSApplicationQueriesSchemes` must include "twint-extended".
/// If you configure any `maxIssuerNumber` below 39, the result will always contain all apps above `maxIssuerNumber`
/// up to and including 39, even if none of them are installed.
/// Additionally, if the fetch fails and the cache is empty, none of these apps will be found when probing.
public var maxIssuerNumber: Int

Expand Down
9 changes: 6 additions & 3 deletions AdyenActions/Components/SDK/TwintSDKActionComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ import Foundation
public let callbackAppScheme: String

/// The issuer number of the highest scheme you listed under `LSApplicationQueriesSchemes`.
/// E.g. pass 39, if you listed all schemes from "twint-issuer1" up to and including "twint-issuer39". The value is clamped between 0 and 39.
/// E.g. pass 39, if you listed all schemes from "twint-issuer1" up to and including "twint-issuer39".
/// The value is clamped between 0 and 39.
///
/// - Important: All apps above "twint-issuer39" will always be returned if one of these apps is installed. For this to work, `LSApplicationQueriesSchemes` must include "twint-extended".
/// If you configure any `maxIssuerNumber` below 39, the result will always contain all apps above `maxIssuerNumber` up to and including 39, even if none of them are installed.
/// - Important: All apps above "twint-issuer39" will always be returned if one of these apps is installed.
/// For this to work, `LSApplicationQueriesSchemes` must include "twint-extended".
/// If you configure any `maxIssuerNumber` below 39, the result will always contain all apps above `maxIssuerNumber`
/// up to and including 39, even if none of them are installed.
/// Additionally, if the fetch fails and the cache is empty, none of these apps will be found when probing.
public let maxIssuerNumber: Int

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ internal protocol DelegatedAuthenticationViewDelegate: AnyObject {
}

@available(iOS 16.0, *)
// swiftlint:disable:next type_body_length
internal final class DelegatedAuthenticationView: UIView {

private enum Constants {
Expand Down
2 changes: 1 addition & 1 deletion AdyenCard/Form/FormCardNumberContainerItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ extension FormItemViewBuilder {
}

internal func build(with item: FormCardNumberContainerItem) -> FormItemView<FormCardNumberContainerItem> {
FormCardNumberContainerItemView(item: item, itemSpacing: 0)
FormVerticalStackItemView(item: item, itemSpacing: 0)
}
}

Expand Down
20 changes: 0 additions & 20 deletions AdyenCard/Form/FormCardNumberContainerItemView.swift

This file was deleted.

8 changes: 5 additions & 3 deletions AdyenComponents/Apple Pay/ApplePayComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class ApplePayComponent: NSObject, PresentableComponent, PaymentComponent
super.init()

paymentAuthorizationViewController?.delegate = self
sendInitialAnalytics()
}

public var viewController: UIViewController {
Expand Down Expand Up @@ -110,6 +111,10 @@ public class ApplePayComponent: NSObject, PresentableComponent, PaymentComponent
paymentAuthorizationViewController?.delegate = self
state = .initial
}
if paymentAuthorizationViewController?.isViewLoaded == false {
sendDidLoadEvent()
}

return paymentAuthorizationViewController!
}

Expand All @@ -130,6 +135,3 @@ extension ApplePayComponent {

@_spi(AdyenInternal)
extension ApplePayComponent: TrackableComponent {}

@_spi(AdyenInternal)
extension ApplePayComponent: ViewControllerDelegate {}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ You can integrate with Adyen iOS in two ways:
| 4.x.x | Inactive | TBA | TBA |
| 3.x.x | Deprecated | November 2021 | November 2022 |

More information about our versioning and the Drop-in/Components lifecycle can be found [here](https://docs.adyen.com/online-payments/upgrade-your-integration/).

## Installation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,19 @@ class ApplePayComponentTest: XCTestCase {
)

// When
sut.viewDidLoad(viewController: mockViewController)
sut.viewController.loadViewIfNeeded()

// Then
XCTAssertEqual(analyticsProviderMock.initialEventCallsCount, 1)
XCTAssertEqual(analyticsProviderMock.infos.count, 1)
let infoType = analyticsProviderMock.infos.first?.type
XCTAssertEqual(infoType, .rendered)

// access view controller again but not trigger render
sut.viewController.loadViewIfNeeded()
XCTAssertEqual(analyticsProviderMock.initialEventCallsCount, 1)
XCTAssertEqual(analyticsProviderMock.infos.count, 1)

}

private func getRandomContactFieldSet() -> Set<PKContactField> {
Expand Down

0 comments on commit 1271dbd

Please sign in to comment.