Repository navigation
Commit e602d39
authored
Release 7.16.1 (#656)
This release fixes a defect in the payment sessions default values, refactors and clarifies the structure of payment session request classes, separating fields that are specific to session creation from those shared by all requests. It introduces a new base class, `PaymentSessionCreateBase`, to hold fields relevant only to session creation endpoints, and moves or removes several fields from other classes for better organization and alignment with API behavior. The changes also improve documentation and clarify which fields are required or optional in each context.
**Class hierarchy and structure refactoring:**
* Introduced a new abstract base class, `PaymentSessionCreateBase`, which contains fields that are only accepted when creating a payment session (e.g., `capture`, `paymentType`, `locale`, `authorizationType`, `description`, `displayName`, `paymentPlan`, `risk`). This class is now the parent for both `PaymentSessionCreateRequest` and `PaymentSessionCompleteRequest`, ensuring these fields are only present where appropriate.
* Updated `PaymentSessionInfo` to remove fields that are now in `PaymentSessionCreateBase`, and clarified its role as holding only fields shared by all payment session requests. Improved class-level documentation to reflect this separation. [[1]](diffhunk://#diff-0fe60fb620a42c06b6064c12ab6cd10f92e5516a58d63288966dd90b4e78fccbL28-R28) [[2]](diffhunk://#diff-0fe60fb620a42c06b6064c12ab6cd10f92e5516a58d63288966dd90b4e78fccbL72-L77) [[3]](diffhunk://#diff-0fe60fb620a42c06b6064c12ab6cd10f92e5516a58d63288966dd90b4e78fccbR112-L132) [[4]](diffhunk://#diff-0fe60fb620a42c06b6064c12ab6cd10f92e5516a58d63288966dd90b4e78fccbL145-L172)
**Request class adjustments:**
* Changed `PaymentSessionCreateRequest` and `PaymentSessionCompleteRequest` to extend the new `PaymentSessionCreateBase` instead of `PaymentSessionInfo`, and removed duplicated fields now inherited from the new base class. [[1]](diffhunk://#diff-61ad0790471bea4c725dff7d4b0de0689a14e39b3392dc1a78c7726ac98bf1c6L25-R23) [[2]](diffhunk://#diff-ab9930e4f1af6784ab8b2cfd54239645847ac508ecbf7f5b24e32a9959f0fa10L19-R23)
* Updated `PaymentSessionSubmitRequest` to allow optional overriding of `capture` and `paymentType`, with clear documentation that leaving these fields unset preserves the values from session creation (or defaults). Also clarified that only `sessionData` is required. [[1]](diffhunk://#diff-462798be46d92649c7cbfaa6437a1d0ed387622126e158f4595f4294dbe13ed6R16-R19) [[2]](diffhunk://#diff-462798be46d92649c7cbfaa6437a1d0ed387622126e158f4595f4294dbe13ed6L27-R52)
**Documentation and code cleanup:**
* Improved and clarified Javadoc comments throughout the affected classes, specifying field requirements, default behaviors, and the intended use of each class. [[1]](diffhunk://#diff-d6f5d99bd176e3903e7ee1341a57935dfcf6fca892a9b19525d02442336b09b7R1-R89) [[2]](diffhunk://#diff-0fe60fb620a42c06b6064c12ab6cd10f92e5516a58d63288966dd90b4e78fccbL28-R28) [[3]](diffhunk://#diff-462798be46d92649c7cbfaa6437a1d0ed387622126e158f4595f4294dbe13ed6R16-R19)
* Removed unused imports and redundant annotations from affected files for code clarity. [[1]](diffhunk://#diff-78db8b59f0dbc7931b0e84c4d2093728a855b4ed9f7bb363625d260753c0ddb7L4-L9) [[2]](diffhunk://#diff-ab9930e4f1af6784ab8b2cfd54239645847ac508ecbf7f5b24e32a9959f0fa10L3-L5) [[3]](diffhunk://#diff-61ad0790471bea4c725dff7d4b0de0689a14e39b3392dc1a78c7726ac98bf1c6L6-L8) [[4]](diffhunk://#diff-0fe60fb620a42c06b6064c12ab6cd10f92e5516a58d63288966dd90b4e78fccbL5-L17)
**Test updates:**
* Updated a test in `FlowLocaleAndStatusDeserializationTest` to reflect the refactored request structure, ensuring correct serialization after the changes.1 parent 9e60cf3 commit e602d39
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
0 commit comments