Skip to content

Commit bdfbcd5

Browse files
committed
feat(common): PAYPAL-7 Pass in merchant ID on PayPal button script for PayPal Express Checkout
- CR fixes
1 parent fc9e7c9 commit bdfbcd5

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/script-loader.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,12 @@ export default class ScriptLoader {
3131
if (!this._scripts[src]) {
3232
this._scripts[src] = new Promise((resolve, reject) => {
3333
const script = document.createElement('script') as LegacyHTMLScriptElement;
34-
const { async = false } = options || {};
35-
const scriptAttributes = options && options.attributes;
34+
const { async = false, attributes = {} } = options || {};
3635

37-
for (const key in scriptAttributes) {
38-
if (scriptAttributes.hasOwnProperty(key)) {
39-
script.setAttribute(key, scriptAttributes[key]);
40-
}
41-
}
36+
Object.keys(attributes)
37+
.forEach(key => {
38+
script.setAttribute(key, attributes[key]);
39+
});
4240

4341
script.onload = () => resolve();
4442
script.onreadystatechange = () => resolve();

0 commit comments

Comments
 (0)