Merge pull request #6898 from yashodha/CRM-17299
[civicrm-core.git] / CRM / Core / Payment.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
26 */
27
28 use Civi\Payment\System;
29
30 /**
31 * Class CRM_Core_Payment.
32 *
33 * This class is the main class for the payment processor subsystem.
34 *
35 * It is the parent class for payment processors. It also holds some IPN related functions
36 * that need to be moved. In particular handlePaymentMethod should be moved to a factory class.
37 */
38 abstract class CRM_Core_Payment {
39
40 /**
41 * How are we getting billing information?
42 *
43 * FORM - we collect it on the same page
44 * BUTTON - the processor collects it and sends it back to us via some protocol
45 */
46 const
47 BILLING_MODE_FORM = 1,
48 BILLING_MODE_BUTTON = 2,
49 BILLING_MODE_NOTIFY = 4;
50
51 /**
52 * Which payment type(s) are we using?
53 *
54 * credit card
55 * direct debit
56 * or both
57 * @todo create option group - nb omnipay uses a 3rd type - transparent redirect cc
58 */
59 const
60 PAYMENT_TYPE_CREDIT_CARD = 1,
61 PAYMENT_TYPE_DIRECT_DEBIT = 2;
62
63 /**
64 * Subscription / Recurring payment Status
65 * START, END
66 */
67 const
68 RECURRING_PAYMENT_START = 'START',
69 RECURRING_PAYMENT_END = 'END';
70
71 protected $_paymentProcessor;
72
73 /**
74 * Singleton function used to manage this object.
75 *
76 * We will migrate to calling Civi\Payment\System::singleton()->getByProcessor($paymentProcessor)
77 * & Civi\Payment\System::singleton()->getById($paymentProcessor) directly as the main access methods & work
78 * to remove this function all together
79 *
80 * @param string $mode
81 * The mode of operation: live or test.
82 * @param array $paymentProcessor
83 * The details of the payment processor being invoked.
84 * @param object $paymentForm
85 * Deprecated - avoid referring to this if possible. If you have to use it document why as this is scary interaction.
86 * @param bool $force
87 * Should we force a reload of this payment object.
88 *
89 * @return CRM_Core_Payment
90 * @throws \CRM_Core_Exception
91 */
92 public static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) {
93 // make sure paymentProcessor is not empty
94 // CRM-7424
95 if (empty($paymentProcessor)) {
96 return CRM_Core_DAO::$_nullObject;
97 }
98 //we use two lines because we can't remove the '&singleton' without risking breakage
99 //of extension classes that extend this one
100 $object = Civi\Payment\System::singleton()->getByProcessor($paymentProcessor);
101 return $object;
102 }
103
104 /**
105 * Opportunity for the payment processor to override the entire form build.
106 *
107 * @param CRM_Core_Form $form
108 *
109 * @return bool
110 * Should form building stop at this point?
111 */
112 public function buildForm(&$form) {
113 return FALSE;
114 }
115
116 /**
117 * Log payment notification message to forensic system log.
118 *
119 * @todo move to factory class \Civi\Payment\System (or similar)
120 *
121 * @param array $params
122 *
123 * @return mixed
124 */
125 public static function logPaymentNotification($params) {
126 $message = 'payment_notification ';
127 if (!empty($params['processor_name'])) {
128 $message .= 'processor_name=' . $params['processor_name'];
129 }
130 if (!empty($params['processor_id'])) {
131 $message .= 'processor_id=' . $params['processor_id'];
132 }
133
134 $log = new CRM_Utils_SystemLogger();
135 $log->alert($message, $_REQUEST);
136 }
137
138 /**
139 * Check if capability is supported.
140 *
141 * Capabilities have a one to one relationship with capability-related functions on this class.
142 *
143 * Payment processor classes should over-ride the capability-specific function rather than this one.
144 *
145 * @param string $capability
146 * E.g BackOffice, LiveMode, FutureRecurStartDate.
147 *
148 * @return bool
149 */
150 public function supports($capability) {
151 $function = 'supports' . ucfirst($capability);
152 if (method_exists($this, $function)) {
153 return $this->$function();
154 }
155 return FALSE;
156 }
157
158 /**
159 * Are back office payments supported.
160 *
161 * e.g paypal standard won't permit you to enter a credit card associated
162 * with someone else's login.
163 * The intention is to support off-site (other than paypal) & direct debit but that is not all working yet so to
164 * reach a 'stable' point we disable.
165 *
166 * @return bool
167 */
168 protected function supportsBackOffice() {
169 if ($this->_paymentProcessor['billing_mode'] == 4 || $this->_paymentProcessor['payment_type'] != 1) {
170 return FALSE;
171 }
172 else {
173 return TRUE;
174 }
175 }
176
177 /**
178 * Can more than one transaction be processed at once?
179 *
180 * In general processors that process payment by server to server communication support this while others do not.
181 *
182 * In future we are likely to hit an issue where this depends on whether a token already exists.
183 *
184 * @return bool
185 */
186 protected function supportsMultipleConcurrentPayments() {
187 if ($this->_paymentProcessor['billing_mode'] == 4 || $this->_paymentProcessor['payment_type'] != 1) {
188 return FALSE;
189 }
190 else {
191 return TRUE;
192 }
193 }
194
195 /**
196 * Are live payments supported - e.g dummy doesn't support this.
197 *
198 * @return bool
199 */
200 protected function supportsLiveMode() {
201 return TRUE;
202 }
203
204 /**
205 * Are test payments supported.
206 *
207 * @return bool
208 */
209 protected function supportsTestMode() {
210 return TRUE;
211 }
212
213 /**
214 * Should the first payment date be configurable when setting up back office recurring payments.
215 *
216 * We set this to false for historical consistency but in fact most new processors use tokens for recurring and can support this
217 *
218 * @return bool
219 */
220 protected function supportsFutureRecurStartDate() {
221 return FALSE;
222 }
223
224 /**
225 * Can recurring contributions be set against pledges.
226 *
227 * In practice all processors that use the baseIPN function to finish transactions or
228 * call the completetransaction api support this by looking up previous contributions in the
229 * series and, if there is a prior contribution against a pledge, and the pledge is not complete,
230 * adding the new payment to the pledge.
231 *
232 * However, only enabling for processors it has been tested against.
233 *
234 * @return bool
235 */
236 protected function supportsRecurContributionsForPledges() {
237 return FALSE;
238 }
239
240 /**
241 * Default payment instrument validation.
242 *
243 * Implement the usual Luhn algorithm via a static function in the CRM_Core_Payment_Form if it's a credit card
244 * Not a static function, because I need to check for payment_type.
245 *
246 * @param array $values
247 * @param array $errors
248 */
249 public function validatePaymentInstrument($values, &$errors) {
250 if ($this->_paymentProcessor['payment_type'] == 1) {
251 CRM_Core_Payment_Form::validateCreditCard($values, $errors);
252 }
253 }
254
255 /**
256 * Getter for the payment processor.
257 *
258 * The payment processor array is based on the civicrm_payment_processor table entry.
259 *
260 * @return array
261 * Payment processor array.
262 */
263 public function getPaymentProcessor() {
264 return $this->_paymentProcessor;
265 }
266
267 /**
268 * Setter for the payment processor.
269 *
270 * @param array $processor
271 */
272 public function setPaymentProcessor($processor) {
273 $this->_paymentProcessor = $processor;
274 }
275
276 /**
277 * Setter for the payment form that wants to use the processor.
278 *
279 * @deprecated
280 *
281 * @param CRM_Core_Form $paymentForm
282 */
283 public function setForm(&$paymentForm) {
284 $this->_paymentForm = $paymentForm;
285 }
286
287 /**
288 * Getter for payment form that is using the processor.
289 * @deprecated
290 * @return CRM_Core_Form
291 * A form object
292 */
293 public function getForm() {
294 return $this->_paymentForm;
295 }
296
297 /**
298 * Getter for accessing member vars.
299 *
300 * @todo believe this is unused
301 *
302 * @param string $name
303 *
304 * @return null
305 */
306 public function getVar($name) {
307 return isset($this->$name) ? $this->$name : NULL;
308 }
309
310 /**
311 * Get name for the payment information type.
312 * @todo - use option group + name field (like Omnipay does)
313 * @return string
314 */
315 public function getPaymentTypeName() {
316 return $this->_paymentProcessor['payment_type'] == 1 ? 'credit_card' : 'direct_debit';
317 }
318
319 /**
320 * Get label for the payment information type.
321 * @todo - use option group + labels (like Omnipay does)
322 * @return string
323 */
324 public function getPaymentTypeLabel() {
325 return $this->_paymentProcessor['payment_type'] == 1 ? 'Credit Card' : 'Direct Debit';
326 }
327
328 /**
329 * Get array of fields that should be displayed on the payment form.
330 * @todo make payment type an option value & use it in the function name - currently on debit & credit card work
331 * @return array
332 * @throws CiviCRM_API3_Exception
333 */
334 public function getPaymentFormFields() {
335 if ($this->_paymentProcessor['billing_mode'] == 4) {
336 return array();
337 }
338 return $this->_paymentProcessor['payment_type'] == 1 ? $this->getCreditCardFormFields() : $this->getDirectDebitFormFields();
339 }
340
341 /**
342 * Get array of fields that should be displayed on the payment form for credit cards.
343 *
344 * @return array
345 */
346 protected function getCreditCardFormFields() {
347 return array(
348 'credit_card_type',
349 'credit_card_number',
350 'cvv2',
351 'credit_card_exp_date',
352 );
353 }
354
355 /**
356 * Get array of fields that should be displayed on the payment form for direct debits.
357 *
358 * @return array
359 */
360 protected function getDirectDebitFormFields() {
361 return array(
362 'account_holder',
363 'bank_account_number',
364 'bank_identification_number',
365 'bank_name',
366 );
367 }
368
369 /**
370 * Return an array of all the details about the fields potentially required for payment fields.
371 *
372 * Only those determined by getPaymentFormFields will actually be assigned to the form
373 *
374 * @return array
375 * field metadata
376 */
377 public function getPaymentFormFieldsMetadata() {
378 //@todo convert credit card type into an option value
379 $creditCardType = array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::creditCard();
380 return array(
381 'credit_card_number' => array(
382 'htmlType' => 'text',
383 'name' => 'credit_card_number',
384 'title' => ts('Card Number'),
385 'cc_field' => TRUE,
386 'attributes' => array(
387 'size' => 20,
388 'maxlength' => 20,
389 'autocomplete' => 'off',
390 'class' => 'creditcard',
391 ),
392 'is_required' => TRUE,
393 ),
394 'cvv2' => array(
395 'htmlType' => 'text',
396 'name' => 'cvv2',
397 'title' => ts('Security Code'),
398 'cc_field' => TRUE,
399 'attributes' => array(
400 'size' => 5,
401 'maxlength' => 10,
402 'autocomplete' => 'off',
403 ),
404 'is_required' => CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
405 'cvv_backoffice_required',
406 NULL,
407 1
408 ),
409 'rules' => array(
410 array(
411 'rule_message' => ts('Please enter a valid value for your card security code. This is usually the last 3-4 digits on the card\'s signature panel.'),
412 'rule_name' => 'integer',
413 'rule_parameters' => NULL,
414 ),
415 ),
416 ),
417 'credit_card_exp_date' => array(
418 'htmlType' => 'date',
419 'name' => 'credit_card_exp_date',
420 'title' => ts('Expiration Date'),
421 'cc_field' => TRUE,
422 'attributes' => CRM_Core_SelectValues::date('creditCard'),
423 'is_required' => TRUE,
424 'rules' => array(
425 array(
426 'rule_message' => ts('Card expiration date cannot be a past date.'),
427 'rule_name' => 'currentDate',
428 'rule_parameters' => TRUE,
429 ),
430 ),
431 ),
432 'credit_card_type' => array(
433 'htmlType' => 'select',
434 'name' => 'credit_card_type',
435 'title' => ts('Card Type'),
436 'cc_field' => TRUE,
437 'attributes' => $creditCardType,
438 'is_required' => FALSE,
439 ),
440 'account_holder' => array(
441 'htmlType' => 'text',
442 'name' => 'account_holder',
443 'title' => ts('Account Holder'),
444 'cc_field' => TRUE,
445 'attributes' => array(
446 'size' => 20,
447 'maxlength' => 34,
448 'autocomplete' => 'on',
449 ),
450 'is_required' => TRUE,
451 ),
452 //e.g. IBAN can have maxlength of 34 digits
453 'bank_account_number' => array(
454 'htmlType' => 'text',
455 'name' => 'bank_account_number',
456 'title' => ts('Bank Account Number'),
457 'cc_field' => TRUE,
458 'attributes' => array(
459 'size' => 20,
460 'maxlength' => 34,
461 'autocomplete' => 'off',
462 ),
463 'rules' => array(
464 array(
465 'rule_message' => ts('Please enter a valid Bank Identification Number (value must not contain punctuation characters).'),
466 'rule_name' => 'nopunctuation',
467 'rule_parameters' => NULL,
468 ),
469 ),
470 'is_required' => TRUE,
471 ),
472 //e.g. SWIFT-BIC can have maxlength of 11 digits
473 'bank_identification_number' => array(
474 'htmlType' => 'text',
475 'name' => 'bank_identification_number',
476 'title' => ts('Bank Identification Number'),
477 'cc_field' => TRUE,
478 'attributes' => array(
479 'size' => 20,
480 'maxlength' => 11,
481 'autocomplete' => 'off',
482 ),
483 'is_required' => TRUE,
484 'rules' => array(
485 array(
486 'rule_message' => ts('Please enter a valid Bank Identification Number (value must not contain punctuation characters).'),
487 'rule_name' => 'nopunctuation',
488 'rule_parameters' => NULL,
489 ),
490 ),
491 ),
492 'bank_name' => array(
493 'htmlType' => 'text',
494 'name' => 'bank_name',
495 'title' => ts('Bank Name'),
496 'cc_field' => TRUE,
497 'attributes' => array(
498 'size' => 20,
499 'maxlength' => 64,
500 'autocomplete' => 'off',
501 ),
502 'is_required' => TRUE,
503
504 ),
505 );
506 }
507
508 /**
509 * Calling this from outside the payment subsystem is deprecated - use doPayment.
510 *
511 * Does a server to server payment transaction.
512 *
513 * Note that doPayment will throw an exception so the code may need to be modified
514 *
515 * @param array $params
516 * Assoc array of input parameters for this transaction.
517 *
518 * @return array
519 * the result in an nice formatted array (or an error object)
520 * @abstract
521 */
522 abstract protected function doDirectPayment(&$params);
523
524 /**
525 * Process payment - this function wraps around both doTransferPayment and doDirectPayment.
526 *
527 * The function ensures an exception is thrown & moves some of this logic out of the form layer and makes the forms
528 * more agnostic.
529 *
530 * @param array $params
531 *
532 * @param $component
533 *
534 * @return array
535 * (modified)
536 * @throws CRM_Core_Exception
537 */
538 public function doPayment(&$params, $component = 'contribute') {
539 if ($this->_paymentProcessor['billing_mode'] == 4) {
540 $result = $this->doTransferCheckout($params, $component);
541 }
542 else {
543 $result = $this->doDirectPayment($params, $component);
544 }
545 if (is_a($result, 'CRM_Core_Error')) {
546 throw new CRM_Core_Exception(CRM_Core_Error::getMessages($result));
547 }
548 //CRM-15767 - Submit Credit Card Contribution not being saved
549 return $result;
550 }
551
552 /**
553 * This function checks to see if we have the right config values.
554 *
555 * @return string
556 * the error message if any
557 */
558 abstract protected function checkConfig();
559
560 /**
561 * Redirect for paypal.
562 *
563 * @todo move to paypal class or remove
564 *
565 * @param $paymentProcessor
566 *
567 * @return bool
568 */
569 public static function paypalRedirect(&$paymentProcessor) {
570 if (!$paymentProcessor) {
571 return FALSE;
572 }
573
574 if (isset($_GET['payment_date']) &&
575 isset($_GET['merchant_return_link']) &&
576 CRM_Utils_Array::value('payment_status', $_GET) == 'Completed' &&
577 $paymentProcessor['payment_processor_type'] == "PayPal_Standard"
578 ) {
579 return TRUE;
580 }
581
582 return FALSE;
583 }
584
585 /**
586 * Handle incoming payment notification.
587 *
588 * IPNs, also called silent posts are notifications of payment outcomes or activity on an external site.
589 *
590 * @todo move to0 \Civi\Payment\System factory method
591 * Page callback for civicrm/payment/ipn
592 */
593 public static function handleIPN() {
594 self::handlePaymentMethod(
595 'PaymentNotification',
596 array(
597 'processor_name' => @$_GET['processor_name'],
598 'processor_id' => @$_GET['processor_id'],
599 'mode' => @$_GET['mode'],
600 'q' => @$_GET['q'],
601 )
602 );
603 CRM_Utils_System::civiExit();
604 }
605
606 /**
607 * Payment callback handler.
608 *
609 * The processor_name or processor_id is passed in.
610 * Note that processor_id is more reliable as one site may have more than one instance of a
611 * processor & ideally the processor will be validating the results
612 * Load requested payment processor and call that processor's handle<$method> method
613 *
614 * @todo move to \Civi\Payment\System factory method
615 *
616 * @param string $method
617 * 'PaymentNotification' or 'PaymentCron'
618 * @param array $params
619 *
620 * @throws \CRM_Core_Exception
621 * @throws \Exception
622 */
623 public static function handlePaymentMethod($method, $params = array()) {
624 if (!isset($params['processor_id']) && !isset($params['processor_name'])) {
625 $q = explode('/', CRM_Utils_Array::value('q', $params, ''));
626 $lastParam = array_pop($q);
627 if (is_numeric($lastParam)) {
628 $params['processor_id'] = $_GET['processor_id'] = $lastParam;
629 }
630 else {
631 throw new CRM_Core_Exception("Either 'processor_id' (recommended) or 'processor_name' (deprecated) is required for payment callback.");
632 }
633 }
634
635 self::logPaymentNotification($params);
636
637 $sql = "SELECT ppt.class_name, ppt.name as processor_name, pp.id AS processor_id
638 FROM civicrm_payment_processor_type ppt
639 INNER JOIN civicrm_payment_processor pp
640 ON pp.payment_processor_type_id = ppt.id
641 AND pp.is_active";
642
643 if (isset($params['processor_id'])) {
644 $sql .= " WHERE pp.id = %2";
645 $args[2] = array($params['processor_id'], 'Integer');
646 $notFound = ts("No active instances of payment processor %1 were found.", array(1 => $params['processor_id']));
647 }
648 else {
649 // This is called when processor_name is passed - passing processor_id instead is recommended.
650 $sql .= " WHERE ppt.name = %2 AND pp.is_test = %1";
651 $args[1] = array(
652 (CRM_Utils_Array::value('mode', $params) == 'test') ? 1 : 0,
653 'Integer',
654 );
655 $args[2] = array($params['processor_name'], 'String');
656 $notFound = ts("No active instances of payment processor '%1' were found.", array(1 => $params['processor_name']));
657 }
658
659 $dao = CRM_Core_DAO::executeQuery($sql, $args);
660
661 // Check whether we found anything at all.
662 if (!$dao->N) {
663 CRM_Core_Error::fatal($notFound);
664 }
665
666 $method = 'handle' . $method;
667 $extension_instance_found = FALSE;
668
669 // In all likelihood, we'll just end up with the one instance returned here. But it's
670 // possible we may get more. Hence, iterate through all instances ..
671
672 while ($dao->fetch()) {
673 // Check pp is extension - is this still required - surely the singleton below handles it.
674 $ext = CRM_Extension_System::singleton()->getMapper();
675 if ($ext->isExtensionKey($dao->class_name)) {
676 $paymentClass = $ext->keyToClass($dao->class_name, 'payment');
677 require_once $ext->classToPath($paymentClass);
678 }
679
680 $processorInstance = Civi\Payment\System::singleton()->getById($dao->processor_id);
681
682 // Should never be empty - we already established this processor_id exists and is active.
683 if (empty($processorInstance)) {
684 continue;
685 }
686
687 // Does PP implement this method, and can we call it?
688 if (!method_exists($processorInstance, $method) ||
689 !is_callable(array($processorInstance, $method))
690 ) {
691 // on the off chance there is a double implementation of this processor we should keep looking for another
692 // note that passing processor_id is more reliable & we should work to deprecate processor_name
693 continue;
694 }
695
696 // Everything, it seems, is ok - execute pp callback handler
697 $processorInstance->$method();
698 $extension_instance_found = TRUE;
699 }
700
701 if (!$extension_instance_found) {
702 $message = "No extension instances of the '%1' payment processor were found.<br />" .
703 "%2 method is unsupported in legacy payment processors.";
704 CRM_Core_Error::fatal(ts($message, array(1 => $params['processor_name'], 2 => $method)));
705 }
706 }
707
708 /**
709 * Check whether a method is present ( & supported ) by the payment processor object.
710 *
711 * @param string $method
712 * Method to check for.
713 *
714 * @return bool
715 */
716 public function isSupported($method = 'cancelSubscription') {
717 return method_exists(CRM_Utils_System::getClassName($this), $method);
718 }
719
720 /**
721 * Get url for users to manage this recurring contribution for this processor.
722 *
723 * @param int $entityID
724 * @param null $entity
725 * @param string $action
726 *
727 * @return string
728 */
729 public function subscriptionURL($entityID = NULL, $entity = NULL, $action = 'cancel') {
730 // Set URL
731 switch ($action) {
732 case 'cancel':
733 $url = 'civicrm/contribute/unsubscribe';
734 break;
735
736 case 'billing':
737 //in notify mode don't return the update billing url
738 if (!$this->isSupported('updateSubscriptionBillingInfo')) {
739 return NULL;
740 }
741 $url = 'civicrm/contribute/updatebilling';
742 break;
743
744 case 'update':
745 $url = 'civicrm/contribute/updaterecur';
746 break;
747 }
748
749 $session = CRM_Core_Session::singleton();
750 $userId = $session->get('userID');
751 $contactID = 0;
752 $checksumValue = '';
753 $entityArg = '';
754
755 // Find related Contact
756 if ($entityID) {
757 switch ($entity) {
758 case 'membership':
759 $contactID = CRM_Core_DAO::getFieldValue("CRM_Member_DAO_Membership", $entityID, "contact_id");
760 $entityArg = 'mid';
761 break;
762
763 case 'contribution':
764 $contactID = CRM_Core_DAO::getFieldValue("CRM_Contribute_DAO_Contribution", $entityID, "contact_id");
765 $entityArg = 'coid';
766 break;
767
768 case 'recur':
769 $sql = "
770 SELECT con.contact_id
771 FROM civicrm_contribution_recur rec
772 INNER JOIN civicrm_contribution con ON ( con.contribution_recur_id = rec.id )
773 WHERE rec.id = %1
774 GROUP BY rec.id";
775 $contactID = CRM_Core_DAO::singleValueQuery($sql, array(1 => array($entityID, 'Integer')));
776 $entityArg = 'crid';
777 break;
778 }
779 }
780
781 // Add entity arguments
782 if ($entityArg != '') {
783 // Add checksum argument
784 if ($contactID != 0 && $userId != $contactID) {
785 $checksumValue = '&cs=' . CRM_Contact_BAO_Contact_Utils::generateChecksum($contactID, NULL, 'inf');
786 }
787 return CRM_Utils_System::url($url, "reset=1&{$entityArg}={$entityID}{$checksumValue}", TRUE, NULL, FALSE, TRUE);
788 }
789
790 // Else login URL
791 if ($this->isSupported('accountLoginURL')) {
792 return $this->accountLoginURL();
793 }
794
795 // Else default
796 return isset($this->_paymentProcessor['url_recur']) ? $this->_paymentProcessor['url_recur'] : '';
797 }
798
799 }