CalculationApiClient
CalculationApiClient provides raw access to calculation-related endpoints under /Calculation.
It is a final class that depends on EflHttpClient, which performs authenticated HTTP requests.
Class definition
- Namespace:
Imoli\EflLeasingSdk\Api - Constructor: accepts a single
EflHttpClient $httpdependency.
In typical code you call these endpoints indirectly via EflClient.
Methods
calculateBasicOffer
Low-level wrapper over POST /lon/api/v1/Calculation/CalculateBasicOffer.
public function calculateBasicOffer(
AssetToCalculation $basket,
string $bearerToken
): HttpResponse
Auth: Bearer token.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
basket | AssetToCalculation | Yes | Basket of assets to be used for the calculation. |
bearerToken | string | Yes | Bearer token for the authenticated request. |
The request body is built from AssetToCalculation::toRequestPayload(), and the transactionId query parameter is taken from that payload.
Return value
- Type:
HttpResponse– when used viaEflClient, the body is mapped toEsbCalculateBasicOfferRestReturn.
getBaseData
Low-level wrapper over GET /lon/api/v1/Calculation/GetBaseData.
public function getBaseData(string $transactionId, string $bearerToken): HttpResponse
Auth: Bearer token.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
transactionId | string | Yes | Identifier of the transaction. |
bearerToken | string | Yes | Bearer token. |
Return value
- Type:
HttpResponse– body can be mapped toCalculationData.
acceptCalculation
Low-level wrapper over POST /lon/api/v1/Calculation/AcceptCalculation.
public function acceptCalculation(
string $transactionId,
int $calculationId,
int $calculationVariantId,
?bool $basketCalculation,
string $bearerToken
): HttpResponse
Auth: Bearer token.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
transactionId | string | Yes | Identifier of the transaction. |
calculationId | int | Yes | Identifier of the calculation to be accepted. |
calculationVariantId | int | Yes | Identifier of the calculation variant to be accepted. |
basketCalculation | bool|null | No | Whether basket calculation is used; sent as "true" / "false". |
bearerToken | string | Yes | Bearer token. |
The request body is a JSON object with calculationId and calculationVariantId.
Return value
- Type:
HttpResponse– response without a strongly-typed model; use status and body for diagnostics.