[REF] Retrieve the token if it is available from the Payment Token ta…
Created by: seamuslee001
…ble if no processor_id is set
Overview
Some Payment Processors (notably IATS) do not store the customer token in the civicrm_contribution_recur.processor_id column but rather in the civicrm_payment_token.token column instead see https://github.com/iATSPayments/com.iatspayments.civicrm/blob/3f72337ca0430fc3aaad94c3aba2271c198b2273/CRM/Core/Payment/iATSServiceACHEFT.php#L266
However this causes the cancel form on contribution recur self service to break because the cancel form is assuming the payment token will always be in civicrm_contribution_recur.processor_id https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/CancelSubscription.php#L219
Before
Self-Service Cancel form fails or IATS and possibly other payment processors that store the token in the civicrm_payment_token table rather than in the civicrm_contribution_recur table
After
Cancel form works for IATS and similar
ping @mattwire @eileenmcnaughton @KarinG note that this is a partial alternate to @Edzelopez 's https://github.com/civicrm/civicrm-core/pull/17445 Note this aims to only fix item 1 from that PR