Preview:
verifyIfHasShippingMethodsInAllPaymentTypes: function () {
  var widget = this;
  var selectedShippingMethod = widget.cart().shippingMethod();
  var shippingMethodNotAvailable = widget.paymentTypes().some(function (paymentType) {
      if (!(paymentType.hasOwnProperty('freights') && paymentType.freights && paymentType.freights.includes(selectedShippingMethod))) {
          return paymentType
      }
  })
  if (!shippingMethodNotAvailable) {
      widget.enableAllPaymentTypes(true);
  }
},
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter