feat: optional iframe param on invoices->create (embedded checkout) - #1
Merged
Conversation
Adds an optional `iframe` field to the v2 init request. Passing `'iframe' => true` enables embedded (iframe) checkout. Like `payment_mode`, the field is sent in the request body but excluded from the HMAC signature (unsigned). - Register `iframe` FieldSpec (signed: false) in invoiceCreate() - Add unit test proving it lands in the body but not the signature - Document the param in the README quick start - Bump version 0.1.0 -> 0.2.0 and add CHANGELOG entry
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
iframefield to the GetPayIn v2 init endpoint request, mirroring the existing unsignedpayment_modefield. Passing'iframe' => truetoinvoices->createenables embedded (iframe) checkout.Like
payment_mode,iframeis unsigned: it is sent in the request body but excluded from the HMAC signature.Coerce::toStringalready stringifies booltrue->'1'/false->'0', so no other code change was needed.Changes
src/Core/Internal/FieldOrders.php— registernew FieldSpec('iframe', 'iframe', signed: false)ininvoiceCreate(), afterpayment_mode.tests/SignRequestTest.php— new unit test assertingiframelands in the body as'1'while the signature is byte-identical to a request without it (proving it is unsigned).README.md— quick-start note/example showing'iframe' => true.CHANGELOG.md— new## [0.2.0]section with an### Addednote.src/Core/Version.php— bump0.1.0->0.2.0.No shared golden vectors were modified.
Verification
./vendor/bin/pest— 91 passed (201 assertions), including the golden-signature suite (provingiframedid not leak into the signature) and the new iframe test.php -lclean on all edited PHP files.phpstanandpint --testclean on the changed files.