spacejewel-ipn-communication/source/defs/Hookmanager/Hookmanager.php
2018-06-07 10:56:13 +00:00

55 lines
1.6 KiB
PHP

<?php
// The hookmanager is the web-exposed class that allows you to manage a user within the billing system.
// This system takes care of CRUD operations on customers. It doesn't keep track of order but it does suspend
// you if you don't pay.
class Hookmanager
{
public function EventSubscriptionCreated()
{
}
public function EventSubscriptionUpdated()
{
// Update user information if necessary
}
public function EventSubscriptionCancelled()
{
// Suspend user's domain name as stated on DB
// Delete after 30 days
}
public function EventSubscriptionPaymentSuccess()
{
// Renew user's subscription within billing system
// Install hosting account if this is the user's first time and send out instructions email
}
// TODO: Lenient business logic
public function EventSubscriptionPaymentFailed()
{
// Add payment strike to user account
// After three strikes, warn user that the system has waived further attempts. Suspend their account
// Give user an ultimatum: Pay or remain suspended
// If user fails to pay during the next 7 days, permanently suspend their account (Reject further payments. Remove user from paddle first)
// If payment is successful afterwards, remove all payment strikes (Success logic should execute automatically)
}
public function EventSubscriptionPaymentRefunded()
{
// Ban customer from billing system
// Delete all customer data
}
}