Add warning when url_site is not specified for paypal (it won't work if not set)
authorMatthew Wire <mjw@mjwconsult.co.uk>
Fri, 16 Apr 2021 11:31:13 +0000 (12:31 +0100)
committerMatthew Wire <mjw@mjwconsult.co.uk>
Fri, 16 Apr 2021 11:31:26 +0000 (12:31 +0100)
CRM/Core/Payment/PayPalImpl.php

index e0f5f1f64b9c789cefbf264b4c2b966a741aea85..709adc791adaa55db300435308cc2f40f6870377 100644 (file)
@@ -677,6 +677,11 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
     if (empty($this->_paymentProcessor['user_name'])) {
       $error[] = ts('User Name is not set in the Administer &raquo; System Settings &raquo; Payment Processors.');
     }
+    if ($this->isPayPalType($this::PAYPAL_STANDARD)) {
+      if (empty($this->_paymentProcessor['url_site'])) {
+        $error[] = ts('Site URL is not set (eg. https://www.paypal.com/ - https://www.sandbox.paypal.com/)');
+      }
+    }
 
     if (!empty($error)) {
       return implode('<p>', $error);