feat: add authorization_type and payment_plan to hosted, link and session payment requests#341
Open
armando-rodriguez-cko wants to merge 1 commit into
Open
feat: add authorization_type and payment_plan to hosted, link and session payment requests#341armando-rodriguez-cko wants to merge 1 commit into
armando-rodriguez-cko wants to merge 1 commit into
Conversation
…sion payment requests Adds the authorization_type (Final/Estimated) and payment_plan properties to HostedPaymentsSessionRequest, PaymentLinkRequest and PaymentSessionsRequest, matching the swagger additions to HostedPaymentsRequest, PaymentLinksRequest and CreatePaymentSessionsBaseRequest. payment_plan is typed as the existing Checkout\Payments\PaymentPlan, which already maps the PaymentSessionPaymentPlanRecurring schema; added the missing amount_variability field to it. Adds serialization tests for the new fields.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.




Summary
Adds two properties that swagger introduced to
HostedPaymentsRequest,PaymentLinksRequestandCreatePaymentSessionsBaseRequestbut were missing from the corresponding PHP request classes:authorization_type— string, allowed valuesFinal/Estimated(defaultFinal). Matches howPaymentRequestalready exposesauthorization_typeas a plain string property. (Note: the existingCheckout\AuthorizationTypeclass is for SDK auth modes, not payment authorization, so it is intentionally not reused.)payment_plan— typed as the existingCheckout\Payments\PaymentPlan, which already maps thePaymentSessionPaymentPlanRecurringschema. Added the one missing fieldamount_variability(Fixed/Variable) to that class.Applied to:
lib/Checkout/Payments/Hosted/HostedPaymentsSessionRequest.phplib/Checkout/Payments/Links/PaymentLinkRequest.phplib/Checkout/Payments/Sessions/PaymentSessionsRequest.phpPart of a cross-SDK sweep aligning request models with recent swagger additions.
Tests
Added
test/Checkout/Tests/Payments/PaymentRequestFieldsSerializationTest.phpcovering serialization of both new fields across all three request classes, plus omission of unset fields.PHP lint + phpcs pre-commit hook passed on all changed files.
Follow-up
None required for typing —
PaymentPlanwas a good fit and only neededamount_variabilityadded.