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 Iframe parameter to CreateInvoiceParams, enabling embedded (iframe) checkout on the v2 init endpoint. The GetPayIn init endpoint reads iframe from the request body (boolean; true/1 enables embedded checkout).

Like the existing payment_mode, iframe is unsigned — it is sent in the body but excluded from the HMAC signature. This is a small, mechanical change that mirrors the payment_mode handling exactly.

Changes

  • CreateInvoiceParams (src/Paylink/Types/Params.cs): add public bool? Iframe { get; set; } after PaymentMode.
  • Invoices.CreateAsync (src/Paylink/Resources/Invoices.cs): add { "iframe", parameters.Iframe } to the request body after payment_mode.
  • FieldOrders.InvoiceCreate (src/Paylink/Internal/FieldOrders.cs): register new FieldSpec("iframe", false) (unsigned) after payment_mode. Coerce.ToWire already maps true"1", false"0".
  • Tests (tests/Paylink.Tests/IframeUnsignedTests.cs): new SDK-local xUnit tests building the signed body via SignedBody.Build(...) directly (as the golden tests do), proving:
    • iframe = true → body "1", false"0"
    • omitted (null) → absent from body
    • presence of iframe does not change the signature vs. a request without it
  • Docs / version: README quick-start note, CHANGELOG.md ## [0.2.0] section, and <Version> bump 0.1.00.2.0.

The shared golden-signatures.json vectors are untouched; the existing golden-signature test continues to prove iframe stays out of the signature.

Verification

The .NET SDK/toolchain (dotnet) is not installed in the working environment, so dotnet test could not be run here. The change is therefore unverified by a local build/test run. CI (or a machine with the SDK) should run dotnet test to confirm all tests pass; the golden-signature test passing proves iframe stays unsigned.

Add an optional `Iframe` parameter to CreateInvoiceParams. It is sent in
the invoice-create request body but excluded from the HMAC signature,
mirroring the existing unsigned `payment_mode` field.

- Params: add `bool? Iframe` to CreateInvoiceParams
- Invoices.CreateAsync: send `iframe` in the request body
- FieldOrders.InvoiceCreate: register `iframe` as an unsigned field
- Add SDK-local tests proving iframe -> body "1"/"0", omitted when null,
  and does not change the signature
- README quick-start note, CHANGELOG 0.2.0, version bump 0.1.0 -> 0.2.0
@MHJaafar9869
MHJaafar9869 merged commit 19829f6 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