Change record status: 
Project: 
Introduced in branch: 
8.x-2.x
Introduced in version: 
8.x-2.0-beta6
Description: 

If an onsite payment gateway depends on an external JS library that needs to be loaded before the module JS, then it needs to be specified in the payment gateway annotation (under "js_library").

Braintree example:

  *   forms = {
  *     "add-payment-method" = "Drupal\commerce_braintree\PluginForm\HostedFields\PaymentMethodAddForm",
  *   },
  *   js_library = "commerce_braintree/braintree",
  *   payment_method_types = {"credit_card"},

Matching entry in commerce_braintree.libraries.yml:

braintree:
  remote: https://github.com/braintree/braintree-web
  version: "2.25.0"
  license:
    name: MIT
    url: https://github.com/braintree/braintree-web/blob/2.25.0/LICENSE
    gpl-compatible: true
  js:
    "https://js.braintreegateway.com/js/braintree-2.25.0.min.js": { minified: true }
Impacts: 
Module developers