afe77fb1e3
* 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> |
||
---|---|---|
.. | ||
constants.js | ||
feature-flags.js | ||
index.js |