Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / phortune / xaction / subscription / PhortuneSubscriptionAutopayTransaction.php
blob5cf8989a8552c4d4c42bc976b936091c100b37ee
1 <?php
3 final class PhortuneSubscriptionAutopayTransaction
4 extends PhortuneSubscriptionTransactionType {
6 const TRANSACTIONTYPE = 'autopay';
8 public function generateOldValue($object) {
9 return $object->getDefaultPaymentMethodPHID();
12 public function applyInternalEffects($object, $value) {
13 $object->setDefaultPaymentMethodPHID($value);
16 public function getTitle() {
17 $old_phid = $this->getOldValue();
18 $new_phid = $this->getNewValue();
20 if ($old_phid && $new_phid) {
21 return pht(
22 '%s changed the automatic payment method for this subscription.',
23 $this->renderAuthor());
24 } else if ($new_phid) {
25 return pht(
26 '%s configured an automatic payment method for this subscription.',
27 $this->renderAuthor());
28 } else {
29 return pht(
30 '%s stopped automatic payments for this subscription.',
31 $this->renderAuthor());
35 public function shouldTryMFA(
36 $object,
37 PhabricatorApplicationTransaction $xaction) {
38 return true;