All Projects → shoshins → apple-receipt

shoshins / apple-receipt

Licence: MIT License
Apple InAppPurchase Receipt - Models, Parser, Validator

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to apple-receipt

Firely Net Sdk
The official Firely .NET SDK for HL7 FHIR
Stars: ✭ 560 (+2140%)
Mutual labels:  validation, parsing
Validate
This package provides a framework for writing validations for Go applications.
Stars: ✭ 57 (+128%)
Mutual labels:  validation, models
Vue Mc
Models and Collections for Vue
Stars: ✭ 588 (+2252%)
Mutual labels:  validation, models
Phonenumberkit
A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.
Stars: ✭ 4,362 (+17348%)
Mutual labels:  validation, parsing
Swiftvalidators
String (and more) validation for iOS
Stars: ✭ 226 (+804%)
Mutual labels:  apple, validation
Pydantic
Data parsing and validation using Python type hints
Stars: ✭ 8,362 (+33348%)
Mutual labels:  validation, parsing
Objection Unique
Unique validation for Objection.js
Stars: ✭ 42 (+68%)
Mutual labels:  validation, models
Graphql Go Tools
Tools to write high performance GraphQL applications using Go/Golang.
Stars: ✭ 96 (+284%)
Mutual labels:  validation, parsing
In App Purchase
A Node.js module for in-App-Purchase for iOS, Android, Amazon and Windows.
Stars: ✭ 868 (+3372%)
Mutual labels:  apple, validation
Awesome Coreml Models
Largest list of models for Core ML (for iOS 11+)
Stars: ✭ 5,192 (+20668%)
Mutual labels:  apple, models
fefe
Validate, sanitize and transform values with proper TypeScript types and zero dependencies.
Stars: ✭ 34 (+36%)
Mutual labels:  validation, parsing
FAParser
JSON Parsing + Archiving & Unarchiving in User Defaults
Stars: ✭ 67 (+168%)
Mutual labels:  apple, parsing
webargs-starlette
Declarative request parsing and validation for Starlette with webargs
Stars: ✭ 36 (+44%)
Mutual labels:  validation, parsing
laravel-pwned-passwords
Simple Laravel validation rule that allows you to prevent or limit the re-use of passwords that are known to be pwned (unsafe). Based on TroyHunt's Have I Been Pwned (https://haveibeenpwned.com)
Stars: ✭ 67 (+168%)
Mutual labels:  validation
X99-Deluxe-II
Files for Asus X99 Deluxe II hackintosh.
Stars: ✭ 17 (-32%)
Mutual labels:  apple
FacePorts
Clockology ports of all the watch faces that Apple withholds from certain watch models
Stars: ✭ 27 (+8%)
Mutual labels:  apple
WWDC
🌈 𝐖𝐖𝐃𝐂 𝐒𝐞𝐬𝐬𝐢𝐨𝐧 𝐍𝐨𝐭𝐞𝐬 👩🏻‍💻 ✨
Stars: ✭ 31 (+24%)
Mutual labels:  apple
ttv
A command line tool for splitting files into test, train, and validation sets.
Stars: ✭ 38 (+52%)
Mutual labels:  validation
appleauth-net
AppleAuth.NET is a simple library that facilitates the implementation of "Sign in with Apple" for .NET applications.
Stars: ✭ 23 (-8%)
Mutual labels:  apple
excel validator
Python script to validate data in Excel files
Stars: ✭ 14 (-44%)
Mutual labels:  validation

Project status

Statistics
GitHub release
NuGet
NuGet
NuGet
Build Status
Deploy Status
Code Quality
Last Commit

Nuget Packages Information

Apple Receipt Models

Description

Describes strongly-type representation of Apple Receipt Object. Apple Documentation

Nuget information

Link to package

Version Downloads
Nuget NuGet

Installation:

  • (Package manager): Install-Package Apple.Receipt.Models
  • (.Net CI): dotnet add package Apple.Receipt.Models
  • (Packet CLI): paket add Apple.Receipt.Models

Apple Receipt Parser

Description

Parser for Apple Receipt that represented in base64 and encoded with ASN.1 Anatomy of a Receipt payload encoded with ASN.1

