mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 12:25:15 +08:00
Do not fail script loading if no script_attributes or data_client_id
This commit is contained in:
parent
4e34332c0b
commit
5ab6d3b27d
1 changed files with 4 additions and 2 deletions
|
@ -56,10 +56,12 @@ export const loadPaypalScript = (config, onLoaded, onError = null) => {
|
||||||
|
|
||||||
// Build the PayPal script options.
|
// Build the PayPal script options.
|
||||||
let scriptOptions = keysToCamelCase(config.url_params);
|
let scriptOptions = keysToCamelCase(config.url_params);
|
||||||
scriptOptions = merge(scriptOptions, config.script_attributes);
|
if (config.script_attributes) {
|
||||||
|
scriptOptions = merge(scriptOptions, config.script_attributes);
|
||||||
|
}
|
||||||
|
|
||||||
// Load PayPal script for special case with data-client-token
|
// Load PayPal script for special case with data-client-token
|
||||||
if (config.data_client_id.set_attribute) {
|
if (config.data_client_id?.set_attribute) {
|
||||||
dataClientIdAttributeHandler(scriptOptions, config.data_client_id, callback, errorCallback);
|
dataClientIdAttributeHandler(scriptOptions, config.data_client_id, callback, errorCallback);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue