$params['subscriptionId'] = $this->_subscriptionDetails->subscription_id;
$updateSubscription = TRUE;
- if ($this->_paymentProcessorObj->isSupported('changeSubscriptionAmount')) {
+ if ($this->_paymentProcessorObj->supports('changeSubscriptionAmount')) {
$updateSubscription = $this->_paymentProcessorObj->changeSubscriptionAmount($message, $params);
}
if (is_a($updateSubscription, 'CRM_Core_Error')) {
return FALSE;
}
+ /**
+ * Does this processor support updating billing info for recurring contributions through code.
+ *
+ * If the processor returns true then it must be possible to update billing info from within CiviCRM
+ * that will be updated at the payment processor.
+ *
+ * @return bool
+ */
+ protected function supportsUpdateSubscriptionBillingInfo() {
+ return method_exists(CRM_Utils_System::getClassName($this), 'updateSubscriptionBillingInfo');
+ }
+
/**
* Can recurring contributions be set against pledges.
*
* @return array
*/
public function getEditableRecurringScheduleFields() {
- if (method_exists($this, 'changeSubscriptionAmount')) {
+ if ($this->supports('changeSubscriptionAmount')) {
return array('amount');
}
}
case 'billing':
//in notify mode don't return the update billing url
- if (!$this->isSupported('updateSubscriptionBillingInfo')) {
+ if (!$this->supports('updateSubscriptionBillingInfo')) {
return NULL;
}
$url = 'civicrm/contribute/updatebilling';
}
// Else login URL
- if ($this->isSupported('accountLoginURL')) {
+ if ($this->supports('accountLoginURL')) {
return $this->accountLoginURL();
}
return FALSE;
}
+ /**
+ * Does this processor support changing the amount for recurring contributions through code.
+ *
+ * If the processor returns true then it must be possible to update the amount from within CiviCRM
+ * that will be updated at the payment processor.
+ *
+ * @return bool
+ */
+ protected function supportsChangeSubscriptionAmount() {
+ return method_exists(CRM_Utils_System::getClassName($this), 'changeSubscriptionAmount');
+ }
+
/**
* Checks if payment processor supports recurring contributions
*
return FALSE;
}
+ /**
+ * Checks if payment processor supports an account login URL
+ * TODO: This is checked by self::subscriptionURL but is only used if no entityID is found.
+ * TODO: It is implemented by AuthorizeNET, any others?
+ *
+ * @return bool
+ */
+ protected function supportsAccountLoginURL() {
+ return method_exists(CRM_Utils_System::getClassName($this), 'accountLoginURL');
+ }
+
/**
* Should a receipt be sent out for a pending payment.
*
$paymentObject = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity(
$membership[$dao->id]['membership_id'], 'membership', 'obj');
if (!empty($paymentObject)) {
- // @todo - get this working with syntax style $paymentObject->supports(array
- //('updateSubscriptionBillingInfo'));
- $isUpdateBilling = $paymentObject->isSupported('updateSubscriptionBillingInfo');
+ $isUpdateBilling = $paymentObject->supports('updateSubscriptionBillingInfo');
}
// @todo - get this working with syntax style $paymentObject->supports(array