-
Notifications
You must be signed in to change notification settings - Fork 45
PIPRES-539 add line items payments api #1133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PIPRES-539 add line items payments api #1133
Conversation
@@ -86,7 +86,8 @@ public function testGetCartLines( | |||
$shippingCost, | |||
$cartItems, | |||
$psGiftWrapping, | |||
$selectedVoucherCategory | |||
$selectedVoucherCategory, | |||
'OrderLine' |
There was a problem hiding this comment.
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
src/Service/CartLinesService.php
Outdated
* | ||
* @return array | ||
*/ | ||
private function convertToLineArray(array $newItems, $currencyIsoCode, $apiRoundingPrecision) | ||
private function convertToLineArray(array $newItems, $currencyIsoCode, $apiRoundingPrecision, $lineType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
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[] |
There was a problem hiding this comment.
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']); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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()
…PrestaShop into PIPRES-600/multiple-vouchers
…PrestaShop into PIPRES-600/multiple-vouchers
…PrestaShop into PIPRES-600/multiple-vouchers
…9/add-line-items-payments-api
…ollie/PrestaShop into PIPRES-539/captures-api
…p into PIPRES-601/react-removal
…op into PIPRES-601/redesign-admin-orders
…PrestaShop into PIPRES-600/multiple-vouchers
PIPRES-600 multiple vouchers
PIPRES-601 Re-design Mollie Admin Orders
PIPRES-601 React removal
PIPRES-539 captures api
a7253a5
into
PIPRES-645/backoffice-redesign-main
Line.php
intoOrderLine
andPaymentLine
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