Nuget information

Link to package

Version Downloads
NuGet NuGet

Installation:

  • (Package manager): Install-Package Apple.Receipt.Parser
  • (.Net CI): dotnet add package Apple.Receipt.Parser
  • (Packet CLI): paket add Apple.Receipt.Parser

How to use:

// Register DI services...
services.RegisterAppleReceiptParser();
...
// ... and resolve the service later.
IAppleReceiptParserService parserService;
...
// Get your base64 Apple Receipt
const string appleAppReceipt = "{receipt_base64_string}";
// Convert to Bytes
byte[] data = Convert.FromBase64String(appleAppReceipt);
// Get parsed receipt
AppleAppReceipt receipt = parserService.GetAppleReceiptFromBytes(data);

Apple Receipt Verificator

Description

Apple Receipt Validator using Apple App Store. Two step verification: pre-validation that can be customized and App Store verification. Apple Receipt Validation with App Store documentation

Nuget information

Link to package

Version Downloads
NuGet NuGet

Installation:

  • (Package manager): Install-Package Apple.Receipt.Verificator
  • (.Net CI): dotnet add package Apple.Receipt.Verificator
  • (Packet CLI): paket add Apple.Receipt.Verificator

How to use:

// (Optional) You can create implementation of custom validation process:
services.AddScoped<IAppleReceiptCustomVerificatorService, AppleReceiptCustomVerificatorService>();
...
// Fill settings:
services.RegisterAppleReceiptVerificator(x =>
{
    x.VerifyReceiptSharedSecret = "XXXX"; // Apple Shared Secret Key
    x.VerificationType = AppleReceiptVerificationType.Sandbox; // Verification Type: Sandbox / Production
    x.AllowedBundleIds = new[] {"com.mbaasy.ios.demo"}; // Array with allowed bundle ids
});
...
// ... and resolve the service later.
IAppleReceiptVerificatorService verificator;
...

// Usage option 1. Apple recommends you use that behaviour: https://developer.apple.com/documentation/storekit/in-app_purchase/validating_receipts_with_the_app_store
// Like 'Check on prod and in case of 21004 check on sandbox'. 
// BUT I CANNOT RECOMMEND THAT WAY, because Production Server cannot switch to Sandbox based on Apple Response.
// Intruder would be able to send Sandbox data to your Server and get the Success response.
// I Recommend the second/third options.
AppleReceiptVerificationResult result = await verificator.VerifyAppleProductionReceiptAsync(appleAppReceipt).ConfigureAwait(false);
if (result.Status == IAPVerificationResponseStatus.TestReceiptOnProd)
{
    result = await verificator.VerifyAppleSandBoxReceiptAsync(appleAppReceipt).ConfigureAwait(false);
}

// Usage option 2. Determine if the Server was requested from Preview environment
// Or App belongs to Not published apps (based on version for example).
var isPreviewEnvironmentOrAppIsBelongsToUnpublishedBasedOnSomePattern = true;
result = isPreviewEnvironmentOrAppIsBelongsToUnpublishedBasedOnSomePattern
    ? await verificator.VerifyAppleSandBoxReceiptAsync(appleAppReceipt).ConfigureAwait(false)
    : await verificator.VerifyAppleProductionReceiptAsync(appleAppReceipt).ConfigureAwait(false);

// Usage option 3. Btw, you still has previous option to setup usage in the configuration during a Server Init step.
result = await verificator.VerifyAppleReceiptAsync(appleAppReceipt).ConfigureAwait(false);

// OBSOLETE USAGE (Just for Backward Compatibity):
var verificationStatus = verificationResult.Status;
var verificationReceipt = verificationResult.Receipt;
var verificationMessage = verificationResult.Message;

// USAGE (Full Apple Response Info):
var verificationStatus = verificationResult.AppleVerificationResponse.StatusCode;
var verificationReceipt = verificationResult.AppleVerificationResponse.Receipt;
var verificationLatestReceiptInfo = verificationResult.AppleVerificationResponse.LatestReceiptInfo;
var verificationPendingRenewalInfo = verificationResult.AppleVerificationResponse.PendingRenewalInfo;
var verificationMessage = verificationResult.Message;
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].