Skip to content

Commit a6bd187

Browse files
authored
Merge pull request #1668 from braintree/v7
[V7] Merge V7 Feature Branch
2 parents f473b1e + 254a1ec commit a6bd187

195 files changed

Lines changed: 5258 additions & 7393 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,32 @@ concurrency:
55
cancel-in-progress: true
66
jobs:
77
cocoapods:
8-
name: CocoaPods (Xcode 15.0.1)
9-
runs-on: macOS-14-xlarge
8+
name: CocoaPods (Xcode 16.4.0)
9+
runs-on: macos-15-xlarge
1010
steps:
1111
- name: Check out repository
1212
uses: actions/checkout@v4
1313
with:
1414
ref: ${{ github.event.pull_request.head.ref }}
1515
repository: ${{ github.event.pull_request.head.repo.full_name }}
16-
- name: Use Xcode 15.0.1
17-
run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app
16+
- name: Use Xcode 16.4.0
17+
run: sudo xcode-select -switch /Applications/Xcode_16.4.0.app
1818
- name: Install CocoaPod dependencies
1919
run: pod install
2020
- name: Run pod lib lint
2121
run: pod lib lint
2222
carthage:
23-
name: Carthage (Xcode 15.0.1)
24-
runs-on: macOS-14-xlarge
23+
name: Carthage (Xcode 16.4.0)
24+
runs-on: macos-15-xlarge
2525
steps:
2626
- name: Check out repository
2727
uses: actions/checkout@v4
2828
with:
2929
fetch-depth: 0
3030
ref: ${{ github.event.pull_request.head.ref }}
3131
repository: ${{ github.event.pull_request.head.repo.full_name }}
32-
- name: Use Xcode 15.0.1
33-
run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app
32+
- name: Use Xcode 16.4.0
33+
run: sudo xcode-select -switch /Applications/Xcode_16.4.0.app
3434
- name: Remove SPMTest
3535
run: |
3636
git config --global user.email "code@getbraintree.com"
@@ -48,16 +48,16 @@ jobs:
4848
- name: Build CarthageTest
4949
run: xcodebuild -project 'SampleApps/CarthageTest/CarthageTest.xcodeproj' -scheme 'CarthageTest' clean build CODE_SIGNING_ALLOWED=NO
5050
spm:
51-
name: SPM (Xcode 15.0.1)
52-
runs-on: macOS-14-xlarge
51+
name: SPM (Xcode 16.4.0)
52+
runs-on: macos-15-xlarge
5353
steps:
5454
- name: Check out repository
5555
uses: actions/checkout@v4
5656
with:
5757
ref: ${{ github.event.pull_request.head.ref }}
5858
repository: ${{ github.event.pull_request.head.repo.full_name }}
59-
- name: Use Xcode 15.0.1
60-
run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app
59+
- name: Use Xcode 16.4.0
60+
run: sudo xcode-select -switch /Applications/Xcode_16.4.0.app
6161
- name: Use current branch
6262
run: sed -i '' 's/branch = .*/branch = \"'"${GITHUB_HEAD_REF//\//\/}"'\";/' SampleApps/SPMTest/SPMTest.xcodeproj/project.pbxproj
6363
- name: Run swift package resolve

.github/workflows/release.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ on:
88
jobs:
99
release:
1010
name: Release
11-
runs-on: macOS-14-xlarge
11+
runs-on: macos-15-xlarge
1212
steps:
1313
- name: Check out repository
1414
uses: actions/checkout@v4
1515
with:
1616
fetch-depth: 0
1717

18-
- name: Use Xcode 15.0.1
19-
run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app
18+
- name: Use Xcode 16.4.0
19+
run: sudo xcode-select -switch /Applications/Xcode_16.4.0.app
2020

