Search code examples
javascripthtmlpaypal

Additional argument in HTML '<script src= >' . What is happening?


What exactly is the 'data-client-token' inside this tag doing? It's not a default argument that is passed to the script src such as async or defer. The name also isn't a valid JavaScript variable name.

<script src="https://www.paypal.com/sdk/js?components=buttons,hosted-fields&client-id=yyyyyyyyyyyy"
data-client-token="xxxx-xxxx-xxxx-xxxx"></script>

Thanks in advance

Russeree,


Solution

  • It's an HTML data attribute.

    data-client-token is required for advanced credit and debit card payments (hosted fields)