Skip to content

Commit e2b31fb

Browse files
committed
Use usage plan productCode field for marketplace subscription
1 parent f1522ed commit e2b31fb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lambdas/_common/customers-controller.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,10 @@ function getUsagePlanForProductCode(productCode, error, callback) {
211211
error(err)
212212
} else {
213213
console.log(`Got usage plans ${JSON.stringify(data.items)}`)
214-
214+
215215
// note: ensure that only one usage plan maps to a given marketplace product code
216216
const usageplan = data.items.find(function (item) {
217-
// todo: use the description field for now, but move to productCode field once SDK is updated
218-
// return item.productCode !== undefined && item.description === productCode
219-
return item.description !== undefined && item.description.includes(productCode)
217+
return item.productCode !== undefined && item.productCode === productCode
220218
})
221219
if (usageplan !== undefined) {
222220
console.log(`Found usage plan matching ${productCode}`)

0 commit comments

Comments
 (0)