ReceiptVerifierMiddlewareEndpoint is a library used to add an endpoint to verify and get information about receipt from Apple. It uses AppleReceiptVerifier.NET to get information from Apple.
Use the package manager NuGet to install library.
Install-Package ReceiptVerifierMiddlewareEndpoint -Version 1.0.1
Before beginning please make sure you injected AppleReceiptVerifier.NET to your project. Otherwise you will get an exception.
Firstly use AddReceiptVerifierEndpointMiddleware method and pass path. You will be able to get receipt info by using that path.
services.AddReceiptVerifierEndpointMiddleware(op =>
{
op.Path = "/api/Subscriptions/receiptInfo";
});
Then call UseReceiptVerifierEndpointMiddleware.
app.UseReceiptVerifierEndpointMiddleware();
Execute GET request on path you set in configuration. Body of request must contain valid receipt.
{
"receipt" : "very long base64encoded string"
}