Code Monkey home page Code Monkey logo

Comments (11)

ShenChen93 avatar ShenChen93 commented on July 3, 2024

Hi @danieldhz ,

I just want to collect more info. I guess you are following the guideline of ISP: https://developer.amazon.com/en-US/docs/alexa/in-skill-purchase/add-isps-to-a-skill.html#handle-results. Thus I guess you've done the Prerequisites and added the ISP to your custom skill. So when you list all ISPs, does the response looks good ?

I think you are still in development stage and thus this request is just a test purchase right ? Are you able to get the handle back after the purchase ?

Since we are the SDK team and not expert at ISP service, I just want to collect as much info as possible thus I could ask for service teams help if needed.

Thanks,
Shen

from alexa-skills-kit-sdk-for-python.

Daniyaldehleh avatar Daniyaldehleh commented on July 3, 2024

@ShenChen-Amazon Hi ShenChen, Thanks for your reply.

  1. I am not sure what you mean by listing ISPs, is there a way I can check that list?
  2. Yes, Exactly its a test purchase.
  3. If by handle back you mean JSON output, yes I did share it with you.
    Sure man! Sorry if some my answers weren't what you were looking for. If they weren't could you please elaborate or let me know how I can provide the answer to your question.

from alexa-skills-kit-sdk-for-python.

ShenChen93 avatar ShenChen93 commented on July 3, 2024

@danieldhz ,

For listing ISPs, there's an example in node, but it seems you already did the same by these code. It seems you save the result in session_attributes["entitledProducts"]. Could you please check if it contains the productID you use in GoogleIntentHandler ?

For the handle back, what I mean is the Connections.Respons. The JSON output you provided looks like not a Connection.Response. Thus I guess this error is thrown at the EntitledProductsCheckInterceptor where you trying to list all ISPs. Could you help me confirm that ?

Btw, are you able to see the ISP in developer console TOOLS In-Skill Products tab ?

Thanks,
Shen

from alexa-skills-kit-sdk-for-python.

Daniyaldehleh avatar Daniyaldehleh commented on July 3, 2024

so do you want me to print(session_attributes["entitledProducts"])?
I am not sure where the error is thrown at but when I call the GoogleHandlerIntent it gives that error.
Hopefully this would shed some light, I have adjusted the line number in the error to the sample repo

[ERROR]	2020-08-27T21:10:10.461Z	6f1f5334-7e14-409f-9a99-996efb43a3ba	The authentication token is invalid or doesn't have access to make this request
Traceback (most recent call last):
  File "/opt/python/lib/python3.8/site-packages/ask_sdk_runtime/dispatch.py", line 118, in dispatch
    output = self.__dispatch_request(handler_input)  # type: Union[Output, None]
  File "/opt/python/lib/python3.8/site-packages/ask_sdk_runtime/dispatch.py", line 114, in __dispatch_request
    output = supported_handler_adapter.execute(
  File "/opt/python/lib/python3.8/site-packages/ask_sdk_runtime/dispatch_components/request_components.py", line 437, in execute
    return handler.handle(handler_input)
  File "/var/task/lambda_function.py", line 166, in handle
    in_skill_response=in_skill_product_response(handler_input)
  File "/var/task/lambda_function.py", line 100, in in_skill_product_response
    return ms.get_in_skill_products(locale)
  File "/opt/python/lib/python3.8/site-packages/ask_sdk_model/services/monetization/monetization_service_client.py", line 129, in get_in_skill_products
    api_response = self.invoke(
  File "/opt/python/lib/python3.8/site-packages/ask_sdk_model/services/base_service_client.py", line 151, in invoke
    raise ServiceException(message=exception_metadata.message,
I have adjust the line number in accordance with the [repo](https://github.com/danieldhz/Alexa_Timer/blob/master/lambda/ISP.py)

Yes, the ISP is added to the developer --> tools.

from alexa-skills-kit-sdk-for-python.

ShenChen93 avatar ShenChen93 commented on July 3, 2024

@danieldhz
Thanks for providing the error trace. From the error trace: File "/opt/python/lib/python3.8/site-packages/ask_sdk_model/services/monetization/monetization_service_client.py", line 129, in get_in_skill_products
I can confirm that the error is thrown during listing all ISPs in the EntitledProductsCheckInterceptor.

The EntitledProductsCheckInterceptor is a request Interceptor which will be executed before the
GoogleHandler handle the request. It try to get all ISPs and store it in session attribute. You could check whether the error is thrown on this line to verify.

Btw, the requestEvelope you provided is slightly modified right ? Otherwise the accessToken can't be that short..

Thanks,
Shen

from alexa-skills-kit-sdk-for-python.

Daniyaldehleh avatar Daniyaldehleh commented on July 3, 2024

@ShenChen-Amazon I am super glad that we are getting close to figuring out the issue. Sorry if I didn't share that error message earlier. Do you want me to check an error on line 121? Shall i do this by logger.info("Error calling InSkillProducts API: {}".format(result)) or print the whole script?

Correct, I trimmed it manually to save some space.

from alexa-skills-kit-sdk-for-python.

ShenChen93 avatar ShenChen93 commented on July 3, 2024

Hi @danieldhz
Would be great if you could use try catch block, move line 121 to try block and log the error object at the catch block.

To summarize, you've added a ISP product to your skill, however, when you call the get_in_skill_products function, it says you don't have the permission to access the ISPs. Since I don't have more detailed error info, would need to reach out to service team for further investigation. Could you please provide with your VendorID and Skill id ? VendorID could be seen at: https://developer.amazon.com/mycid.html after login.

from alexa-skills-kit-sdk-for-python.

Daniyaldehleh avatar Daniyaldehleh commented on July 3, 2024

I would definitely do try catch & let you know about the error. I actually get the error when I call GoogleIntentHandler, as the get_in_skill_products function is not even added to the .add_request_handler. My Vendor ID: M9ATP1D4JWXUB
Skill Id: amzn1.ask.skill.78f63c60-18ac-4944-a2da-5642ad214373

from alexa-skills-kit-sdk-for-python.

ShenChen93 avatar ShenChen93 commented on July 3, 2024

get_in_skill_products is called inside EntitledProductsCheckInterceptor, and this is added as requestInterceptor instead of requestHandler: https://github.com/danieldhz/Alexa_Timer/blob/master/lambda/ISP.py#L194.

Did you mean the error exist even if you don't added it to add_global_request_interceptor ?

from alexa-skills-kit-sdk-for-python.

Daniyaldehleh avatar Daniyaldehleh commented on July 3, 2024

I am not sure about how get_in_skill_products is inside EntitledProductsCheckInterceptor as it's not indented inwards? btw do you know what type of error I shall raise?

from alexa-skills-kit-sdk-for-python.

Shreyas-vgr avatar Shreyas-vgr commented on July 3, 2024

Duplicate of alexa-samples/skill-sample-python-fact-in-skill-purchases#8

from alexa-skills-kit-sdk-for-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.