From: Matthew Wire Date: Mon, 26 Sep 2022 10:03:04 +0000 (+0100) Subject: Fix paypal subscription 'things don't seem to be working at the moment' if frequency_... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3904dc4384d163e6684fb30118cf4d63cf286ce8;p=civicrm-core.git Fix paypal subscription 'things don't seem to be working at the moment' if frequency_unit not specified --- diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index f0b79177f8..acc2fe3aeb 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -1017,10 +1017,11 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { throw new CRM_Core_Exception(ts('Recurring contribution, but no database id')); } + // See https://developer.paypal.com/api/nvp-soap/paypal-payments-standard/integration-guide/Appx-websitestandard-htmlvariables/#link-recurringpaymentvariables $paypalParams += [ 'cmd' => '_xclick-subscriptions', 'a3' => $this->getAmount($params), - 'p3' => $params['frequency_interval'], + 'p3' => $params['frequency_interval'] ?? 1, 't3' => ucfirst(substr($params['frequency_unit'], 0, 1)), 'src' => 1, 'sra' => 1,