try {
//we only get invoice num as a key player from payment gateway response.
//for ARB we get x_subscription_id and x_subscription_paynum
- $x_subscription_id = $this->retrieve('x_subscription_id', 'String');
- if (!$x_subscription_id) {
- // Presence of the id means it is approved.
- return TRUE;
- }
+ $x_subscription_id = $this->getRecurProcessorID();
$ids = $input = [];
$input['component'] = 'contribute';
]);
}
+ /**
+ * Get the processor_id for the recurring.
+ *
+ * This is the value stored in civicrm_contribution_recur.processor_id,
+ * sometimes called subscription_id.
+ *
+ * @return string
+ *
+ * @throws \CRM_Core_Exception
+ */
+ protected function getRecurProcessorID(): string {
+ return $this->retrieve('x_subscription_id', 'String');
+ }
+
}