Skip to content

Commit 266c0dd

Browse files
committed
Load PaypalRest js via URL and cache code
1 parent 136b09f commit 266c0dd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Metadata/omnipay_PaypalRest.mgd.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
* database as appropriate. For more details, see "hook_civicrm_managed" at:
3939
* http://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference
4040
*/
41+
42+
use CRM_Omnipaymultiprocessor_ExtensionUtil as E;
43+
4144
return array(
4245
array(
4346
'name' => 'PayPal Checkout',
@@ -100,8 +103,8 @@
100103
//'billing-block-post' => [],
101104
'billing-block' => [
102105
['markup' => '<div id="paypal-button-container" class="crm-paypal-buttons"></div>', 'name' => 'paypal_button', 'weight' => 400],
103-
['name' => 'paypal_script', 'weight' => 500, 'script' => file_get_contents(__DIR__ . '/js/omnipay_PaypalRest.js')]
104-
],
106+
['name' => 'paypal_script', 'weight' => 500, 'scriptUrl' => \Civi::resources()->addCacheCode(E::url('Metadata/js/omnipay_PaypalRest.js'))]
107+
],
105108
],
106109
],
107110
),

0 commit comments

Comments
 (0)