Skip to content

Commit 67533d2

Browse files
authored
Adds function to confirm a marketplace subscription
We need a way to PUT /apig//marketplace-subscriptions/ to tell the dev lambdas to check the user's marketplace id and match them up to both our cognito id and subscribe them to the plan they purchased.
1 parent efdddcb commit 67533d2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

dev-portal/src/services/api-catalog.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ export function addSubscription(usagePlanId) {
7070
})
7171
}
7272

73+
export function confirmMarketplaceSubscription(usagePlanId, token) {
74+
if (!usagePlanId) {
75+
return
76+
}
77+
78+
return getApiGatewayClient().then(apiGatewayClient => {
79+
return apiGatewayClient.put('/marketplace-subscriptions/' + usagePlanId, {}, {"token" : token})
80+
})
81+
}
82+
7383
export function unsubscribe(usagePlanId) {
7484
return getApiGatewayClient().then(apiGatewayClient => {
7585
return apiGatewayClient.delete(`/subscriptions/${usagePlanId}`, {}, {}).then(function(result) {

0 commit comments

Comments
 (0)