Simple iOS library to validate receipts using Lestrade. This project use nicklockwood/Base64 to encode the receipt bytes and tonymillion/Reachability to check for connectivity.
Get the code:
git clone https://github.com/TotenDev/libLestrade.git
cd libLestrade
open Lestrade.xcodeproj
Use the pre-compiled libs:
-
Download libLestradeFull: include tonymillion/Reachability and nicklockwood/Base64, so only use this if your project does NOT use them too, or you will get a duplication error.
-
Download libLestradeMinimal: use this if your project already uses tonymillion/Reachability or nicklockwood/Base64.
Add the files to your project, #import "Lestrade.h"
.
Validation example:
NSURL *validationURL = [NSURL URLWithString:@"http://example.com/sandbox/validate"];
Lestrade *lestrade = [[Lestrade alloc] initWithValidationURL:validationURL];
lestrade.username = @"sherlock";
lestrade.password = @"secret";
[lestrade validateReceipt:transaction.transactionReceipt validationBlock:^(BOOL isValid, NSError *error) {
if (error) { NSLog(@"error: %@", [error localizedDescription]); }
NSLog(@"is receipt valid?(%d)", isValid);
}];
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request