Skip to content

Commit 6fd4457

Browse files
authored
Merge pull request #61 from AltaPay/set-formtemplate-createpaymentrequest
Provide setFormTemplate method to set form_template for the createPaymentRequest
2 parents a9b2ac8 + 9c27cd5 commit 6fd4457

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [3.5.4] - 2025-09-12
8+
### Added
9+
- Provide `setFormTemplate` method to set `form_template` for the `createPaymentRequest`.
10+
711
## [3.5.3] - 2025-08-12
812
### Added
913
- Rename `AuthenticationResult` property to `Authentication` in `Transaction` class.

docs/ecommerce/payment_request.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ $request->setCurrency('SEK');
7878
| setConfig(Config) | used to overwrite the terminal settings | Config object [See config](../request/config.md)
7979
| setOrderLines(array) | Order lines | array of OrderLine objects - [See OrderLine](../request/orderline.md)
8080
| setAgreement(array) | This parameters should be provided only in case the type parameter is subscription, subscriptionAndCharge or subscriptionAndReserve | array
81+
| 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 |
8182

8283
##### Optional parameters for invoice payments
8384

src/Api/Ecommerce/PaymentRequest.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,19 @@ public function setExtraMerchantData($extraMerchantData)
271271
return $this;
272272
}
273273

274+
/**
275+
* Set the form_template to the Payment Request.
276+
*
277+
* @param string $formTemplate
278+
*
279+
* @return $this
280+
*/
281+
public function setFormTemplate($formTemplate)
282+
{
283+
$this->unresolvedOptions['form_template'] = $formTemplate;
284+
return $this;
285+
}
286+
274287
/**
275288
* Configure options
276289
*
@@ -300,7 +313,8 @@ protected function configureOptions(OptionsResolver $resolver)
300313
'organisation_number',
301314
'account_offer',
302315
'orderLines',
303-
'extra_merchant_data'
316+
'extra_merchant_data',
317+
'form_template'
304318
]);
305319

306320
$resolver->setAllowedValues('language', Types\LanguageTypes::getAllowed());

0 commit comments

Comments
 (0)