feat: optional iframe init option for embedded checkout - #1
Merged
Conversation
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
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
Iframeparameter toCreateInvoiceParams, enabling embedded (iframe) checkout on the v2 init endpoint. The GetPayIn init endpoint readsiframefrom the request body (boolean;true/1enables embedded checkout).Like the existing
payment_mode,iframeis unsigned — it is sent in the body but excluded from the HMAC signature. This is a small, mechanical change that mirrors thepayment_modehandling exactly.Changes
CreateInvoiceParams(src/Paylink/Types/Params.cs): addpublic bool? Iframe { get; set; }afterPaymentMode.Invoices.CreateAsync(src/Paylink/Resources/Invoices.cs): add{ "iframe", parameters.Iframe }to the request body afterpayment_mode.FieldOrders.InvoiceCreate(src/Paylink/Internal/FieldOrders.cs): registernew FieldSpec("iframe", false)(unsigned) afterpayment_mode.Coerce.ToWirealready mapstrue→"1",false→"0".tests/Paylink.Tests/IframeUnsignedTests.cs): new SDK-local xUnit tests building the signed body viaSignedBody.Build(...)directly (as the golden tests do), proving:iframe = true→ body"1",false→"0"null) → absent from bodyiframedoes not change the signature vs. a request without itCHANGELOG.md## [0.2.0]section, and<Version>bump0.1.0→0.2.0.The shared
golden-signatures.jsonvectors are untouched; the existing golden-signature test continues to proveiframestays out of the signature.Verification
The .NET SDK/toolchain (
dotnet) is not installed in the working environment, sodotnet testcould not be run here. The change is therefore unverified by a local build/test run. CI (or a machine with the SDK) should rundotnet testto confirm all tests pass; the golden-signature test passing proves iframe stays unsigned.