2121
- name: Check for unreleased section in changelog
2222
run: grep "## unreleased" CHANGELOG.md || (echo "::error::No unreleased section found in CHANGELOG"; exit 1)
@@ -95,7 +95,7 @@ jobs:
9595
MACH_O_TYPE = staticlib;' Braintree.xcodeproj/project.pbxproj
9696
9797
# 2) Define all Schemes to build
98-
SCHEMES=("BraintreeAmericanExpress" "BraintreeApplePay" "BraintreeCard" "BraintreeCore" "BraintreeDataCollector" "BraintreeLocalPayment" "BraintreePayPal" "BraintreePayPalMessaging" "BraintreePayPalNativeCheckout" "BraintreeSEPADirectDebit" "BraintreeShopperInsights" "BraintreeThreeDSecure" "BraintreeVenmo")
98+
SCHEMES=("BraintreeAmericanExpress" "BraintreeApplePay" "BraintreeCard" "BraintreeCore" "BraintreeDataCollector" "BraintreeLocalPayment" "BraintreePayPal" "BraintreePayPalMessaging" "BraintreeSEPADirectDebit" "BraintreeShopperInsights" "BraintreeThreeDSecure" "BraintreeVenmo")
9999
100100
for scheme in "${SCHEMES[@]}"; do
101101
# 3) Build device archive
@@ -133,22 +133,21 @@ jobs:
133133
brew install sourcekitten
134134
135135
# run sourcekitten on each Swift module individually
136-
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeCore -destination 'name=iPhone 14,platform=iOS Simulator' > braintree-core.json
137-
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreePayPalNativeCheckout -destination 'name=iPhone 14,platform=iOS Simulator' > braintree-pay-pal-native-checkout.json
138-
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeSEPADirectDebit -destination 'name=iPhone 14,platform=iOS Simulator' > braintree-sepa-direct-debit.json
139-
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeAmericanExpress -destination 'name=iPhone 14,platform=iOS Simulator' > braintree-american-express.json
140-
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeDataCollector -destination 'name=iPhone 14,platform=iOS Simulator' > braintree-data-collector.json
141-
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeApplePay -destination 'name=iPhone 14,platform=iOS Simulator' > braintree-apple-pay.json
142-
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeLocalPayment -destination 'name=iPhone 14,platform=iOS Simulator' > braintree-local-payment.json
143-
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeThreeDSecure -destination 'name=iPhone 14,platform=iOS Simulator' > braintree-three-d-secure.json
144-
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeCard -destination 'name=iPhone 14,platform=iOS Simulator' > braintree-card.json
145-
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreePayPal -destination 'name=iPhone 14,platform=iOS Simulator' > braintree-paypal.json
146-
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeVenmo -destination 'name=iPhone 14,platform=iOS Simulator' > braintree-venmo.json
147-
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreePayPalMessaging -destination 'name=iPhone 14,platform=iOS Simulator' > braintree-paypal-messaging.json
148-
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeShopperInsights -destination 'name=iPhone 14,platform=iOS Simulator' > braintree-shopper-insights.json
136+
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeCore -destination 'name=iPhone 16,platform=iOS Simulator' > braintree-core.json
137+
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeSEPADirectDebit -destination 'name=iPhone 16,platform=iOS Simulator' > braintree-sepa-direct-debit.json
138+
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeAmericanExpress -destination 'name=iPhone 16,platform=iOS Simulator' > braintree-american-express.json
139+
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeDataCollector -destination 'name=iPhone 16,platform=iOS Simulator' > braintree-data-collector.json
140+
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeApplePay -destination 'name=iPhone 16,platform=iOS Simulator' > braintree-apple-pay.json
141+
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeLocalPayment -destination 'name=iPhone 16,platform=iOS Simulator' > braintree-local-payment.json
142+
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeThreeDSecure -destination 'name=iPhone 16,platform=iOS Simulator' > braintree-three-d-secure.json
143+
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeCard -destination 'name=iPhone 16,platform=iOS Simulator' > braintree-card.json
144+
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreePayPal -destination 'name=iPhone 16,platform=iOS Simulator' > braintree-paypal.json
145+
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeVenmo -destination 'name=iPhone 16,platform=iOS Simulator' > braintree-venmo.json
146+
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreePayPalMessaging -destination 'name=iPhone 16,platform=iOS Simulator' > braintree-paypal-messaging.json
147+
sourcekitten doc -- -workspace Braintree.xcworkspace -scheme BraintreeShopperInsights -destination 'name=iPhone 16,platform=iOS Simulator' > braintree-shopper-insights.json
149148
150149
# merge sourcekitten output
151-
jq -s '.[0] + .[1] + .[2] + .[3] + .[4] + .[5] + .[6] + .[7] + .[8] + .[9] + .[10] + .[11] + .[12]' braintree-core.json braintree-pay-pal-native-checkout.json braintree-sepa-direct-debit.json braintree-american-express.json braintree-data-collector.json braintree-apple-pay.json braintree-local-payment.json braintree-three-d-secure.json braintree-card.json braintree-paypal.json braintree-venmo.json braintree-paypal-messaging.json braintree-shopper-insights.json > swiftDoc.json
150+
jq -s '.[0] + .[1] + .[2] + .[3] + .[4] + .[5] + .[6] + .[7] + .[8] + .[9] + .[10] + .[11]' braintree-core.json braintree-sepa-direct-debit.json braintree-american-express.json braintree-data-collector.json braintree-apple-pay.json braintree-local-payment.json braintree-three-d-secure.json braintree-card.json braintree-paypal.json braintree-venmo.json braintree-paypal-messaging.json braintree-shopper-insights.json > swiftDoc.json
152151
153152
jazzy \
154153
--sourcekitten-sourcefile swiftDoc.json \

