@frontastic/common 2.30.1 → 2.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/composer.json +1 -1
- package/docs/README.md +2 -0
- package/docs/php/CartApiBundle/Domain/Cart.md +0 -5
- package/docs/php/CartApiBundle/Domain/CartApi/Commercetools.md +2 -0
- package/docs/php/CartApiBundle/Domain/CartCheckoutService.md +68 -0
- package/docs/php/CartApiBundle/Domain/DefaultCartApiFactory.md +2 -0
- package/docs/php/CartApiBundle/Domain/DefaultCartCheckoutService.md +77 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/composer.json
CHANGED
package/docs/README.md
CHANGED
|
@@ -67,7 +67,9 @@ Here you find the API documentation for the relevant classes:
|
|
|
67
67
|
* [LifecycleEventDecorator](php/CartApiBundle/Domain/CartApi/LifecycleEventDecorator.md)
|
|
68
68
|
* [CartApiBase](php/CartApiBundle/Domain/CartApiBase.md)
|
|
69
69
|
* [CartApiFactory](php/CartApiBundle/Domain/CartApiFactory.md)
|
|
70
|
+
* [CartCheckoutService](php/CartApiBundle/Domain/CartCheckoutService.md)
|
|
70
71
|
* [DefaultCartApiFactory](php/CartApiBundle/Domain/DefaultCartApiFactory.md)
|
|
72
|
+
* [DefaultCartCheckoutService](php/CartApiBundle/Domain/DefaultCartCheckoutService.md)
|
|
71
73
|
* [Discount](php/CartApiBundle/Domain/Discount.md)
|
|
72
74
|
* [DummyCartApiFactory](php/CartApiBundle/Domain/DummyCartApiFactory.md)
|
|
73
75
|
* [LineItem](php/CartApiBundle/Domain/LineItem.md)
|
|
@@ -88,11 +88,6 @@ Return Value: `bool`
|
|
|
88
88
|
public function isReadyForCheckout(): bool
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
*Some commerce backends might consider a cart ready without payment(s).*
|
|
92
|
-
|
|
93
|
-
This method will return true if there are no payments or if all payments
|
|
94
|
-
had paid status and the total amounts are equal to cart total amount.
|
|
95
|
-
|
|
96
91
|
Return Value: `bool`
|
|
97
92
|
|
|
98
93
|
### isComplete()
|
|
@@ -25,6 +25,7 @@ public function __construct(
|
|
|
25
25
|
Commercetools\Mapper $cartMapper,
|
|
26
26
|
Commercetools\Locale\CommercetoolsLocaleCreator $localeCreator,
|
|
27
27
|
OrderIdGeneratorV2 $orderIdGenerator,
|
|
28
|
+
CartCheckoutService $cartCheckoutService,
|
|
28
29
|
\Psr\Log\LoggerInterface $logger,
|
|
29
30
|
?Commercetools\Options $options = null
|
|
30
31
|
): mixed
|
|
@@ -36,6 +37,7 @@ Argument|Type|Default|Description
|
|
|
36
37
|
`$cartMapper`|[`Commercetools`](Commercetools.md)\Mapper||
|
|
37
38
|
`$localeCreator`|[`Commercetools`](../../../ProductApiBundle/Domain/ProductApi/Commercetools.md)\Locale\CommercetoolsLocaleCreator||
|
|
38
39
|
`$orderIdGenerator`|[`OrderIdGeneratorV2`](../OrderIdGeneratorV2.md)||
|
|
40
|
+
`$cartCheckoutService`|[`CartCheckoutService`](../CartCheckoutService.md)||
|
|
39
41
|
`$logger`|`\Psr\Log\LoggerInterface`||
|
|
40
42
|
`$options`|?[`Commercetools`](Commercetools.md)\Options|`null`|
|
|
41
43
|
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# `interface` CartCheckoutService
|
|
2
|
+
|
|
3
|
+
**Fully Qualified**: [`\Frontastic\Common\CartApiBundle\Domain\CartCheckoutService`](../../../../src/php/CartApiBundle/Domain/CartCheckoutService.php)
|
|
4
|
+
|
|
5
|
+
## Methods
|
|
6
|
+
|
|
7
|
+
* [getPayedAmount()](#getpayedamount)
|
|
8
|
+
* [hasCompletePayments()](#hascompletepayments)
|
|
9
|
+
* [isPaymentCompleted()](#ispaymentcompleted)
|
|
10
|
+
* [isReadyForCheckout()](#isreadyforcheckout)
|
|
11
|
+
|
|
12
|
+
### getPayedAmount()
|
|
13
|
+
|
|
14
|
+
```php
|
|
15
|
+
public function getPayedAmount(
|
|
16
|
+
Cart $cart
|
|
17
|
+
): int
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Argument|Type|Default|Description
|
|
21
|
+
--------|----|-------|-----------
|
|
22
|
+
`$cart`|[`Cart`](Cart.md)||
|
|
23
|
+
|
|
24
|
+
Return Value: `int`
|
|
25
|
+
|
|
26
|
+
### hasCompletePayments()
|
|
27
|
+
|
|
28
|
+
```php
|
|
29
|
+
public function hasCompletePayments(
|
|
30
|
+
Cart $cart
|
|
31
|
+
): bool
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Argument|Type|Default|Description
|
|
35
|
+
--------|----|-------|-----------
|
|
36
|
+
`$cart`|[`Cart`](Cart.md)||
|
|
37
|
+
|
|
38
|
+
Return Value: `bool`
|
|
39
|
+
|
|
40
|
+
### isPaymentCompleted()
|
|
41
|
+
|
|
42
|
+
```php
|
|
43
|
+
public function isPaymentCompleted(
|
|
44
|
+
Payment $payment
|
|
45
|
+
): bool
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Argument|Type|Default|Description
|
|
49
|
+
--------|----|-------|-----------
|
|
50
|
+
`$payment`|[`Payment`](Payment.md)||
|
|
51
|
+
|
|
52
|
+
Return Value: `bool`
|
|
53
|
+
|
|
54
|
+
### isReadyForCheckout()
|
|
55
|
+
|
|
56
|
+
```php
|
|
57
|
+
public function isReadyForCheckout(
|
|
58
|
+
Cart $cart
|
|
59
|
+
): bool
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Argument|Type|Default|Description
|
|
63
|
+
--------|----|-------|-----------
|
|
64
|
+
`$cart`|[`Cart`](Cart.md)||
|
|
65
|
+
|
|
66
|
+
Return Value: `bool`
|
|
67
|
+
|
|
68
|
+
Generated with [Frontastic API Docs](https://github.com/FrontasticGmbH/apidocs).
|
|
@@ -17,6 +17,7 @@ public function __construct(
|
|
|
17
17
|
AccountApiFactory $accountApiFactory,
|
|
18
18
|
object $orderIdGenerator,
|
|
19
19
|
iterable $decorators,
|
|
20
|
+
CartCheckoutService $cartCheckoutService,
|
|
20
21
|
\Psr\Log\LoggerInterface $logger
|
|
21
22
|
): mixed
|
|
22
23
|
```
|
|
@@ -27,6 +28,7 @@ Argument|Type|Default|Description
|
|
|
27
28
|
`$accountApiFactory`|[`AccountApiFactory`](../../AccountApiBundle/Domain/AccountApiFactory.md)||
|
|
28
29
|
`$orderIdGenerator`|`object`||
|
|
29
30
|
`$decorators`|`iterable`||
|
|
31
|
+
`$cartCheckoutService`|[`CartCheckoutService`](CartCheckoutService.md)||
|
|
30
32
|
`$logger`|`\Psr\Log\LoggerInterface`||
|
|
31
33
|
|
|
32
34
|
Return Value: `mixed`
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# DefaultCartCheckoutService
|
|
2
|
+
|
|
3
|
+
**Fully Qualified**: [`\Frontastic\Common\CartApiBundle\Domain\DefaultCartCheckoutService`](../../../../src/php/CartApiBundle/Domain/DefaultCartCheckoutService.php)
|
|
4
|
+
|
|
5
|
+
**Implements**: [`CartCheckoutService`](CartCheckoutService.md)
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
* [getPayedAmount()](#getpayedamount)
|
|
10
|
+
* [hasCompletePayments()](#hascompletepayments)
|
|
11
|
+
* [isPaymentCompleted()](#ispaymentcompleted)
|
|
12
|
+
* [isReadyForCheckout()](#isreadyforcheckout)
|
|
13
|
+
|
|
14
|
+
### getPayedAmount()
|
|
15
|
+
|
|
16
|
+
```php
|
|
17
|
+
public function getPayedAmount(
|
|
18
|
+
Cart $cart
|
|
19
|
+
): int
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Argument|Type|Default|Description
|
|
23
|
+
--------|----|-------|-----------
|
|
24
|
+
`$cart`|[`Cart`](Cart.md)||
|
|
25
|
+
|
|
26
|
+
Return Value: `int`
|
|
27
|
+
|
|
28
|
+
### hasCompletePayments()
|
|
29
|
+
|
|
30
|
+
```php
|
|
31
|
+
public function hasCompletePayments(
|
|
32
|
+
Cart $cart
|
|
33
|
+
): bool
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Argument|Type|Default|Description
|
|
37
|
+
--------|----|-------|-----------
|
|
38
|
+
`$cart`|[`Cart`](Cart.md)||
|
|
39
|
+
|
|
40
|
+
Return Value: `bool`
|
|
41
|
+
|
|
42
|
+
### isPaymentCompleted()
|
|
43
|
+
|
|
44
|
+
```php
|
|
45
|
+
public function isPaymentCompleted(
|
|
46
|
+
Payment $payment
|
|
47
|
+
): bool
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
*We only consider payments with status "paid" as completed*
|
|
51
|
+
|
|
52
|
+
Argument|Type|Default|Description
|
|
53
|
+
--------|----|-------|-----------
|
|
54
|
+
`$payment`|[`Payment`](Payment.md)||
|
|
55
|
+
|
|
56
|
+
Return Value: `bool`
|
|
57
|
+
|
|
58
|
+
### isReadyForCheckout()
|
|
59
|
+
|
|
60
|
+
```php
|
|
61
|
+
public function isReadyForCheckout(
|
|
62
|
+
Cart $cart
|
|
63
|
+
): bool
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
*Some commerce backends might consider a cart ready without payment(s).*
|
|
67
|
+
|
|
68
|
+
This method will return true if there are no payments or if all payments
|
|
69
|
+
had paid status and the total amounts are equal to cart total amount.
|
|
70
|
+
|
|
71
|
+
Argument|Type|Default|Description
|
|
72
|
+
--------|----|-------|-----------
|
|
73
|
+
`$cart`|[`Cart`](Cart.md)||
|
|
74
|
+
|
|
75
|
+
Return Value: `bool`
|
|
76
|
+
|
|
77
|
+
Generated with [Frontastic API Docs](https://github.com/FrontasticGmbH/apidocs).
|