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 diff --git a/src/Api/Ecommerce/PaymentRequest.php b/src/Api/Ecommerce/PaymentRequest.php index 77b4172..75849b5 100644 --- a/src/Api/Ecommerce/PaymentRequest.php +++ b/src/Api/Ecommerce/PaymentRequest.php @@ -271,6 +271,19 @@ 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 +313,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());