You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `loadScript` function accepts an object for configuring the JS SDK. It's used for setting query parameters and script attributes.
102
+
The `loadScript` function accepts an object for configuring the JS SDK. It's used for setting query parameters and script attributes. It accepts parameters in camelCase or kebab-case.
103
103
104
104
#### Query Parameters
105
105
106
106
The following example adds `client-id` and `currency` as query string parameters:
Which will load the following `<script>` asynchronously:
@@ -119,7 +119,7 @@ By default, the JS SDK only loads the buttons component. The `components` query
119
119
120
120
```js
121
121
loadScript({
122
-
"client-id":"YOUR_CLIENT_ID",
122
+
clientId:"YOUR_CLIENT_ID",
123
123
components:"buttons,marks,messages",
124
124
});
125
125
```
@@ -134,12 +134,12 @@ View the [full list of supported query parameters](https://developer.paypal.com/
134
134
135
135
#### Data Attributes
136
136
137
-
All options prefixed with `data-` are considered attributes. The following example adds `data-page-type` as an attribute:
137
+
All options prefixed with `data` are considered attributes. The following example adds `data-page-type` as an attribute:
138
138
139
139
```js
140
140
loadScript({
141
-
"client-id":"YOUR_CLIENT_ID",
142
-
"data-page-type":"checkout",
141
+
clientId:"YOUR_CLIENT_ID",
142
+
dataPageType:"checkout",
143
143
});
144
144
```
145
145
@@ -154,16 +154,16 @@ Which will load the following `<script>` asynchronously:
154
154
155
155
View the [full list of supported script parameters](https://developer.paypal.com/sdk/js/configuration/#link-scriptparameters).
156
156
157
-
#### Merchant ID Array
157
+
#### Merchant Id Array
158
158
159
-
The `merchant-id` option accepts an array to simplify the implementation for Multi-Seller Payments. With this approach the caller doesn't have to worry about managing the two different merchant id values (`data-merchant-id` and `merchant-id`).
159
+
The `merchantId` option accepts an array to simplify the implementation for Multi-Seller Payments. With this approach the caller doesn't have to worry about managing the two different merchant id values (`data-merchant-id` and `merchant-id`).
160
160
161
-
**Here's an example with multiple `merchant-id` values:**
161
+
**Here's an example with multiple `merchantId` values:**
162
162
163
163
```js
164
164
loadScript({
165
-
"client-id":"YOUR_CLIENT_ID",
166
-
"merchant-id": ["123", "456", "789"],
165
+
clientId:"YOUR_CLIENT_ID",
166
+
merchantId: ["123", "456", "789"],
167
167
});
168
168
```
169
169
@@ -180,8 +180,8 @@ Which will load the following `<script>` and use `merchant-id=*` to properly con
180
180
181
181
```js
182
182
loadScript({
183
-
"client-id":"YOUR_CLIENT_ID",
184
-
"merchant-id": ["123"],
183
+
clientId:"YOUR_CLIENT_ID",
184
+
merchantId: ["123"],
185
185
});
186
186
```
187
187
@@ -191,14 +191,14 @@ When there's only one, the merchant-id is passed in using the query string.
0 commit comments