Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: lxcid/CargoBay
base: f682a458aa
...
head fork: lxcid/CargoBay
compare: 73f72ba724
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 3 additions and 15 deletions.
  1. +3 −15 CargoBay/CargoBay.m
View
18 CargoBay/CargoBay.m
@@ -563,11 +563,11 @@ - (void)verifyTransaction:(SKPaymentTransaction *)transaction
success:(void (^)(NSDictionary *receipt))success
failure:(void (^)(NSError *error))failure
{
- if (transaction.transactionState != SKPaymentTransactionStatePurchased) {
+ if ((transaction.transactionState != SKPaymentTransactionStatePurchased) || (transaction.transactionState != SKPaymentTransactionStateRestored)) {
return;
}
NSError *error = nil;
- if (![self verifyPurchase:transaction error:&error]) {
+ if (![self isTransactionAndItsReceiptValid:transaction error:&error]) {
if (failure) {
if (!error) {
error = [[NSError alloc] initWithDomain:SKErrorDomain code:-1 userInfo:nil];
@@ -711,20 +711,8 @@ - (void)setPaymentQueueRestoreCompletedTransactionsWithSuccess:(void (^)(SKPayme
#pragma mark - Receipt Verification
-// This method should be called once a transaction gets to the SKPaymentTransactionStatePurchased or SKPaymentTransactionStateRestored state
-// Call it with the SKPaymentTransaction.transactionReceipt
-- (BOOL)verifyPurchase:(SKPaymentTransaction *)theTransaction error:(NSError * __autoreleasing *)theError {
- BOOL isOK = [self isTransactionAndItsReceiptValid:theTransaction error:theError];
- if (isOK) {
- // The transaction looks ok, so start the verify process.
- return YES;
- } else {
- // There was something wrong with the transaction we got back, so no need to call verifyReceipt.
- return NO;
- }
-}
-
// Check the validity of the receipt.
+// This method should be called once a transaction gets to the SKPaymentTransactionStatePurchased or SKPaymentTransactionStateRestored state
- (BOOL)isTransactionAndItsReceiptValid:(SKPaymentTransaction *)theTransaction error:(NSError * __autoreleasing *)theError {
if (!((theTransaction) && (theTransaction.transactionReceipt) && (theTransaction.transactionReceipt.length > 0))) {
// Transaction is not valid.

No commit comments for this range

Something went wrong with that request. Please try again.