Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions docs/ecommerce/payment_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 15 additions & 1 deletion src/Api/Ecommerce/PaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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());
Expand Down