From de9e18da86d0767c6676c0964bdcb37ad6f11522 Mon Sep 17 00:00:00 2001 From: Jaafar Date: Thu, 6 Aug 2026 13:11:36 +0300 Subject: [PATCH] feat: optional iframe init option for embedded checkout 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 --- CHANGELOG.md | 8 +++ README.md | 19 +++++-- paylink-core/pom.xml | 2 +- .../paylink/internal/FieldOrders.java | 6 ++- .../paylink/model/CreateInvoiceParams.java | 5 ++ .../getpayin/paylink/IframeOptionTest.java | 53 +++++++++++++++++++ paylink-spring-boot-starter/pom.xml | 4 +- pom.xml | 2 +- 8 files changed, 89 insertions(+), 10 deletions(-) create mode 100644 paylink-core/src/test/java/com/getpayin/paylink/IframeOptionTest.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 2623f3f..301ed5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.2.0] + +### Added + +- Optional `iframe` builder on `CreateInvoiceParams` (`.iframe(true)`) for embedded + checkout. Like `payment_mode`, it is sent in the request body but excluded from the + HMAC signature. + ## [0.1.0] ### Added diff --git a/README.md b/README.md index ed9ea4c..6d94ad9 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Ships a **Spring Boot starter** for one-line dependency injection. com.getpayin.paylink paylink-core - 0.1.0 + 0.2.0 ``` @@ -43,16 +43,16 @@ Spring Boot apps — use the starter instead (it pulls in the core): com.getpayin.paylink paylink-spring-boot-starter - 0.1.0 + 0.2.0 ``` **Gradle**: ```groovy -implementation 'com.getpayin.paylink:paylink-core:0.1.0' +implementation 'com.getpayin.paylink:paylink-core:0.2.0' // or, for Spring Boot: -implementation 'com.getpayin.paylink:paylink-spring-boot-starter:0.1.0' +implementation 'com.getpayin.paylink:paylink-spring-boot-starter:0.2.0' ``` ## Quick start @@ -78,6 +78,17 @@ CreateInvoiceResult checkout = paylink.invoices().create( response.sendRedirect(checkout.checkoutUrl()); ``` +For an **embedded checkout**, pass `.iframe(true)` and render `checkout.checkoutUrl()` +inside an `