1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01: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(
PhortuneProduct $product,
PhortunePurchase $purchase) {
// TODO: Callback the subscription.
return;
return $this->getSubscription()->didPurchaseProduct(
$product,
$purchase);
}
public function didRefundProduct(

View file

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

View file

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