Refactor payment-related properties and add new enum value for consent collection #508
+14
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



This pull request introduces several updates to the payments SDK, including improvements to type safety, consistency in naming, and support for new payment features. The main changes include updating the currency property to use a strongly-typed
Currencyenum, renaming card source properties for consistency, and adding new enum values to support additional payment scenarios. Relevant tests and serialization logic have also been updated to reflect these changes.Type and Property Updates:
Currencyproperty inRequestAPaymentOrPayoutResponseCreatedto use the strongly-typedCurrencyenum instead of a string, improving type safety and consistency throughout the codebase.LastFourproperty toLast4in theCardSourceclass and updated all related tests and serialization logic to use the new property name for consistency with industry standards. [1] [2] [3] [4]Enum Extensions:
PayLatervalue to thePaymentTypeenum, enabling support for "Pay Later" payment options.CollectConsentvalue to theStorePaymentDetailsTypeenum, allowing the SDK to handle scenarios where user consent for storing payment details must be collected.Refactoring and Test Updates:
PaymentsClientby renamingRequestASessionResponseMappingstoResponseMappingsand updated usage throughout the client for clarity and maintainability. [1] [2]Currencyenum andLast4property, ensuring tests align with the latest model changes. [1] [2]These changes collectively improve the SDK's robustness, maintainability, and readiness for new payment features.