Skip to content

Conversation

MarijusDilys
Copy link
Collaborator

@MarijusDilys MarijusDilys commented Jun 23, 2025

Questions Answers
Branch? Master/Release
Description? Seperated Line.php into OrderLine and PaymentLine for compatibility issues, after fully transform to Payments API, OrderLine DTO will be removed. All payments methods working except "Vouchers" in Payments API, all data is being sent correctly. Removed payments methods for restrictions only for Orders API, now all payments methods can be used for both
Type? bug fix / improvement / new feature / refactoring
How to test? Indicate how to verify that this change works as expected.
Fixed issue ? If none leave blank

@@ -86,7 +86,8 @@ public function testGetCartLines(
$shippingCost,
$cartItems,
$psGiftWrapping,
$selectedVoucherCategory
$selectedVoucherCategory,
'OrderLine'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen these 'hardcoded' values n multiple files, I suggest to move them into the constants

*
* @return array
*/
private function convertToLineArray(array $newItems, $currencyIsoCode, $apiRoundingPrecision)
private function convertToLineArray(array $newItems, $currencyIsoCode, $apiRoundingPrecision, $lineType)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private function convertToLineArray(array $newItems, $currencyIsoCode, $apiRoundingPrecision, $lineType)
private function convertToLineArray(array $newItems, string $currencyIsoCode, int $apiRoundingPrecision, string $lineType): array

exit;
}

class PaymentLine implements JsonSerializable
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameters and return types

@@ -360,14 +375,67 @@ public function setEmail($email)
$this->email = $email;
}

public function jsonSerialize()
/**
* @return PaymentLine[]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parameters and return types


switch ($lineType) {
case 'OrderLine':
$line->setName($item['name'] ?: $item['sku']);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$item['name'] make sure that you have correct product name by cart language

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That products are retrieved by $cart->getProducts()

MarijusDilys and others added 25 commits September 15, 2025 09:23
…PrestaShop into PIPRES-600/multiple-vouchers
…PrestaShop into PIPRES-600/multiple-vouchers
…PrestaShop into PIPRES-600/multiple-vouchers
…ollie/PrestaShop into PIPRES-539/captures-api
…PrestaShop into PIPRES-600/multiple-vouchers
@MarijusDilys MarijusDilys changed the base branch from develop to PIPRES-645/backoffice-redesign-main September 17, 2025 11:40
@MarijusDilys MarijusDilys merged commit a7253a5 into PIPRES-645/backoffice-redesign-main Sep 17, 2025
5 checks passed
@MarijusDilys MarijusDilys deleted the PIPRES-539/add-line-items-payments-api branch September 17, 2025 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants