Start work on membership renewal endpoint, ++
This commit is contained in:
1 parent
ee6fe2f9ef
commit
e29be38aab
4 files changed
+28
-101
No files matched your search
@@ -259,4 +259,16 @@ function get_active_card_number($user) {
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
function add_or_renew_membership($user, $data) {
|
||||
// TODO stub
|
||||
throw new Exception("TODO: Not implemented!");
|
||||
|
||||
/* Membership expiry */
|
||||
/* One year from today (default) */
|
||||
if( !isset($data['purchased']) ) {
|
||||
$data['purchased'] = date_create();
|
||||
}
|
||||
/* ...or one year from specified date */
|
||||
$expires = date_format(date_modify($data['purchased'], "+1 year"), "Y-m-d");
|
||||
}
|
||||
Reference in new issue
Block a user