feat: optional iframe init option for embedded checkout - #1
Merged
Conversation
Add an optional, unsigned iframe field to CreateInvoiceParams, mirroring
the existing payment_mode field: it is sent in the v2 init request body
(coerced Boolean true->"1", false->"0") but excluded from the HMAC
signature.
- CreateInvoiceParams.iframe(Boolean) builder method
- FieldOrders.INVOICE_CREATE registers FieldSpec.unsigned("iframe")
- IframeOptionTest proves iframe appears in the body yet does not change
the signature (stays unsigned)
- README embedded-checkout note, CHANGELOG 0.2.0, version bump 0.1.0->0.2.0
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 an optional, unsigned
iframefield to the checkout init request, mirroring the existingpayment_modefield. Whentrue(server reads it as boolean; true/1), it enables the embedded/iframe checkout experience. Only thepaylink-coremodule is changed; the Spring Boot starter inherits automatically.Like
payment_mode,iframeis sent in the v2 init request body but excluded from the HMAC signature.Changes
CreateInvoiceParams.iframe(Boolean)builder method (afterpaymentMode(...)).FieldOrders.INVOICE_CREATEregistersFieldSpec.unsigned("iframe")afterpayment_mode.Coerce.toWirealready maps Booleantrue->"1",false->"0".IframeOptionTest(JUnit 5): proves.iframe(true)yields"iframe"="1"(andfalse->"0") in the body built bySignedBody.build(...), and that the signature is identical to an otherwise-identical params object withoutiframe— proving the field is unsigned.## [0.2.0]section.0.1.0->0.2.0across the root pom, both module parent references, the starter'spaylink-coredependency, and README install snippets.The shared
golden-signatures.jsonfixture is intentionally not modified; the existing golden-signature parity tests continue to pass, which independently confirmsiframedoes not affect the signature.Verification
Maven is not installed in this environment, so tests were run by compiling
paylink-core(main + test) against Gson and JUnit 5 and executing them via the JUnit Platform Launcher.All 30 core tests pass, including the golden-signature parity suite and the 3 new
IframeOptionTestcases.