Skip to content

feat: optional iframe init option for embedded checkout - #1

Merged
MHJaafar9869 merged 1 commit into
mainfrom
feat/iframe-init-option
Aug 6, 2026
Merged

feat: optional iframe init option for embedded checkout#1
MHJaafar9869 merged 1 commit into
mainfrom
feat/iframe-init-option

Conversation

@MHJaafar9869

Copy link
Copy Markdown
Collaborator

Summary

Adds an optional, unsigned iframe field to the checkout init request, mirroring the existing payment_mode field. When true (server reads it as boolean; true/1), it enables the embedded/iframe checkout experience. Only the paylink-core module is changed; the Spring Boot starter inherits automatically.

Like payment_mode, iframe is sent in the v2 init request body but excluded from the HMAC signature.

Changes

  • CreateInvoiceParams.iframe(Boolean) builder method (after paymentMode(...)).
  • FieldOrders.INVOICE_CREATE registers FieldSpec.unsigned("iframe") after payment_mode. Coerce.toWire already maps Boolean true->"1", false->"0".
  • IframeOptionTest (JUnit 5): proves .iframe(true) yields "iframe"="1" (and false->"0") in the body built by SignedBody.build(...), and that the signature is identical to an otherwise-identical params object without iframe — proving the field is unsigned.
  • README: embedded-checkout note/example under the quick start.
  • CHANGELOG: new ## [0.2.0] section.
  • Version bump 0.1.0 -> 0.2.0 across the root pom, both module parent references, the starter's paylink-core dependency, and README install snippets.

The shared golden-signatures.json fixture is intentionally not modified; the existing golden-signature parity tests continue to pass, which independently confirms iframe does 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.

[ 30 tests found      ]
[ 30 tests successful ]
[  0 tests failed     ]

All 30 core tests pass, including the golden-signature parity suite and the 3 new IframeOptionTest cases.

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
@MHJaafar9869
MHJaafar9869 merged commit 45bb678 into main Aug 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant