File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 13
13
if (isset ($seller [' pwAuth' ]) && Auth:: check () && $customer = Auth:: user ()-> customer ) {
14
14
$seller [' pwCustomer' ] = [' id' => $customer -> paddle_id ];
15
15
}
16
+
17
+ $nonce = $nonce ?? ' ' ;
16
18
? >
17
19
18
- <script src =" https://cdn.paddle.com/paddle/v2/paddle.js" ></script >
20
+ <script src =" https://cdn.paddle.com/paddle/v2/paddle.js" @if ( $nonce ) nonce = " {{ $nonce } } " @endif ></script >
19
21
20
22
@if (config (' cashier.sandbox' ) )
21
- <script type =" text/javascript" >
23
+ <script type =" text/javascript" @if ( $nonce ) nonce = " {{ $nonce } } " @endif >
22
24
Paddle .Environment .set (' sandbox' );
23
25
</script >
24
26
@endif
25
27
26
- <script type =" text/javascript" >
28
+ <script type =" text/javascript" @if ( $nonce ) nonce = " {{ $nonce } } " @endif >
27
29
Paddle .Initialize (@json ($seller ));
28
30
</script >
Original file line number Diff line number Diff line change @@ -93,8 +93,8 @@ protected function bootPublishing()
93
93
*/
94
94
protected function bootDirectives ()
95
95
{
96
- Blade::directive ('paddleJS ' , function () {
97
- return "<?php echo view('cashier::js'); ?> " ;
96
+ Blade::directive ('paddleJS ' , function ($ expression ) {
97
+ return "<?php echo view('cashier::js', ['nonce' => { $ expression } ['nonce'] ?? ''] ); ?> " ;
98
98
});
99
99
}
100
100
You can’t perform that action at this time.
0 commit comments