Broadleaf Microservices
  • v1.0.0-latest-prod

Commerce Next.js Starter Release Notes for 1.4.0

Features

Introduced Payment JS SDK

The Payment JS SDK was introduced to make integrating with Payment Gateways easier from a JS frontend client. A number of hooks and utilities were moved out of this starter and into the new SDK so that other projects could make use of them. See the Payment JS SDK docs.

Integrated with PaymentTransactionService

1.4.0 also saw the introduction of the PaymentTransactionService to manage payments and transactions securely and in a centralized location. This means that payments no longer live on Carts and Orders but in a separate service. Along with that, a PaymentClient was added to the @broadleaf/commerce-cart SDK, and, if you’re using React, you can interact with it through pre-made hooks in the new @broadleaf/payment-react SDK: useResolvePayments, useSubmitPaymentRequest, useCreatePayment, and useUpdatePayment. useSubmitPaymentRequest combines useCreatePayment, and useUpdatePayment to automatically determine whether to update the current payment related to the cart or to create a new one.

  • We also added a PaymentsContext to store the state of payments related to the current cart.

  • Made use of new fields on PaymentRequest

    • name: A display name for the payment. This replaces uses of attributes to store the same information.

    • subtotal: The total, usually excluding adjustments, tax, and fulfillment, covered by this payment.

    • adjustmentsTotal: The adjustments (a.k.a discounts) total, usually excluding fulfillment discounts, covered by this payment.

    • fulfillmentTotal: The fulfillment cost covered by this payment.

    • taxTotal: The tax covered by this payment.

    • isSingleUsePaymentMethod: Whether the underlying payment method can only be used once. In most cases the payment request is converted into a single-use token. Therefore, we will need to archive the payment and create new one if the payment amount changes after a successful transaction like authorization.

    • paymentMethodProperties replaces paymentGatewayProperties

    • displayAttributes: Replaces using attributes to store display information for the card during checkout if name is insufficient.

Added Support for Min/Max Product Threshold for Adding to Cart

Products and Variants can now specify min and max thresholds when added to cart. This affects adding both the top-level product and any item choices or add-ons.

Bug Fixes

  • Fixed: Slide-over Cart item quantity only going to 10

  • Fixed: Missing Adjustments#offerRef won’t break rendering the cart page

  • Fixed: Marketing Messages not being fetched when cart is not present