Skip to content
Snippets Groups Projects
Commit db907e6b authored by Jonathan Sacksick's avatar Jonathan Sacksick
Browse files

Codestyling fixes.

parent 08b48aa0
No related branches found
No related tags found
No related merge requests found
......@@ -131,26 +131,26 @@ function commerce_paypal_commerce_checkout_flow_access(CheckoutFlowInterface $ch
* Implements hook_library_info_build().
*/
function commerce_paypal_library_info_build() {
$libraries = [];
// Only build the PayPal Credit messaging JS if a PayPal Client ID was set on
// the PayPal Credit messaging settings form.
$client_id = \Drupal::config('commerce_paypal.credit_messaging_settings')->get('client_id');
if ($client_id) {
$url = 'https://www.paypal.com/sdk/js?client-id=' . $client_id . '&components=messages';
$libraries['credit_messaging'] = [
'header' => TRUE,
'js' => [
$url => [
'type' => 'external',
'attributes' => [
'data-partner-attribution-id' => 'CommerceGuys_Cart_SPB',
],
if (!$client_id) {
return [];
}
$url = sprintf('https://www.paypal.com/sdk/js?client-id=%s&components=messages', $client_id);
$libraries['credit_messaging'] = [
'header' => TRUE,
'js' => [
$url => [
'type' => 'external',
'attributes' => [
'data-partner-attribution-id' => 'CommerceGuys_Cart_SPB',
],
],
];
}
],
];
return $libraries;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment