mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
Updated setComplimentarySubscription to error without a Stripe connection
no-issue This allows the consumer (e.g. the importer) to surfaces errors when importing comped members
This commit is contained in:
parent
d70aab83f6
commit
3abb0c543b
@ -145,6 +145,15 @@ module.exports = function ({
|
||||
return stripe.linkStripeCustomer(id, member, options);
|
||||
}
|
||||
|
||||
async function setComplimentarySubscription(member, options) {
|
||||
if (!stripe) {
|
||||
throw new common.errors.BadRequestError({
|
||||
message: 'Cannot link create Complimentary Subscription without a Stripe connection'
|
||||
});
|
||||
}
|
||||
return stripe.setComplimentarySubscription(member, options);
|
||||
}
|
||||
|
||||
return {
|
||||
create,
|
||||
update,
|
||||
@ -152,7 +161,7 @@ module.exports = function ({
|
||||
get,
|
||||
destroy,
|
||||
updateSubscription,
|
||||
setComplimentarySubscription: safeStripe('setComplimentarySubscription'),
|
||||
setComplimentarySubscription,
|
||||
setComplimentarySubscriptionById,
|
||||
cancelComplimentarySubscription: safeStripe('cancelComplimentarySubscription'),
|
||||
cancelStripeSubscriptions: safeStripe('cancelComplimentarySubscription'),
|
||||
|
Loading…
Reference in New Issue
Block a user