From b378efa39152159c39621ad38fcd64e603a7a181 Mon Sep 17 00:00:00 2001 From: Bushra Asif Date: Fri, 12 Sep 2025 13:08:38 +0000 Subject: [PATCH 1/3] Provide setFormTemplate method to set form_template for the createPaymentRequest --- src/Api/Ecommerce/PaymentRequest.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Api/Ecommerce/PaymentRequest.php b/src/Api/Ecommerce/PaymentRequest.php index 77b4172..15ad42a 100644 --- a/src/Api/Ecommerce/PaymentRequest.php +++ b/src/Api/Ecommerce/PaymentRequest.php @@ -271,6 +271,20 @@ public function setExtraMerchantData($extraMerchantData) return $this; } + /** + * Set the form_template to the Payment Request. + * + * @param string $formTemplate + * + * @return $this + */ + public function setFormTemplate($formTemplate) + { + $this->unresolvedOptions['form_template'] = $formTemplate; + + return $this; + } + /** * Configure options * @@ -300,7 +314,8 @@ protected function configureOptions(OptionsResolver $resolver) 'organisation_number', 'account_offer', 'orderLines', - 'extra_merchant_data' + 'extra_merchant_data', + 'form_template' ]); $resolver->setAllowedValues('language', Types\LanguageTypes::getAllowed()); From 77bcbd0a7ce1b841f0a1d07124a5037d7c28d803 Mon Sep 17 00:00:00 2001 From: Bushra Asif Date: Fri, 12 Sep 2025 13:10:08 +0000 Subject: [PATCH 2/3] Update docs and release notes --- CHANGELOG.md | 4 ++++ docs/ecommerce/payment_request.md | 1 + 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c8abad..c3cd6bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.5.4] - 2025-09-12 +### Added +- Provide `setFormTemplate` method to set `form_template` for the `createPaymentRequest`. + ## [3.5.3] - 2025-08-12 ### Added - Rename `AuthenticationResult` property to `Authentication` in `Transaction` class. diff --git a/docs/ecommerce/payment_request.md b/docs/ecommerce/payment_request.md index c775d2a..421ce42 100644 --- a/docs/ecommerce/payment_request.md +++ b/docs/ecommerce/payment_request.md @@ -78,6 +78,7 @@ $request->setCurrency('SEK'); | setConfig(Config) | used to overwrite the terminal settings | Config object [See config](../request/config.md) | setOrderLines(array) | Order lines | array of OrderLine objects - [See OrderLine](../request/orderline.md) | setAgreement(array) | This parameters should be provided only in case the type parameter is subscription, subscriptionAndCharge or subscriptionAndReserve | array +| setFormTemplate(string) | If you wish to force a specific template for the credit card form. Possible values include form_checkout_div, form_checkout, form_checkout_standalone, form_dynamic_div, etc. If not specified, the template configured for the terminal will be used. See the gateway documentation for the complete list. | string | ##### Optional parameters for invoice payments From 9c27cd5396d85b53e8093bbe15127d384ba23cf1 Mon Sep 17 00:00:00 2001 From: Bushra Asif Date: Fri, 12 Sep 2025 13:15:10 +0000 Subject: [PATCH 3/3] Fix php-cs-fixer warning --- src/Api/Ecommerce/PaymentRequest.php | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Api/Ecommerce/PaymentRequest.php b/src/Api/Ecommerce/PaymentRequest.php index 15ad42a..75849b5 100644 --- a/src/Api/Ecommerce/PaymentRequest.php +++ b/src/Api/Ecommerce/PaymentRequest.php @@ -271,19 +271,18 @@ public function setExtraMerchantData($extraMerchantData) return $this; } - /** - * Set the form_template to the Payment Request. - * - * @param string $formTemplate - * - * @return $this - */ - public function setFormTemplate($formTemplate) - { - $this->unresolvedOptions['form_template'] = $formTemplate; - + /** + * Set the form_template to the Payment Request. + * + * @param string $formTemplate + * + * @return $this + */ + public function setFormTemplate($formTemplate) + { + $this->unresolvedOptions['form_template'] = $formTemplate; return $this; - } + } /** * Configure options