mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 22:11:09 +03:00
Ensured that destroying member removes stripe customer
no-issue This also mean sthe subscription will be cancelled
This commit is contained in:
parent
ec3948287f
commit
4ead495b45
@ -31,10 +31,21 @@ module.exports = function ({
|
||||
}
|
||||
}
|
||||
|
||||
async function destroy(data, options) {
|
||||
const member = await getMember(data, options);
|
||||
if (!member) {
|
||||
return;
|
||||
}
|
||||
if (stripe) {
|
||||
await stripe.removeCustomer(member);
|
||||
}
|
||||
return deleteMember(data, options);
|
||||
}
|
||||
|
||||
return {
|
||||
create: createMember,
|
||||
list: listMembers,
|
||||
get,
|
||||
destroy: deleteMember
|
||||
destroy
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user