.github/workflows/security.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ jobs:
2020
code-scanning:
2121
uses: braintree/security-workflows/.github/workflows/codeql-ios.yml@main
2222
with:
23+
mac-runner-version: 'macos-15-xlarge'
2324
project: Demo/Demo.xcodeproj
2425
workspace: Braintree.xcworkspace
2526
scheme: Demo
2627

2728
dependency-review:
28-
uses: braintree/security-workflows/.github/workflows/dependency-review.yml@main
29+
uses: braintree/security-workflows/.github/workflows/dependency-review.yml@main

.github/workflows/tests.yml

Lines changed: 50 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,24 @@ concurrency:
66
jobs:
77
unit_test_job:
88
name: Unit
9-
runs-on: macOS-14-xlarge
9+
runs-on: macos-15-xlarge
1010
steps:
1111
- name: Checkout repository
1212
uses: actions/checkout@v4
1313
with:
1414
ref: ${{ github.event.pull_request.head.ref }}
1515
repository: ${{ github.event.pull_request.head.repo.full_name }}
16-
- name: Use Xcode 15.0.1
17-
run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app
16+
- name: Use Xcode 16.4
17+
run: sudo xcode-select -switch /Applications/Xcode_16.4.0.app
1818
- name: Install Package dependencies
1919
run: swift package resolve
2020
- name: Install CocoaPod dependencies
2121
run: pod install
2222
- name: Run Unit Tests
23-
run: set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Debug' -scheme 'UnitTests' -destination 'platform=iOS Simulator,name=iPhone 15' test | ./Pods/xcbeautify/xcbeautify
24-
23+
run: set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Debug' -scheme 'UnitTests' -destination 'name=iPhone 16 Pro,OS=18.5,platform=iOS Simulator' -derivedDataPath DerivedData test | ./Pods/xcbeautify/xcbeautify
2524
ui_test_job:
2625
name: UI
27-
runs-on: macOS-14-xlarge
26+
runs-on: macos-15-xlarge
2827
timeout-minutes: 20 # Add overall job timeout
2928
strategy:
3029
matrix:
@@ -33,6 +32,8 @@ jobs:
3332
- PayPal_Checkout_UITests
3433
- PayPal_Vault_UITests
3534
- Venmo_UITests
35+
- PayPalMessaging_Failure_UITests
36+
- PayPalMessaging_Success_UITests
3637
fail-fast: false # Continue running other test suites if one fails
3738
steps:
3839
- name: Checkout repository
@@ -41,93 +42,83 @@ jobs:
4142
ref: ${{ github.event.pull_request.head.ref }}
4243
repository: ${{ github.event.pull_request.head.repo.full_name }}
4344

44-
- name: Use Xcode 15.0.1
45-
run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app
45+
- name: Use Xcode 16.4
46+
run: sudo xcode-select -switch /Applications/Xcode_16.4.0.app
4647

4748
- name: Install CocoaPod dependencies
4849
run: pod install
4950

