Skip to content

Latest commit

 

History

History
52 lines (42 loc) · 1.13 KB

README.md

File metadata and controls

52 lines (42 loc) · 1.13 KB

Alexa.NET.InSkillPricing

A simple package built to work with Alexa In Skill Products

Add Directive Support

	PaymentDirective.AddSupport();

Getting all products for the current user and skill

using Alexa.NET.InSkillPricing
...
var client = new InSkillProductsClient(skillRequest);
var response = client.GetProducts();
var count = response.Products.Length;

Getting a specific product for the current user and skill

using Alexa.NET.InSkillPricing
...
var client = new InSkillProductsClient(skillRequest);
var product = client.GetProduct("productId");

Adding a directive to buy a product

using Alexa.NET.InSkillPricing.Directives
...
var buyDirective = new BuyDirective("amzn1.adg.productId", "correlationToken");

var response = ResponseBuilder.Empty();
response.Response.ShouldEndSession = true;

response.Response.Directives.Add(buyDirective);

Add Request Handler support

using Alexa.NET.InSkillPricing.Responses
...
ConnectionRequestHandler.AddToRequestConverter();
...
switch(request)
{
case ConnectionResponseRequest paymentDetail:
//TODO: Handle payment here
}