Releases: i-love-flamingo/flamingo-commerce
Support for fully discounted carts and GraphQL improvements
w3cdatalayer
- Fixed a bug that causes the datalayer to panic if it failed to build an absolute url
- Introduced a configuration option to choose between base64url and hex encoding for the hashed values
- Move config to commerce namespace, from
w3cDatalayertocommerce.w3cDatalayer - Add legacy config mapping so old mappings can still be used
- Add cue based config to have config validation in place
checkout
- Controller
- Allow checkout for fully discounted carts without payment processing. Previously all checkouts needed a valid payment to continue.
In case there is nothing to pay this can be skipped.- Order ID will be reserved as soon as the user hits the checkout previously it was done before starting the payment
- Allow checkout for fully discounted carts without payment processing. Previously all checkouts needed a valid payment to continue.
- GraphQL
- Update place order process to also allow zero carts which don't need payment, this leads to a state flow that lacks the payment steps.
See module readme for further details.
- Update place order process to also allow zero carts which don't need payment, this leads to a state flow that lacks the payment steps.
- Update source service to support external location codes.
- Adds
ExternalLocationCodeto theSourcestruct. - Update
SetSourcesForCartItems()to use the newSourcingServiceDetailfunctionality if the bound service implements the interface
- Adds
- Update
OrderServiceto expose more metrics regarding the place order process:flamingo-commerce/checkout/orders/cart_validation_failed flamingo-commerce/checkout/orders/no_payment_selection flamingo-commerce/checkout/orders/payment_gateway_not_found flamingo-commerce/checkout/orders/payment_flow_status_error flamingo-commerce/checkout/orders/order_payment_from_flow_error flamingo-commerce/checkout/orders/payment_flow_status_failed_canceled flamingo-commerce/checkout/orders/payment_flow_status_aborted flamingo-commerce/checkout/orders/place_order_failed flamingo-commerce/checkout/orders/place_order_successful
cart
- inMemoryBehaviour: Allow custom logic for GiftCard / Voucher handling
- We introduced two new interfaces
GiftCardHandler+VoucherHandler - This enables users of the in-memory cart to add project specific gift card and voucher handling
- We introduced two new interfaces
- Fix
CreateInitialDeliveryIfNotPresentso that cache gets updated now when an initial delivery is created - GraphQL: Add new cart validation query
Commerce_Cart_Validatorto check if cart contains valid items
price
- IsZero() now uses LikelyEqual() instead of Equal() to avoid issues occurring due to floating-point arithmetic
product
- product attributes:
- Added
AttributesByKeydomain method to filter attributes by key and exposed this method asgetAttributesByKeyin GraphQL - GraphQL: Exposing
codeLabelproperty in theCommerce_ProductAttributetype
- Added
payment
- Introduced error message for already used idempotency key
New GraphQL Place Order Process
The release mainly improves the checkout experience when using the GraphQL interfaces, by introducing a new place order process which is backed by a state machine. This encapsulates all critical parts of the checkout into separate states which are easier to test and allow us to rollback each process part seperatly.
dependencies
- Update flamingo core to v3.2.0
- Update dingo to v0.2.9
tests
- Added GraphQL integration tests for new Place Order Process, run manually with
make integrationtest - To run the GraphQL Demo project use
make run-integrationtest-demo-project - To regenerate the GraphQL files used by the integration tests / demo project use
make generate-integrationtest-graphql
cart
-
Add
additionalDatato theAddRequestused during add to cart- Breaking: Update helper/builder function
BuildAddRequest
- Breaking: Update helper/builder function
-
Breaking: Change to
EventPublisherinterface,PublishChangedQtyInCartEventand
PublishAddToCartEventnow include a cart as a parameter -
Breaking: Change to behaviour of
AddToCartEventandChangedQtyInCartEvent, they are now thrown after the cart has been adjusted and written back to cache -
Events deferred from
ModifyBehaviourare dispatched beforeAddToCartEventandChangedQtyInCartEvent -
The
AddToCartEventincludes the current cart (with added product) -
The
ChangedQtyInCartEventincludes the current cart (with updated quantities) -
Mark
CartReceiverService.RestoreCart()as deprecated, useCartService.RestoreCart()instead,
the cart adapter therefore needs to implement theCompleteBehaviourinterface. -
Add
CartReceiverService.ModifyBehaviour()to easily receive the current behaviour (guest/customer) -
Add
CompleteBehaviourinterface which ensures that the cart adapter offers Complete / Restore functionality -
Add
CartService.CompleteCurrentCart()andCartService.RestoreCart()which rely on the newCompleteBehaviourinterface -
Breaking: Update
CartService.CancelOrder()to useCartService.RestoreCart()instead ofCartReceiverService.RestoreCart(),
if your cart supports completing/restoring please implementCompleteBehaviourinterface -
Add
CartService.CancelOrderWithoutRestore()to allow order cancellation without restoring the cart -
Mark
GuestCartService.RestoreCartas deprecated, will be replaced byCompleteBehaviour -
Mark
CustomerCartService.RestoreCartas deprecated, will be replaced byCompleteBehaviour -
Add mocks for all behaviours, you can use a specific one e.g.
&mocks.CompleteBehaviour{}or the all in one&mocks.AllBehaviour{} -
Update
InMemoryBehaviourto fulfill theCompleteBehaviourinterface (addsComplete()/Restore()) -
Update
InMemoryCartStorage, add Mutex to be thread safe -
Update
SimplePaymentFormServiceto allow gift cards in thePaymentSelection, please use the
configcommerce.cart.simplePaymentForm.giftCardPaymentMethodto specify the default payment method for gift cards -
Add missing
productmodule dependency to cart module
checkout
-
Move config to commerce namespace, from
checkouttocommerce.checkout -
Add legacy config mapping so old mappings can still be used
-
Add cue based config to have config validation in place
-
Add
OrderService.CancelOrderWithoutRestore()which uses the newCartServicefunction -
Add
OrderService.CartPlaceOrder()to place a provided cart instead of fetching it from theCartService -
Add new GraphQL Place Order process which relies on a new state machine please referer to the module readme for more details
- Transition all actions of the checkout controller to separate states
- Add new
ContextStoreport to provide a storage for the place order process- Provide InMemory and Redis Adapter
- Add new
TryLockerport to provide an easy way to sync multiple order processes across different nodes- Provide InMemory and Redis Adapter
- Breaking: Add new GraphQL mutations / queries to start / stop / refresh the place order process
payment
-
Add
PaymentServiceto easily work with bound PaymentGateway'sPaymentService.AvailablePaymentGateways()returns all bound gatewaysPaymentService.PaymentGateway()gets the payment gateway by gateway codePaymentService.PaymentGatewayByCart()gets the payment gateway of the cart payment selection
-
Extend the
FlowStatusstruct with more standardizedFlowActionData -
Add standardized Flow Actions
PaymentFlowActionShowIframe,PaymentFlowActionShowHTML,PaymentFlowActionRedirect,
PaymentFlowActionPostRedirectplease use these in your payment adapter since the standard place order relies on them.
search
- Extend
Suggestionstruct withTypeandAdditionalAttributesto be able to distinguish between product/category suggestions
Minor bug fixes and dependency updates
v3.0.1 Update dingo and form to the latest version (#188)