| Conditions | 2 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function boot() |
||
| 29 | { |
||
| 30 | $this->publishes([ |
||
| 31 | __DIR__ . '/../config/revolut-merchant.php' => config_path('revolut-merchant.php') |
||
| 32 | ]); |
||
| 33 | |||
| 34 | Blade::directive('revolutMerchantScript', function() { |
||
| 35 | |||
| 36 | $src = config('revolut-merchant.sandbox', true) |
||
| 37 | ? 'https://sandbox-merchant.revolut.com/embed.js' |
||
| 38 | : 'https://merchant.revolut.com/embed.js'; |
||
| 39 | |||
| 40 | return '<script>!function(e,o,n){e[n]=function(t){var r=o.createElement("script");r.id="revolut-checkout",r.src="' . $src . '",r.async=!0,o.head.appendChild(r);var c={then:function(c,i){r.onload=function(){c(e[n](t))},r.onerror=function(){o.head.removeChild(r),i&&i(new Error(n+" is failed to load"))}}};return"function"==typeof Promise?Promise.resolve(c):c}}(window,document,"RevolutCheckout");</script>'; |
||
| 41 | }); |
||
| 44 |