我无法验证应用内购买收据

时间:2014-02-03 11:34:47

标签: php ios in-app-purchase in-app

这是我从手机收到的收据代码,我再次将其全部发送到itunes服务器

{
    "signature" = "Akpglgv7RY8BpZHkEeKboQUGj01l/Z2DE+DiwxdddT+0iWPSFp0Q4KVVc6qSHWx1VIqVgiwu/aQiRz2XHwchDQeEwZ8g0ff115PUT25gjOBH2HjLImsEeC7GSJ9jhE1wJEaOx1oPL+CiENCXZBA20YzHG59ZodkBMx4VHOAfpunyAAADVzCCA1MwggI7oAMCAQICCGUUkU3ZWAS1MA0GCSqGSIb3DQEBBQUAMH8xCzAJBgNVBAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEzMDEGA1UEAwwqQXBwbGUgaVR1bmVzIFN0b3JlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA5MDYxNTIyMDU1NloXDTE0MDYxNDIyMDU1NlowZDEjMCEGA1UEAwwaUHVyY2hhc2VSZWNlaXB0Q2VydGlmaWNhdGUxGzAZBgNVBAsMEkFwcGxlIGlUdW5lcyBTdG9yZTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMrRjF2ct4IrSdiTChaI0g8pwv/cmHs8p/RwV/rt/91XKVhNl4XIBimKjQQNfgHsDs6yju++DrKJE7uKsphMddKYfFE5rGXsAdBEjBwRIxexTevx3HLEFGAt1moKx509dhxtiIdDgJv2YaVs49B0uJvNdy6SMqNNLHsDLzDS9oZHAgMBAAGjcjBwMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUNh3o4p2C0gEYtTJrDtdDC5FYQzowDgYDVR0PAQH/BAQDAgeAMB0GA1UdDgQWBBSpg4PyGUjFPhJXCBTMzaN+mV8k9TAQBgoqhkiG92NkBgUBBAIFADANBgkqhkiG9w0BAQUFAAOCAQE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vc19BbmdlbGVzIjsKCSJpdGVtLWlkIiA9ICI3NDY5MDk4ODQiOwoJImV4cGlyZXMtZGF0ZS1mb3JtYXR0ZWQiID0gIjIwMTQtMDItMDIgMTQ6MDc6MzcgRXRjL0dNVCI7CgkicHJvZHVjdC1pZCIgPSAiQXJ0Z2luZS5VTkZhbGVydC5wYWlkQWNjb3VudFJlbmV3IjsKCSJwdXJjaGFzZS1kYXRlIiA9ICIyMDE0LTAyLTAyIDE0OjAyOjM3IEV0Yy9HTVQiOwoJIm9yaWdpbmFsLXB1cmNoYXNlLWRhdGUiID0gIjIwMTMtMTItMDUgMTI6MDE6NTUgRXRjL0dNVCI7CgkiYmlkIiA9ICJBcnRnaW5lLlVORmFsZXJ0IjsKCSJwdXJjaGFzZS1kYXRlLXBzdCIgPSAiMjAxNC0wMi0wMiAwNjowMjozNyBBbWVyaWNhL0xvc19BbmdlbGVzIjsKCSJxdWFudGl0eSIgPSAiMSI7Cn0=";
    "environment" = "Sandbox";
    "pod" = "100";
    "signing-status" = "0";
}

当我发送到iTunes服务器给我回复[status] => 21002,这意味着无效收据

$postData = json_encode(
      array('receipt-data' => $receipt, "password" => '93bb68dd2adea7a4f')
  );

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

这可能会有所帮助

- (void) paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue
{
   NSMutableArray* purchasedItemIDs = [[NSMutableArray alloc] init];
    for (SKPaymentTransaction *transaction in queue.transactions)
    {
        [self showHUD:NO];
        NSString *productID = transaction.payment.productIdentifier;
        [purchasedItemIDs addObject:productID];
        if ([[purchasedItemIDs objectAtIndex:0] isEqualToString:@"YourApplicationCode"]) {
            NSUserDefaults *inappPurchase=[NSUserDefaults standardUserDefaults];
            [inappPurchase setBool:YES forKey:@"inappvalue"];
            [inappPurchase synchronize];
            UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Notice!" message:@"Restored successfully" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"Ok", nil];
            [alert show];
            [alert release];
        }
        else
        {
            UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Notice!" message:@"Restored Failed. Please try again" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"Ok", nil];
            [alert show];
            [alert release];

        }
    }
}