5051
- name: Boot Simulator
5152
run: |
5253
# Boot simulator ahead of time to reduce test startup time
53-
xcrun simctl boot "iPhone 15" || true
54-
# Wait for simulator to boot
55-
xcrun simctl bootstatus "iPhone 15" -b || true
54+
# Find iPhone 16 Pro with iOS 18.5
55+
DEVICE_UDID=$(xcrun simctl list devices | grep -A 1 "iOS 18.5" | grep "iPhone 16 Pro (" | head -n 1 | grep -oE '\([A-Z0-9-]+\)' | tr -d '()')
56+
57+
if [ -n "$DEVICE_UDID" ]; then
58+
xcrun simctl boot "$DEVICE_UDID" || true
59+
xcrun simctl bootstatus "$DEVICE_UDID" -b || true
60+
fi
5661
# Disable hardware keyboard to avoid input issues
5762
defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false
5863
5964
- name: Clean Simulator State
65+
timeout-minutes: 3
6066
run: |
6167
# Reset simulator state to ensure clean environment
62-
xcrun simctl shutdown all || true
63-
xcrun simctl erase all || true
64-
xcrun simctl boot "iPhone 15" || true
65-
xcrun simctl bootstatus "iPhone 15" -b || true
68+
echo "Finding iPhone 16 Pro (iOS 18.5) simulator..."
69+
DEVICE_UDID=$(xcrun simctl list devices | grep -A 1 "iOS 18.5" | grep "iPhone 16 Pro (" | head -n 1 | grep -oE '\([A-Z0-9-]+\)' | tr -d '()')
6670
67-
- name: Run UI Tests - ${{ matrix.test-suite }}
68-
id: test_attempt_1
69-
continue-on-error: true
70-
run: |
71-
set -o pipefail
72-
xcodebuild \
73-
-workspace 'Braintree.xcworkspace' \
74-
-sdk 'iphonesimulator' \
75-
-configuration 'Release' \
76-
-scheme 'UITests' \
77-
-destination 'name=iPhone 15,OS=17.2,platform=iOS Simulator' \
78-
-only-testing:UITests/${{ matrix.test-suite }} \
79-
-maximum-concurrent-test-simulator-destinations 1 \
80-
-disable-concurrent-testing \
81-
test | ./Pods/xcbeautify/xcbeautify
71+
if [ -z "$DEVICE_UDID" ]; then
72+
echo "::error::iPhone 16 Pro (iOS 18.5) simulator not found"
73+
exit 1
74+
fi
8275
83-
- name: Retry UI Tests (if failed) - ${{ matrix.test-suite }}
84-
if: steps.test_attempt_1.outcome == 'failure'
85-
id: test_attempt_2
86-
continue-on-error: true
87-
run: |
88-
echo "First attempt failed, retrying..."
89-
# Clean simulator state before retry
90-
xcrun simctl shutdown all || true
91-
xcrun simctl erase all || true
92-
xcrun simctl boot "iPhone 15" || true
93-
xcrun simctl bootstatus "iPhone 15" -b || true
76+
echo "Using simulator: $DEVICE_UDID"
77+
78+
# Shutdown only the target simulator (not all)
79+
xcrun simctl shutdown "$DEVICE_UDID" 2>/dev/null || true
80+
81+
# Erase only the target simulator
82+
echo "Erasing simulator data..."
83+
xcrun simctl erase "$DEVICE_UDID"
84+
85+
# Boot simulator
86+
echo "Booting simulator..."
87+
xcrun simctl boot "$DEVICE_UDID"
88+
89+
# Wait for boot with timeout (60 seconds)
90+
echo "Waiting for simulator to boot..."
91+
timeout 60 xcrun simctl bootstatus "$DEVICE_UDID" -b || echo "::warning::Boot status check timed out, continuing anyway"
9492
93+
- name: Run UI Tests - ${{ matrix.test-suite }}
94+
run: |
9595
set -o pipefail
9696
xcodebuild \
9797
-workspace 'Braintree.xcworkspace' \
9898
-sdk 'iphonesimulator' \
99-
-configuration 'Release' \
99+
-configuration 'Debug' \
100100
-scheme 'UITests' \
101-
-destination 'name=iPhone 15,OS=17.2,platform=iOS Simulator' \
101+
-destination 'name=iPhone 16 Pro,OS=18.5,platform=iOS Simulator' \
102+
-derivedDataPath DerivedData \
102103
-only-testing:UITests/${{ matrix.test-suite }} \
103-
-maximum-concurrent-test-simulator-destinations 1 \
104-
-disable-concurrent-testing \
104+
-disable-concurrent-destination-testing \
105+
-retry-tests-on-failure \
105106
test | ./Pods/xcbeautify/xcbeautify
106107
107-
- name: Final UI Test Result - ${{ matrix.test-suite }}
108-
if: steps.test_attempt_1.outcome == 'failure'
109-
run: |
110-
if [ "${{ steps.test_attempt_2.outcome }}" == "failure" ]; then
111-
echo "UI Tests failed after retry"
112-
exit 1
113-
else
114-
echo "UI Tests passed on retry"
115-
fi
116-
117108
integration_test_job:
118109
name: Integration
119-
runs-on: macOS-14-xlarge
110+
runs-on: macos-15-xlarge
120111
steps:
121112
- name: Checkout repository
122113
uses: actions/checkout@v4
123114
with:
124115
ref: ${{ github.event.pull_request.head.ref }}
125116
repository: ${{ github.event.pull_request.head.repo.full_name }}
126-
- name: Use Xcode 15.0.1
127-
run: sudo xcode-select -switch /Applications/Xcode_15.0.1.app
117+
- name: Use Xcode 16.4
118+
run: sudo xcode-select -switch /Applications/Xcode_16.4.0.app
128119
- name: Install Package dependencies
129120
run: swift package resolve
130121
- name: Install CocoaPod dependencies
131122
run: pod install
132123
- name: Run Integration Tests
133-
run: set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Release' -scheme 'IntegrationTests' -destination 'name=iPhone 15,OS=17.2,platform=iOS Simulator' test | ./Pods/xcbeautify/xcbeautify
124+
run: set -o pipefail && xcodebuild -workspace 'Braintree.xcworkspace' -sdk 'iphonesimulator' -configuration 'Release' -scheme 'IntegrationTests' -destination 'name=iPhone 16 Pro,OS=18.5,platform=iOS Simulator' -derivedDataPath DerivedData test | ./Pods/xcbeautify/xcbeautify

