Azure / Commercial-Marketplace-SaaS-Accelerator

A reference example with sample code for developers interested publishing transactable, Software as a-Service offers in the Microsoft commercial marketplace.
MIT License
179 stars 275 forks source link

Wrong Term values in the external web notification feature #640

Closed santhoshb-msft closed 5 months ago

santhoshb-msft commented 5 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to Landing page
  2. Click on Subscribe
  3. External webnotification is sending incorrect term details

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

adrian-spear commented 5 months ago

I believe this issue was raised as a result of my ticket with Commercial Marketplace support.

I deployed my instances of SaaS Accelerator using cloud shell to my Azure tenant.

To reproduce:

  1. Create marketplace offering with monthly (P1M) and annual (P1Y) terms
  2. Subscribe to the offer, specifying annual term
  3. When prompted, proceed to configure account in the SAAS Portal
  4. Click 'Subscribe'

Checking the database, the subscription has been created but the start and end dates are '0001-01-01 00:00:00.0000000' and term is 'P1M'.

I have a simple webhook which logs the body of any inbound request. This receives the following when 'Subscribe' is clicked - note the term attribute values: { "applicationName": "TeamFolio Employee Skills Hub DEV", "eventType": "LandingPage", "payloadFromLandingpage": { "landingpageSubscriptionParams": [], "id": "****", "publisherId": "****", "offerId": "****", "name": "20240129_1252_TFEP_1Y", "saasSubscriptionStatus": "PendingFulfillmentStart", "planId": "****", "quantity": 1, "purchaser": { "tenantId": "****", "emailId": "****", "objectId": "****" }, "beneficiary": { "tenantId": "****", "emailId": "****", "puid": null, "objectId": "****" }, "term": { "endDate": "0001-01-01T00:00:00+00:00", "startDate": "0001-01-01T00:00:00+00:00", "termUnit": "P1M" } }, "payloadFromWebhook": {} }

If I use the Admin site and fetch all subscriptions - it corrects the start and end dates in the database - not the term, however.

As I understand the fulfilment API documentation - the response from fulfilment API to a POST request to resolve a token should include the start, end and term unit values. I expect the message to the webhook to contain those values - not defaults. I want to implement auto fulfilment but can only do so if the correct information is provided to the webhook.

I need to resolve this asap so please contact me with any further actions or questions at your earliest convenience.

Thanks.