diff --git a/ghost/members-importer/lib/importer.js b/ghost/members-importer/lib/importer.js index 01d6f9c0bc..ed00c8c54a 100644 --- a/ghost/members-importer/lib/importer.js +++ b/ghost/members-importer/lib/importer.js @@ -87,7 +87,7 @@ module.exports = class MembersCSVImporter { const mappedCSV = membersCSV.unparse(rows, columns); const hasStripeData = !!(rows.find(function rowHasStripeData(row) { - return !!row.stripe_customer_id || !!row.complimentary_plan; + return !!row.stripe_customer_id; })); await fs.writeFile(outputFilePath, mappedCSV); diff --git a/ghost/members-importer/test/importer.test.js b/ghost/members-importer/test/importer.test.js index 69fdf7365e..14ff8f3b78 100644 --- a/ghost/members-importer/test/importer.test.js +++ b/ghost/members-importer/test/importer.test.js @@ -269,6 +269,15 @@ describe('Importer', function () { fileContents.should.match(/^email,subscribed_to_emails,labels\r\n/); }); + + it('checks for stripe data in the imported file', async function () { + const membersImporter = buildMockImporterInstance(); + + const result = await membersImporter.prepare(`${csvPath}/member-csv-export.csv`); + + should.exist(result.metadata); + should.equal(result.metadata.hasStripeData, true); + }); }); describe('perform', function () {