question

jimbo10 avatar image
jimbo10 asked

Facts Sample w/In Skill Purchasing example builds testing give skill error Something went wrong in loading your purchase history

Checking in AWS Lambda index.js there is the code snippet

------------------------------------------------------------------------------------------

function reportPurchasedProductsError(err) {
console.log(`Error calling InSkillProducts API: ${err}`);

return handlerInput.responseBuilder
.speak('Something went wrong in loading your purchase history')
.getResponse();
},-----------------------------------------------------------------------------------------

Having searched via Google all the developer documentation and read all the documentation at

https://developer.amazon.com/docs/in-skill-purchase/add-isps-to-a-skill.html

The error

Something went wrong in loading your purchase history

is not documented. There are no errors in AWS Lambda logs possibly because the error is spoken

The original example is at

https://github.com/alexa/skill-sample-nodejs-fact-in-skill-purchases

and deploys to Alexa console but Test tab in the Developer Portal. To start using your skill, just type : Test tab in the Developer Portal. To start using your skill, just type : Alexa, open premium facts sample.

alexa skills kitpurchasingisp
1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I live in en-GB the UK so tried making Lambda eu-west Ireland end point and ENGLAND (UK) test version for development console

Could this be related to issue

https://github.com/alexa/skill-sample-nodejs-fact-in-skill-purchases/issues/11 "No way to test ISP from outside US"

0 Likes 0 ·
jimbo10 avatar image
jimbo10 answered

Have now found Lambda Cloud Watch Logs with internal server error

AWS Lambda Cloud Watch log entries extracted

2018-07-15T18:17:32.678Z 55fdae57-885b-11e8-becf-6fc2ca7d86bb Error calling InSkillProducts API: ServiceError: Internal Server Error

2018-07-15T18:18:56.969Z 8912c441-885b-11e8-b108-739321a8241b Error calling InSkillProducts API: ServiceError: Internal Server Error

Here is the response builder for the Testing with the Alexa Developer console

2018-07-15T18:17:32.678Z 55fdae57-885b-11e8-becf-6fc2ca7d86bb RESPONSE BUILDER =
"requestEnvelope": {
"version": "1.0",
"session": {
"new": true,
"sessionId": "amzn1.echo-api.session.398e9a20-3518-4cd1-82c5-b36e648f15fb",
"application": {
"applicationId": "amzn1.ask.skill.9ccf2e34-33b2-4406-899c-a1dd454bcaab"
},
"user": {
"userId": "amzn1.ask.account.AFV..................."
}
},
"context": {
"System": {
"application": {
"applicationId": "amzn1.ask.skill.9ccf2e34-33b2-4406-899c-a1dd454bcaab"
},
"user": {
"userId": "amzn1.ask.account.AFV......................."
},
"device": {
"deviceId": "amzn1.ask.device.AFKMFFBQHTJBGYWDGLUFUH6MROW522WEL4FRFIEMWPZIXCBOZTZQ4VM4WTXQRO5UXUK5TYRQBFRCRGON6WQS67YMVMJWEO3HXZFHRCVS4F6XM3MH7NGDL76LV2S423Z5JANOYHMUNDAAORG22BA56WV2EWEQ",
"supportedInterfaces": {}
},
"apiEndpoint": "https://api.eu.amazonalexa.com",
"apiAccessToken": "ey................."
}
},
"request": {
"type": "LaunchRequest",
"requestId": "amzn1.echo-api.request.7e551fad-5342-4eb6-a504-5c27b5d079d1",
"timestamp": "2018-07-15T18:17:29Z",
"locale": "en-GB",
"shouldLinkResultBeReturned": false
}
},
"context": {
"callbackWaitsForEmptyEventLoop": true,
"logGroupName": "/aws/lambda/ask-premium-facts-default",
"logStreamName": "2018/07/15/[$LATEST]35f1e9295e5e40338323879783477dbb",
"functionName": "ask-premium-facts-default",
"memoryLimitInMB": "128",
"functionVersion": "$LATEST",
"invokeid": "55fdae57-885b-11e8-becf-6fc2ca7d86bb",
"awsRequestId": "55fdae57-885b-11e8-becf-6fc2ca7d86bb",
"invokedFunctionArn": "arn:aws:lambda:us-east-1:5495116NNNN:function:ask-premium-facts-default"
},
"attributesManager": {},
"responseBuilder": {},
"serviceClientFactory": {
"apiConfiguration": {
"apiClient": {},
"apiEndpoint": "https://api.eu.amazonalexa.com",
"authorizationValue": "eyJ0e......................"
}
}
}

See how the "us-east" endpoint has the InSkillProducts API:

"invokedFunctionArn": "arn:aws:lambda:us-east-1:5495116NNNN:function:ask-premium-facts-default"

The "eu-west" endpoint does NOT appear to have InSkillProducts API:

arn:aws:lambda:eu-west-1:5495116NNNN:function:ask-premium-facts-default

will not work in eu-west AWS Lambda Test, with internal server error.

The us-east works but cannot access the eu-west purchase history even though both api endpoints are registered,

if you live in the UK you are stuck with eu-west hard coded apiEndpoint": "https://api.eu.amazonalexa.com",

This explains why we get the undocumented error

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jimbo10 avatar image
jimbo10 answered

in the FAQ

In-Skill Purchasing FAQ

https://developer.amazon.com/docs/in-skill-purchase/isp-faqs.html

is the quote as of 16th July 2018

------------------------------------------------------------------------------------------------------------

In which countries may I publish skills that offer in-skill purchases?

At this time, only skills published in the US Alexa Skill Store may offer in-skill purchases. We plan to expand in-skill purchase capabilities to additional countries soon.

-------------------------------------------------------------------------------------------------------------

So for now Developers in the UK will have to wait to get the sample working with the Error

Something went wrong in loading your purchase history

My only thing would be to change the message

Unable to load you purchase history as your country does not support

in-skill purchases. US Only

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

KAIYIN@AMAZON.COM avatar image
KAIYIN@AMAZON.COM answered

This is a known limitation, we are working on fixing the error message, and potentially open test ISP to developers in other regions for US ISP.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.