1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Add an after-purchase hook to subscriptions in Phortune

Summary:
Ref T12681. We need this to update the "paid until" window on support pacts.

(Instance billing doesn't use this because everything just checks if you have unpaid invoices, nothing actually happens when you pay them.)

Test Plan: See D18187.

Reviewers: chad, amckinley

Reviewed By: chad

Maniphest Tasks: T12681

Differential Revision: https://secure.phabricator.com/D18188
This commit is contained in:
epriestley 2017-07-07 16:33:45 -07:00
parent 8d11e127ff
commit 301750f6e6
3 changed files with 20 additions and 2 deletions

View file

@ -50,8 +50,9 @@ final class PhortuneSubscriptionProduct
public function didPurchaseProduct( public function didPurchaseProduct(
PhortuneProduct $product, PhortuneProduct $product,
PhortunePurchase $purchase) { PhortunePurchase $purchase) {
// TODO: Callback the subscription. return $this->getSubscription()->didPurchaseProduct(
return; $product,
$purchase);
} }
public function didRefundProduct( public function didRefundProduct(

View file

@ -232,6 +232,15 @@ final class PhortuneSubscription extends PhortuneDAO
$purchase); $purchase);
} }
public function didPurchaseProduct(
PhortuneProduct $product,
PhortunePurchase $purchase) {
return $this->getImplementation()->didPurchaseProduct(
$this,
$product,
$purchase);
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */ /* -( PhabricatorPolicyInterface )----------------------------------------- */

View file

@ -48,4 +48,12 @@ abstract class PhortuneSubscriptionImplementation extends Phobject {
PhortunePurchase $purchase) { PhortunePurchase $purchase) {
return null; return null;
} }
public function didPurchaseProduct(
PhortuneSubscription $subscription,
PhortuneProduct $product,
PhortunePurchase $purchase) {
return null;
}
} }