mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Never generate $0.00 invoices
Summary: Ref T7769. It might possibly make sense to generate these some day, but for now they aren't payable and we have no use for them. Test Plan: - Generated $0.00 invoices, saw code decline to invoice. - Generated a $7.99 invoice, got an invoice. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7769 Differential Revision: https://secure.phabricator.com/D12878
This commit is contained in:
parent
44cf60dfd2
commit
1970ebcd7b
1 changed files with 7 additions and 4 deletions
|
@ -15,6 +15,13 @@ final class PhortuneSubscriptionWorker extends PhabricatorWorker {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$currency = $subscription->getCostForBillingPeriodAsCurrency(
|
||||||
|
$last_epoch,
|
||||||
|
$next_epoch);
|
||||||
|
if (!$currency->isPositive()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$account = $subscription->getAccount();
|
$account = $subscription->getAccount();
|
||||||
$merchant = $subscription->getMerchant();
|
$merchant = $subscription->getMerchant();
|
||||||
|
|
||||||
|
@ -48,10 +55,6 @@ final class PhortuneSubscriptionWorker extends PhabricatorWorker {
|
||||||
|
|
||||||
$purchase = $cart->newPurchase($actor, $product);
|
$purchase = $cart->newPurchase($actor, $product);
|
||||||
|
|
||||||
$currency = $subscription->getCostForBillingPeriodAsCurrency(
|
|
||||||
$last_epoch,
|
|
||||||
$next_epoch);
|
|
||||||
|
|
||||||
$purchase
|
$purchase
|
||||||
->setBasePriceAsCurrency($currency)
|
->setBasePriceAsCurrency($currency)
|
||||||
->setMetadataValue('subscriptionPHID', $subscription->getPHID())
|
->setMetadataValue('subscriptionPHID', $subscription->getPHID())
|
||||||
|
|
Loading…
Reference in a new issue