Braintree.podspec

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "Braintree"
3-
s.version = "6.39.0"
3+
s.version = "7.0.0-beta2"
44
s.summary = "Braintree iOS SDK: Helps you accept card and alternative payments in your iOS app."
55
s.description = <<-DESC
66
Braintree is a full-stack payments platform for developers
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
1717

1818
s.platform = :ios, "14.0"
1919
s.compiler_flags = "-Wall -Werror -Wextra"
20-
s.swift_version = "5.9"
20+
s.swift_version = "5.10"
2121

2222
s.default_subspecs = %w[Core Card PayPal]
2323

@@ -54,7 +54,7 @@ Pod::Spec.new do |s|
5454
end
5555

5656
s.subspec "LocalPayment" do |s|
57-
s.source_files = "Sources/BraintreeLocalPayment/*.swift"
57+
s.source_files = "Sources/BraintreeLocalPayment/**/*.swift"
5858
s.dependency "Braintree/Core"
5959
s.dependency "Braintree/DataCollector"
6060
s.resource_bundle = { "BraintreeLocalPayment_PrivacyInfo" => "Sources/BraintreeLocalPayment/PrivacyInfo.xcprivacy" }
@@ -79,14 +79,6 @@ Pod::Spec.new do |s|
7979
s.resource_bundle = { "BraintreeShopperInsights_PrivacyInfo" => "Sources/BraintreeShopperInsights/PrivacyInfo.xcprivacy" }
8080
end
8181

82-
s.subspec "PayPalNativeCheckout" do |s|
83-
s.source_files = "Sources/BraintreePayPalNativeCheckout/*.swift"
84-
s.dependency "Braintree/Core"
85-
s.dependency "Braintree/PayPal"
86-
s.dependency "PayPalCheckout", '1.3.0'
87-
s.resource_bundle = { "BraintreePayPalNativeCheckout_PrivacyInfo" => "Sources/BraintreePayPalNativeCheckout/PrivacyInfo.xcprivacy" }
88-
end
89-
9082
s.subspec "PayPalMessaging" do |s|
9183
s.source_files = "Sources/BraintreePayPalMessaging/*.swift"
9284
s.dependency "Braintree/Core"
@@ -102,7 +94,7 @@ Pod::Spec.new do |s|
10294
end
10395

10496
s.subspec "Venmo" do |s|
105-
s.source_files = "Sources/BraintreeVenmo/*.swift"
97+
s.source_files = "Sources/BraintreeVenmo/**/*.swift"
10698
s.dependency "Braintree/Core"
10799
s.resource_bundle = { "BraintreeVenmo_PrivacyInfo" => "Sources/BraintreeVenmo/PrivacyInfo.xcprivacy" }
108100
end

0 commit comments

Comments
 (0)