mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 12:21:36 +03:00
🐛 Fixed members importer failing to link paid subscriptions
no refs The latest version of Stripe doesn't return the `subscriptions` object on `Customer` resource by default and needs an extra param to do so. As we recently updated Members to use the latest Stripe version, the importer tries to fetch all subscriptions of a customer to map in Ghost but was failing due to missing `subscriptions` data. Fix updates the Stripe API to include `subscriptions` by default in response.
This commit is contained in:
parent
881077ad9d
commit
9010a62d54
@ -216,7 +216,9 @@ module.exports = class MemberRepository {
|
|||||||
if (!this._stripeAPIService.configured) {
|
if (!this._stripeAPIService.configured) {
|
||||||
throw new Error('Cannot link Stripe Customer with no Stripe Connection');
|
throw new Error('Cannot link Stripe Customer with no Stripe Connection');
|
||||||
}
|
}
|
||||||
const customer = await this._stripeAPIService.getCustomer(data.customer_id);
|
const customer = await this._stripeAPIService.getCustomer(data.customer_id, {
|
||||||
|
expand: ['subscriptions']
|
||||||
|
});
|
||||||
|
|
||||||
if (!customer) {
|
if (!customer) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user