Skip to content

Commit

Permalink
Pass correlation ID to risk SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
precious-ossai-cko authored and okhan-okbay-cko committed Apr 3, 2024
1 parent 5693ee1 commit 207b5b4
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 84 deletions.
32 changes: 26 additions & 6 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
destination: "platform=iOS Simulator,name=iPhone 15 Pro,OS=latest"
configuration: "Debug"
noIndex: "COMPILER_INDEX_STORE_ENABLE=NO"
noSigning: "CODE_SIGNING_ALLOWED=NO"
versionXcode: "15.2"

jobs:
analyze:
name: Analyze
runs-on: [ macos-latest ]
runs-on: [ macos-13-large ]
permissions:
actions: read
contents: read
Expand All @@ -45,24 +52,37 @@ jobs:
with:
languages: ${{ matrix.language }}
queries: security-and-quality


- name: Select Xcode
run: |
sudo xcode-select -switch /Applications/Xcode_${versionXcode}.app
- name: Log xcodebuild Version
run: |
xcodebuild -version
- name: Build Frames
run: |
xcodebuild -scheme Frames -destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=latest"
xcodebuild -scheme Frames -destination "${destination}" "${noIndex}" "${noSigning}" | xcpretty
- name: Build CheckoutTests
run: |
xcodebuild build -scheme CheckoutTests -destination "${destination}" "${noIndex}" "${noSigning}" | xcpretty
- name: Build FramesTests
run: |
xcodebuild -scheme FramesTests -destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=latest" test
xcodebuild build -scheme FramesTests -destination "${destination}" "${noIndex}" "${noSigning}" | xcpretty
- name: Build iOS Example Frame SPM
run: |
cd iOS\ Example\ Frame\ SPM
xcodebuild build -scheme iOS\ Example\ Frame -destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=latest"
xcodebuild build -scheme iOS\ Example\ Frame -destination "${destination}" "${noIndex}" "${noSigning}" | xcpretty
- name: Build UITest
run: |
cd iOS\ Example\ Frame\ SPM
xcodebuild -scheme UITest -destination "platform=iOS Simulator,name=iPhone 14 Pro,OS=latest"
xcodebuild -scheme UITest -destination "${destination}" "${noIndex}" "${noSigning}" | xcpretty
# Perform analysis on the code
- name: Analyze code with CodeQL
Expand Down
11 changes: 10 additions & 1 deletion .swiftpm/xcode/xcshareddata/xcschemes/CheckoutTests.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
Expand Down Expand Up @@ -53,6 +53,15 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CheckoutTests"
BuildableName = "CheckoutTests"
BlueprintName = "CheckoutTests"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
25 changes: 25 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/FramesTests.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FramesTests"
BuildableName = "FramesTests"
BlueprintName = "FramesTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
Expand Down Expand Up @@ -42,6 +58,15 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FramesTests"
BuildableName = "FramesTests"
BlueprintName = "FramesTests"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
2 changes: 1 addition & 1 deletion Checkout.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ Pod::Spec.new do |s|
s.exclude_files = "Checkout/Samples/**"

s.dependency 'CheckoutEventLoggerKit', '~> 1.2.4'
s.dependency 'Risk', '2.0.1'
s.dependency 'Risk', '2.0.3'

end
3 changes: 2 additions & 1 deletion Checkout/Samples/CocoapodsSample/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ target 'CheckoutCocoapodsSample' do
use_frameworks!

# Pods for CheckoutSDKCocoapodsSample
pod 'Checkout', '4.3.2'
# pod 'Checkout', '4.3.2'
pod 'Frames', :git => 'https://github.com/checkout/frames-ios', :branch => 'feature/pass-correlation-id-to-risk-sdk'

end
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/checkout/frames-ios";
requirement = {
kind = exactVersion;
version = 4.3.2;
branch = "feature/pass-correlation-id-to-risk-sdk";
kind = branch;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"originHash" : "7798b3f49dc3db57f852eea46d1454b7808add05a95e8d76dd9047b1be391a6f",
"pins" : [
{
"identity" : "checkout-event-logger-ios-framework",
Expand All @@ -14,8 +15,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/checkout/checkout-risk-sdk-ios.git",
"state" : {
"revision" : "4823f05166dca8392a41b56b975515c7e0f1a8da",
"version" : "2.0.1"
"revision" : "a5df46ecd4324661459faa9e9ac18d627b4d26aa",
"version" : "2.0.3"
}
},
{
Expand All @@ -32,8 +33,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/checkout/frames-ios",
"state" : {
"revision" : "2dae4f877e3a1882172c749e3bf4c32228b9d6a3",
"version" : "4.3.2"
"branch" : "feature/pass-correlation-id-to-risk-sdk",
"revision" : "0a0df16b3494aedfc176be64f5c3aca0398ab468"
}
},
{
Expand All @@ -46,5 +47,5 @@
}
}
],
"version" : 2
"version" : 3
}
2 changes: 1 addition & 1 deletion Checkout/Source/Tokenisation/CheckoutAPIService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ final public class CheckoutAPIService: CheckoutAPIProtocol {
riskEnvironment = .sandbox
}

let riskConfig = RiskConfig(publicKey: publicKey, environment: riskEnvironment, framesMode: true)
let riskConfig = RiskConfig(publicKey: publicKey, environment: riskEnvironment, framesMode: true, correlationId: logManager.correlationID)
let riskSDK = Risk.init(config: riskConfig)

logManager.setup(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ final class CheckoutAPIServiceIntegrationTests: XCTestCase {

// details associated with default apple pay token
let expectedApplePayDetails = ApplePayDetails(
expiryDate: try! CardValidator(environment: .sandbox).validate(expiryMonth: 3, expiryYear: 24).get(),
expiryDate: .init(month: 3, year: 2024),
bin: "537426",
last4: "7789"
)
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/checkout/checkout-risk-sdk-ios.git",
"state" : {
"revision" : "4823f05166dca8392a41b56b975515c7e0f1a8da",
"version" : "2.0.1"
"revision" : "a5df46ecd4324661459faa9e9ac18d627b4d26aa",
"version" : "2.0.3"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let package = Package(
exact: "3.5.9"),
.package(
url: "https://github.com/checkout/checkout-risk-sdk-ios.git",
exact: "2.0.1"),
exact: "2.0.3"),
.package(
url: "https://github.com/checkout/checkout-event-logger-ios-framework.git",
from: "1.2.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1238,8 +1238,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/checkout/frames-ios";
requirement = {
kind = exactVersion;
version = 4.3.2;
branch = "feature/pass-correlation-id-to-risk-sdk";
kind = branch;
};
};
16C3F83E2A7927ED00690639 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */ = {
Expand Down

This file was deleted.

5 changes: 3 additions & 2 deletions iOS Example Frame/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ target 'iOS Example Frame' do
use_frameworks!

# Pods for iOS Example Custom
pod 'Frames', '4.3.2'

# pod 'Frames', '4.3.2'
pod 'Frames', :git => 'https://github.com/checkout/frames-ios', :branch => 'feature/pass-correlation-id-to-risk-sdk'

end

post_install do |installer|
Expand Down

0 comments on commit 207b5b4

Please sign in to comment.