robotmedia / RMStore

A lightweight iOS library for In-App Purchases
Apache License 2.0
2.43k stars 450 forks source link

How can i get Analysis results of the payload from [RMAppReceipt bundleReceipt]? #97

Closed Rosenkreuz closed 10 years ago

Rosenkreuz commented 10 years ago

I wanna check receipt when Verification succeeded. coz i need base64 encoded transaction receipt data.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (![RMStore canMakePayments]) return;

    NSString *productID = [_products objectAtIndex:indexPath.row];

    [[RMStore defaultStore] addPayment:productID success:^(SKPaymentTransaction *transaction) {
        const BOOL verified = [self verifyReceiptWithCustomLogic:productID];
        if (verified)
        {
            // Verification succeeded
            NSLog(@"RMAppReceipt bundleReceipt = %@", [RMAppReceipt bundleReceipt]);
        }
    } failure:^(SKPaymentTransaction *transaction, NSError *error) {

        UIAlertView *alerView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Payment Transaction Failed", @"")
                                                           message:error.localizedDescription
                                                          delegate:nil
                                                 cancelButtonTitle:NSLocalizedString(@"OK", @"")
                                                 otherButtonTitles:nil];
        [alerView show];
    }];
}