Skip to content

Conversation

@erenbesel
Copy link
Contributor

@erenbesel erenbesel commented Oct 9, 2025

Summary [Required]

Add a new field called sdkData to the PaymentComponentData type to improve the SDK's performance.

  • The public property itself is a string while internally combines several types together.
  • SDKData is created via composition by relevant modules.
  • Got rid of duplicate code in both DropIn and PaymentComponent, making the important data updates in a single place.

Release notes

New

* The `sdkData` property in the `PaymentComponentData` object. For Advanced flow: it is highly recommended you include it in your `/payments` request.

Deprecated

In the `PaymentComponentData` object:
  • checkoutAttemptId
  • `supportNativeRedirect

In the CardDetails object:

  • threeDS2SDKVersion

Use the new sdkData proerty instead.

Ticket [Optional]

COSDK-515

Checklist [Required]

  • Tested changes locally
  • Added/updated unit tests
  • Verified against acceptance criteria

Adds new field combining several fields for payments calls while deprecating the old ones.
@erenbesel erenbesel requested review from atmamont and nauaros October 9, 2025 13:43
@erenbesel erenbesel added new a pull request that adds a new feature deprecated pull request that deprecates some API labels Oct 9, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @erenbesel, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant architectural improvement by centralizing SDK-specific payment data into a new sdkData object within PaymentComponentData. This change aims to enhance the SDK's performance and streamline data management by consolidating previously disparate data points into a single, composable, and encoded string. It also involves refactoring existing components to reduce code duplication and deprecating older, less efficient data properties.

Highlights

  • New SDKData Field: Introduced a new sdkData field to the PaymentComponentData type, designed to centralize and encapsulate various SDK-specific information as an encoded string, improving performance and data handling.
  • Data Centralization and Composition: The sdkData object is created via composition by relevant modules, combining analytics data (like checkoutAttemptId) and authentication details (like threeDS2SdkVersion) into a single, structured entity.
  • Code Refactoring and Duplication Removal: Refactored PaymentComponent and DropInComponent to eliminate duplicate logic for preparing submission data, centralizing this process into a new prepareSubmitData function within PaymentComponent.
  • Deprecation of Redundant Properties: Deprecated existing supportNativeRedirect and checkoutAttemptId properties in PaymentComponentData, and threeDS2SDKVersion in CardDetails, in favor of the new sdkData property for a unified approach.
  • Enhanced Test Coverage: Added new integration tests for PaymentComponent to verify the correct creation, encoding, and content of the sdkData object, including scenarios with and without authentication providers.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

github-actions[bot]
github-actions bot previously approved these changes Oct 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2025

ℹ️ No baseline data found for 'develop'.

Framework Size
AdyenComponents.framework 2680 KB
AdyenActions.framework 2906 KB
AdyenDropIn.framework 1281 KB
AdyenDelegatedAuthentication.framework 82 KB
AdyenAuthentication.framework 347 KB
AdyenWeChatPay.framework 257 KB
AdyenCardScanner.framework 710 KB
AdyenEncryption.framework 517 KB
AdyenSession.framework 855 KB
AdyenTwint.framework 267 KB
AdyenWeChatPayInternal.framework 4135 KB
AdyenCashAppPay.framework 1771 KB
AdyenCard.framework 1691 KB
TwintSDK.framework 97 KB
Adyen3DS2.framework 923 KB
Adyen.framework 7565 KB
total 26084 KB

@erenbesel
Copy link
Contributor Author

/gemini review

@Adyen Adyen deleted a comment from gemini-code-assist bot Oct 10, 2025
@erenbesel erenbesel requested review from atmamont and nauaros October 10, 2025 13:22
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new sdkData field to PaymentComponentData to consolidate SDK-specific information, which is a great step towards improving performance and code clarity. The changes are well-implemented across the board, including deprecating old fields and refactoring to remove duplicated logic in DropInComponent. My review focuses on strengthening the tests to ensure they fully validate the new sdkData functionality. I've provided a few suggestions to make the tests more robust by verifying the contents of the encoded sdkData.

nauaros
nauaros previously approved these changes Oct 13, 2025
@atmamont
Copy link
Contributor

‼️ No analyzable targets detected

Comparing feature/COSDK-515_sdkData to develop

@erenbesel let's re-run this check?

@erenbesel erenbesel requested a review from nauaros October 13, 2025 14:17
atmamont
atmamont previously approved these changes Oct 14, 2025
@erenbesel erenbesel marked this pull request as draft October 22, 2025 08:58
}

/// An encoded string containing important SDK-specific data.
/// It is recommended to pass this field to your server to ensure maximum performance and reliability.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please disregard if it makes no sense, but I decided to bring this to your attention. Can we make this statement less vague and explain a bit more?
And the second part, a bit more bold just to stretch us - can we make it non-optional?

@github-actions
Copy link
Contributor

⚠️ 4 public changes detected ⚠️

Comparing feature/COSDK-515_sdkData to develop

❇️1 Addition
🔀3 Modifications

Adyen

PaymentComponentData

❇️ Added

public var sdkData: Swift.String?

🔀 Modified

// From
public let supportNativeRedirect: Swift.Bool { get }

// To
@available(*, deprecated, message: "This property is deprecated. Use the new sdkData property instead.")
public let supportNativeRedirect: Swift.Bool { get }

/**
Changes:
- Added attribute `@available(*, deprecated, message: "This property is deprecated. Use the new sdkData property instead.")`
*/
// From
public var checkoutAttemptId: Swift.String? { get }

// To
@available(*, deprecated, message: "This property is deprecated. Use the new sdkData property instead.")
public var checkoutAttemptId: Swift.String? { get }

/**
Changes:
- Added attribute `@available(*, deprecated, message: "This property is deprecated. Use the new sdkData property instead.")`
*/

AdyenCard

CardDetails

🔀 Modified

// From
public let threeDS2SDKVersion: Swift.String { get }

// To
@available(*, deprecated, message: "This property is deprecated. Use the new sdkData property of the PaymentComponentData object instead.")
public let threeDS2SDKVersion: Swift.String { get }

/**
Changes:
- Added attribute `@available(*, deprecated, message: "This property is deprecated. Use the new sdkData property of the PaymentComponentData object instead.")`
*/

Analyzed targets: Adyen, AdyenActions, AdyenCard, AdyenCardScanner, AdyenCashAppPay, AdyenComponents, AdyenDelegatedAuthentication, AdyenDropIn, AdyenEncryption, AdyenSession, AdyenSwiftUI, AdyenTwint, AdyenWeChatPay

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecated pull request that deprecates some API new a pull request that adds a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants