Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: surface sdk versions from version.swift #23

Merged
merged 6 commits into from
Oct 25, 2023
Merged

Conversation

NQuinn27
Copy link
Contributor

  • Surfaces the wrapper sdk version from the harcoded version.swift file via the public interface.
  • Hardcodes the Netcetera SDK version to be surfaced via the public interface.
  • Adds unit tests for version numbers
  • Adds unit test to check hardcoded netcetera version matches the xcframework
  • Deprecates hardcodedVersion to be removed later.

@NQuinn27 NQuinn27 requested a review from a team as a code owner October 18, 2023 11:41
borisprimer
borisprimer previously approved these changes Oct 18, 2023
jnewc
jnewc previously approved these changes Oct 18, 2023
Sources/Primer3DS/Classes/version.swift Outdated Show resolved Hide resolved
Sources/Primer3DS/Classes/VersionUtils.swift Outdated Show resolved Hide resolved
@NQuinn27 NQuinn27 dismissed stale reviews from jnewc and borisprimer via 8bb112b October 18, 2023 13:55
@NQuinn27 NQuinn27 requested a review from jnewc October 18, 2023 13:58
jnewc
jnewc previously approved these changes Oct 18, 2023
@@ -1 +1,2 @@
let Primer3DSVersion = "2.0.0"
let Primer3DSSDKVersion = "2.0.0"
let NetceteraSDKVersion = "2.3.74"
Copy link
Contributor

Choose a reason for hiding this comment

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

@NQuinn27 can you please check if ThreeDS2ServiceSDK has a function to get the version?Their Android SDK offers that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From what I can see, the only way to get to it is via the info.plist of the ThreeDS_SDK Framework. This is how we were fetching it before, and it appears like it wasn't working correctly in some merchants setups.

I feel ok about hardcoding it here, I added a unit test to flag when it is out of sync with the version in the info.plist - so we wont release a wrong version number here.

XCTAssertEqual(VersionUtils.threeDSSDKVersionNumber, NetceteraSDKVersion)
}

func test_3DSMatchesNetcetera() throws {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@semirp The test I refrerenced in my last comment. This Bundle(for: ThreeDS2ServiceSDK.self) is the correct way to get the version - and should work in a normal integration (so it works for us to test the versions match) - but doesnt work in certain merchants setups.

I think this gives us the certainty we need that the version will be correct in the wild, and the checks that we dont forget to update it.

@NQuinn27 NQuinn27 merged commit dbc87d0 into main Oct 25, 2023
2 checks passed
@NQuinn27 NQuinn27 deleted the nq/report_sdk_version branch October 26, 2023 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants