mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-30 12:18:43 +09:00
Replace jQuery with vanilla JS in PayPalEmail adapter (#3146)
* Replace jQuery with vanilla JS in `PayPalEmail` adapter
Removes jQuery dependency for auto-redirect functionality by using
document.addEventListener('DOMContentLoaded', ...) instead of .ready()
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
b2152a2e12
commit
db28331ecc
1 file changed
+6
-1
@@ -268,7 +268,12 @@ class Payment_Adapter_PayPalEmail extends Payment_AdapterAbstract implements FOS
|
||||
|
||||
if (isset($this->config['auto_redirect']) && $this->config['auto_redirect']) {
|
||||
$form .= sprintf('<h2>%s</h2>', __trans('Redirecting to PayPal.com'));
|
||||
$form .= "<script type='text/javascript'>$(document).ready(function(){ document.getElementById('payment_button').style.display = 'none'; document.forms['payment_form'].submit();});</script>";
|
||||
$form .= "<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.getElementById('payment_button').style.display = 'none';
|
||||
document.forms['payment_form'].submit();
|
||||
});
|
||||
</script>";
|
||||
}
|
||||
|
||||
return $form;
|
||||
|
||||
Reference in new issue
Block a user