Skip to content

feat: optional iframe param on invoices->create (embedded checkout) - #1

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

feat: optional iframe param on invoices->create (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 field to the GetPayIn v2 init endpoint request, mirroring the existing unsigned payment_mode field. Passing 'iframe' => true to invoices->create enables embedded (iframe) checkout.

Like payment_mode, iframe is unsigned: it is sent in the request body but excluded from the HMAC signature. Coerce::toString already stringifies bool true -> '1' / false -> '0', so no other code change was needed.

Changes

  • src/Core/Internal/FieldOrders.php — register new FieldSpec('iframe', 'iframe', signed: false) in invoiceCreate(), after payment_mode.
  • tests/SignRequestTest.php — new unit test asserting iframe lands 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 ### Added note.
  • src/Core/Version.php — bump 0.1.0 -> 0.2.0.

No shared golden vectors were modified.

Verification

  • ./vendor/bin/pest91 passed (201 assertions), including the golden-signature suite (proving iframe did not leak into the signature) and the new iframe test.
  • php -l clean on all edited PHP files.
  • phpstan and pint --test clean on the changed files.

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
@MHJaafar9869
MHJaafar9869 merged commit 90bc252 into main Aug 6, 2026
4 checks 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