mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 05:52:40 +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 {
|
return {
|
||||||
create: createMember,
|
create: createMember,
|
||||||
list: listMembers,
|
list: listMembers,
|
||||||
get,
|
get,
|
||||||
destroy: deleteMember
|
destroy
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user