mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +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:
parent
8d11e127ff
commit
301750f6e6
3 changed files with 20 additions and 2 deletions
|
@ -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(
|
||||
|
|
|
@ -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 )----------------------------------------- */
|
||||
|
||||
|
|
|
@ -48,4 +48,12 @@ abstract class PhortuneSubscriptionImplementation extends Phobject {
|
|||
PhortunePurchase $purchase) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function didPurchaseProduct(
|
||||
PhortuneSubscription $subscription,
|
||||
PhortuneProduct $product,
|
||||
PhortunePurchase $purchase) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue