Skip to content

Releases: i-love-flamingo/flamingo-commerce

Support for fully discounted carts and GraphQL improvements

09 Apr 09:47
790a2a2

Choose a tag to compare

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 w3cDatalayer to commerce.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
  • 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 source service to support external location codes.
    • Adds ExternalLocationCode to the Source struct.
    • Update SetSourcesForCartItems() to use the new SourcingServiceDetail functionality if the bound service implements the interface
  • Update OrderService to 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
  • Fix CreateInitialDeliveryIfNotPresent so that cache gets updated now when an initial delivery is created
  • GraphQL: Add new cart validation query Commerce_Cart_Validator to 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 AttributesByKey domain method to filter attributes by key and exposed this method as getAttributesByKey in GraphQL
    • GraphQL: Exposing codeLabel property in the Commerce_ProductAttribute type

payment

  • Introduced error message for already used idempotency key

New GraphQL Place Order Process

26 Feb 16:49

Choose a tag to compare

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 additionalData to the AddRequest used during add to cart

    • Breaking: Update helper/builder function BuildAddRequest
  • Breaking: Change to EventPublisher interface, PublishChangedQtyInCartEvent and
    PublishAddToCartEvent now include a cart as a parameter

  • Breaking: Change to behaviour of AddToCartEvent and ChangedQtyInCartEvent, they are now thrown after the cart has been adjusted and written back to cache

  • Events deferred from ModifyBehaviour are dispatched before AddToCartEvent and ChangedQtyInCartEvent

  • The AddToCartEvent includes the current cart (with added product)

  • The ChangedQtyInCartEvent includes the current cart (with updated quantities)

  • Mark CartReceiverService.RestoreCart() as deprecated, use CartService.RestoreCart() instead,
    the cart adapter therefore needs to implement the CompleteBehaviour interface.

  • Add CartReceiverService.ModifyBehaviour() to easily receive the current behaviour (guest/customer)

  • Add CompleteBehaviour interface which ensures that the cart adapter offers Complete / Restore functionality

  • Add CartService.CompleteCurrentCart() and CartService.RestoreCart() which rely on the new CompleteBehaviour interface

  • Breaking: Update CartService.CancelOrder() to use CartService.RestoreCart() instead of CartReceiverService.RestoreCart(),
    if your cart supports completing/restoring please implement CompleteBehaviour interface

  • Add CartService.CancelOrderWithoutRestore() to allow order cancellation without restoring the cart

  • Mark GuestCartService.RestoreCart as deprecated, will be replaced by CompleteBehaviour

  • Mark CustomerCartService.RestoreCart as deprecated, will be replaced by CompleteBehaviour

  • Add mocks for all behaviours, you can use a specific one e.g. &mocks.CompleteBehaviour{} or the all in one &mocks.AllBehaviour{}

  • Update InMemoryBehaviour to fulfill the CompleteBehaviour interface (adds Complete()/Restore())

  • Update InMemoryCartStorage, add Mutex to be thread safe

  • Update SimplePaymentFormService to allow gift cards in the PaymentSelection, please use the
    config commerce.cart.simplePaymentForm.giftCardPaymentMethodto specify the default payment method for gift cards

  • Add missing product module dependency to cart module

checkout

  • Move config to commerce namespace, from checkout to commerce.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 new CartService function

  • Add OrderService.CartPlaceOrder() to place a provided cart instead of fetching it from the CartService

  • 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 ContextStore port to provide a storage for the place order process
      • Provide InMemory and Redis Adapter
    • Add new TryLocker port 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 PaymentService to easily work with bound PaymentGateway's

    • PaymentService.AvailablePaymentGateways() returns all bound gateways
    • PaymentService.PaymentGateway() gets the payment gateway by gateway code
    • PaymentService.PaymentGatewayByCart() gets the payment gateway of the cart payment selection
  • Extend the FlowStatus struct with more standardized FlowActionData

  • Add standardized Flow Actions PaymentFlowActionShowIframe, PaymentFlowActionShowHTML, PaymentFlowActionRedirect,
    PaymentFlowActionPostRedirect please use these in your payment adapter since the standard place order relies on them.

search

  • Extend Suggestion struct with Type and AdditionalAttributes to be able to distinguish between product/category suggestions

Minor bug fixes and dependency updates

10 Feb 12:08

Choose a tag to compare

v3.0.1

Update dingo and form to the latest version (#188)