woocommerce/plugins/woocommerce-blocks/assets/js/base/context/cart-checkout
Rua Haszard afe77fb1e3 Show payment gateways in correct (merchant-configured) order (https://github.com/woocommerce/woocommerce-blocks/pull/2934)
* enqueue order of payment gateways as script data

* use configured gateway order for payment method tabs

* clarify name of payment gateway sort order setting

* fix formatting

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>

* fix bug - express payment methods not working due to ordering logic:
- move ordering code to payment methods in usePaymentMethods hook;
  - this only applies to standard (non express) payment methods
- also any code that uses payment methods will get them in correct order

* why did this formatting not happen pre-commit?

* move method ordering into refreshPaymentMethods to avoid infinite loop:
- pass keys of express payment methods so they work correctly (show up)
- refreshPaymentMethods dispatches availablePaymentMethods to redux
  store; I suspect this was causing infinite loop as the callback
  depends on registeredPaymentMethods
- handle case when a payment method is not in PAYMENT_GATEWAY_SORT_ORDER
  - this happens with COD when dependent on shipping

* fix formatting

* use shallow equal to prevent refreshCanMakePayments infinite loop

* use native Set instead of lodash.union for unique gateway names

* code formatting

* check to ensure we register paymentGatewaySortOrder asset once only

* fix COD tab showing out of order if not available at page load:
- return ALL gateways in sort order array
  - note this includes gateways that are not enabled by merchant

* reinstate return bool from usePaymentMethods hook (broken in refactor)

* add basic typedefs for payment methods hooks

Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2020-08-05 13:56:33 +12:00
..
billing Ensure email and phone are persisted through `setBillingData` (https://github.com/woocommerce/woocommerce-blocks/pull/2477) 2020-05-13 15:39:26 +01:00
cart Payment methods `placeOrderButtonLabel` config (https://github.com/woocommerce/woocommerce-blocks/pull/2362) 2020-04-30 10:52:36 +01:00
checkout Add 'Order notes' to Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/2877) 2020-07-31 17:17:01 +02:00
checkout-state Add 'Order notes' to Checkout block (https://github.com/woocommerce/woocommerce-blocks/pull/2877) 2020-07-31 17:17:01 +02:00
payment-methods Show payment gateways in correct (merchant-configured) order (https://github.com/woocommerce/woocommerce-blocks/pull/2934) 2020-08-05 13:56:33 +12:00
shipping Add to cart context provider (https://github.com/woocommerce/woocommerce-blocks/pull/2903) 2020-07-30 11:57:22 +01:00
index.js Add to cart context provider (https://github.com/woocommerce/woocommerce-blocks/pull/2903) 2020-07-30 11:57:22 +01:00