1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02: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:
epriestley 2015-05-18 10:28:19 -07:00
parent 44cf60dfd2
commit 1970ebcd7b

View file

@ -15,6 +15,13 @@ final class PhortuneSubscriptionWorker extends PhabricatorWorker {
return;
}
$currency = $subscription->getCostForBillingPeriodAsCurrency(
$last_epoch,
$next_epoch);
if (!$currency->isPositive()) {
return;
}
$account = $subscription->getAccount();
$merchant = $subscription->getMerchant();
@ -48,10 +55,6 @@ final class PhortuneSubscriptionWorker extends PhabricatorWorker {
$purchase = $cart->newPurchase($actor, $product);
$currency = $subscription->getCostForBillingPeriodAsCurrency(
$last_epoch,
$next_epoch);
$purchase
->setBasePriceAsCurrency($currency)
->setMetadataValue('subscriptionPHID', $subscription->getPHID())