0
我正在實施應用程序內purchase.All我在一個蘋果沙箱我完成交易完成,也是蘋果返回response = 0
當我驗證收據,但我的問題是在哪裏做我尋找收到的成功付款。哪個電子郵件ID我會收到郵件,如「你已收到user1的金額」。 ?或者我應該看看它連接? 這裏是我用來接收響應代碼:支付關於應用程序內購買
- (BOOL)verifyReceipt:(SKPaymentTransaction *)transaction { NSString *jsonObjectString = [self encode:(uint8_t *)transaction.transactionReceipt.bytes length:transaction.transactionReceipt.length]; NSString *completeString = [NSString stringWithFormat:@"http://test.clientarea.in/WS/two.php?receipt=%@", jsonObjectString]; NSLog(@"completestring%@",jsonObjectString); NSURL *urlForValidation = [NSURL URLWithString:completeString]; NSMutableURLRequest *validationRequest = [[NSMutableURLRequest alloc] initWithURL:urlForValidation]; [validationRequest setHTTPMethod:@"GET"]; NSData *responseData = [NSURLConnection sendSynchronousRequest:validationRequest returningResponse:nil error:nil]; [validationRequest release]; NSString *responseString = [[NSString alloc] initWithData:responseData encoding: NSUTF8StringEncoding]; NSInteger response = [responseString integerValue]; NSLog(@"response string...%d",response); [responseString release]; return (response == 0); } - (NSString *)encode:(const uint8_t *)input length:(NSInteger)length { static char table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz/="; NSMutableData *data = [NSMutableData dataWithLength:((length + 2)/3) * 4]; uint8_t *output = (uint8_t *)data.mutableBytes; for (NSInteger i = 0; i > 18) & 0x3F]; output[index + 1] = table[(value >> 12) & 0x3F]; output[index + 2] = (i + 1) > 6) & 0x3F] : '='; output[index + 3] = (i + 2) > 0) & 0x3F] : '='; } return [[[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding] autorelease];}