Code Monkey home page Code Monkey logo

alexa.net.inskillpricing's People

Contributors

stoiveyp avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

javierpuntonet

alexa.net.inskillpricing's Issues

Was working then stopped :(

So it seemed to be working well but then i got this error,

{
"errorType": "ArgumentOutOfRangeException",
"errorMessage": "Unknown request type: Connections.Response.\nParameter name: Type",
"stackTrace": [
"at Alexa.NET.Request.Type.RequestConverter.Create(String requestType)",
"at Alexa.NET.Request.Type.RequestConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)",
"at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)",
"at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)",
"at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)",
"at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)",
"at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)",
"at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)",
"at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)",
"at Amazon.Lambda.Serialization.Json.JsonSerializer.Deserialize[T](Stream requestStream)",
"at lambda_method(Closure , Stream , Stream , LambdaContextInternal )"
]
}

This was the same issue I had without the package I tried uninstalling and reinstalling but I can't figure out why it came back.

Add Request Handler support

I'm struggling with adding request handler support. I tried my own implementation below and the way suggested in the docs

  ConnectionRequestHandler.AddToRequestConverter();
  var skillRequest = JsonConvert.DeserializeObject<SkillRequest>(requestBody);
  var requestType = skillRequest.GetRequestType();

            if (requestType == typeof(ConnectionResponseRequest))
            {
                     var x = skillRequest as ConnectionResponseRequest;
            }

I tried the switch statement as suggested in the docs but I get this error

image

Connections.Response Overloading and In Skill Purchasing.

The response type "Connections.Response" is used in a lot more places than In Skill Purchasing. For the alexa amzonpay integration its used for a couple different requests. The API docs are here. The responses that alexa makes to the Setup and Charge steps are both using Connections.Response. I'm adding models following this pattern for an amazonpay-alexa integration and am happy to pr them here though I'm not sure if this is the right repo for them. Is this project just intended for in app purchasing and such or all alexa purchasing integrations? The name makes it a little unclear to me.

Add Request Handler Support - Readme.md

For adding the Request Handler support, your markdown suggest using
ConnectionResponseHandler.AddToRequestConverter();

when it should be

ConnectionRequestHandler.AddToRequestConverter();

Thanks for making this library, super helpful!

Purchase Result missing "PENDING_PURCHASE"

In addition to the Purchase Result in 'PurchaseResult.cs':

public const string Accepted = "ACCEPTED";
public const string Declined = "DECLINED";
public const string AlreadyPurchased = "ALREADY_PURCHASED";
public const string Error = "ERROR";

There is a "PENDING_PURCHASE" option. This occurs in a kids skill where a parent needs approval. The payload is returned as a ConnectionResponse (example from my payload):

"request": {
		"type": "Connections.Response",
		"requestId": "amzn1.echo-api.request.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
		"timestamp": "2021-04-29T18:25:34Z",
		"locale": "en-US",
		"status": {
			"code": "200",
			"message": "OK"
		},
		"name": "Upsell",
		"payload": {
			"purchaseResult": "PENDING_PURCHASE",
			"productId": "amzn1.echo-api.request.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
		},
		"token": "correlationToken"
	}

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.