+ /**
+ * Get the loaded payment processor - the default for the form.
+ *
+ * If the form is using 'pay later' then the value for the manual
+ * pay later processor is 0.
+ *
+ * @return int|null
+ */
+ protected function getCurrentPaymentProcessor(): ?int {
+ $pps = $this->getProcessors();
+ if (!empty($pps) && count($pps) === 1) {
+ $ppKeys = array_keys($pps);
+ return array_pop($ppKeys);
+ }
+ // It seems like this might be un=reachable as there should always be a processor...
+ return NULL;
+ }
+