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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ 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.4.9] - 2025-04-22
### Added
- Provide `setCustomerCreatedDate` method to set `extra_merchant_data` for the `createPaymentRequest` callback config.
- Include `AuthorisationExpiryDate` in `Transaction` class.

## [3.4.8] - 2025-03-13
### Added
- Provide `setClientJavaEnabled` and `setClientColorDepth` methods to set `customer_info[client_java_enabled]` and `customer_info[client_color_depth]` for the customer object.
Expand Down
11 changes: 10 additions & 1 deletion docs/ecommerce/payment_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Because this call does not happen in the browser, you do not need to worry about
* [Example](#example)
+ [Optional](#optional)
* [Optional parameters for invoice payments](#optional-parameters-for-invoice-payments)
* [Extra merchant data](#extra-merchant-data)
+ [Required on specific payments](#required-on-specific-payments)
* [Mandatory parameters if MCC is 6012](#mandatory-parameters-if-mcc-is-6012)
* [Mandatory parameters for invoice payments](#mandatory-parameters-for-invoice-payments)
Expand Down Expand Up @@ -73,8 +74,10 @@ $request->setCurrency('SEK');
| setCookie(string) | Additionally a cookie parameter can be sent to createPaymentRequest, which is then passed back as the complete cookie for the callbacks.<br />For example, if the cookie parameter is set to: "PHPSESSID=asdfasdfdf23; mycookie=mycookievalue", the Cookie header in the callback to your page will be:<br />Cookie: PHPSESSID=asdfasdfdf23; mycookie=mycookievalue | string
| setPaymentSource(string) | The source of the payment. Default is "eCommerce" | string - [See Payment sources](../types/paymentsources.md)
| setCustomerInfo(Customer) | Customer info | Customer object [See customer info](../request/customerinfo.md) |
| setCustomerCreatedDate(Date) | This is the date when the customer account was first created in your shopping system. Fraud detection services use this parameter in the fraud detection calculations. | Date (yyyy-mm-dd)
| setConfig(Config) | used to overwrite the terminal settings | Config object [See config](../request/config.md)
| orderLines(array or OrderLine) | Order lines | array of OrderLine objects - [See OrderLine](../request/orderline.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

##### Optional parameters for invoice payments

Expand All @@ -83,6 +86,12 @@ $request->setCurrency('SEK');
| setOrganisationNumber(string) | If the organisation_number parameter is given the organisation number field in the invoice payment form is pre-populated, and if no other payment options is enabled on the terminal the form will auto submit. | string
| setAccountOffer(string) | To require having account enabled for an invoice payment for this specific customer, set this to required. To disable account for this specific customer, set to disabled. | string

##### Extra merchant data

| Method | Description | Type |
|---|---|---|
| setExtraMerchantData(JSON) | Additional merchant provided information that will be passed to Klarna. Field has to be sent as JSON object specified in [Klarna docs](https://docs.klarna.com/api/extra-merchant-data/)| JSON ([Schema](https://docs.klarna.com/api/extra-merchant-data.json))

### Required on specific payments

##### Mandatory parameters if MCC is 6012
Expand Down
1 change: 1 addition & 0 deletions docs/types/transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
| `$object->UpdatedDate` | | DateTime
| `$object->PaymentNature` | | string
| `$object->PaymentSchemeName` | | string
| `$object->AuthorisationExpiryDate` | | DateTime
| `$object->PaymentSource` | | string
| `$object->PaymentNatureService` | array of `\Altapay\Response\Embeds\PaymentNatureService` objects | array
| `$object->FraudRiskScore` | | float
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ abstract class AbstractApi
/**
* PHP API version
*/
const PHP_API_VERSION = '3.4.8';
const PHP_API_VERSION = '3.4.9';

/**
* Event dispatcher
Expand Down
17 changes: 16 additions & 1 deletion src/Api/Ecommerce/PaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,20 @@ public function setCustomerCreatedDate($customerCreatedDate)
return $this;
}

/**
* Additional merchant provided information that will be passed to Klarna.
*
* @param string $extraMerchantData // JSON-encoded string
*
* @return $this
*/
public function setExtraMerchantData($extraMerchantData)
{
$this->unresolvedOptions['extra_merchant_data'] = $extraMerchantData;

return $this;
}

/**
* Configure options
*
Expand Down Expand Up @@ -285,7 +299,8 @@ protected function configureOptions(OptionsResolver $resolver)
'shipping_method',
'organisation_number',
'account_offer',
'orderLines'
'orderLines',
'extra_merchant_data'
]);

$resolver->setAllowedValues('language', Types\LanguageTypes::getAllowed());
Expand Down
5 changes: 5 additions & 0 deletions src/Response/Embeds/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,11 @@ class Transaction extends AbstractResponse
*/
public $AuthenticationResult;

/**
* @var DateTime
*/
public $AuthorisationExpiryDate;

/**
* @param string $IsTokenized
*
Expand Down