ios - SKPaymentTransactionObserver - transaction fail -


i working on app in-app-purchase transaction part.

i have purchaseviewcontroller call getproductinfo while launch:

-(void)getproductinfo: (cc3devicecameraoverlayuiviewcontroller *) viewcontroller {     _homeviewcontroller = viewcontroller;      if ([skpaymentqueue canmakepayments])     {         skproductsrequest *request = [[skproductsrequest alloc]                                       initwithproductidentifiers:                                       [nsset setwithobject:self.productid]];         request.delegate = self;          [request start];     }     else         _productdescription.text =         @"please enable in app purchase in settings"; } 

which successful. have button call buyproduct:

- (ibaction)buyproduct:(id)sender {          skpayment *payment = [skpayment paymentwithproduct:_product];     if(_myqueue == nil) {         _myqueue =  [skpaymentqueue defaultqueue];     }         [_myqueue addpayment:payment];     nslog(@"buyproduct happening %@", _product.localizedtitle); } 

which successful because see nslog , product title. after this, transaction failed! when purchasing process to

-(void)paymentqueue:(skpaymentqueue *)queue updatedtransactions:(nsarray *)transactions {     (skpaymenttransaction *transaction in transactions)     {         switch (transaction.transactionstate) {             case skpaymenttransactionstatepurchased: //                [self unlockfeature];                 nslog(@"transaction purchased");                 [[skpaymentqueue defaultqueue] finishtransaction:transaction];                 if (_product.downloadable) {                     [[skpaymentqueue defaultqueue] startdownloads:transaction.downloads];                 }                 break;             case skpaymenttransactionstaterestored:                 if (transaction.downloads) {                     [[skpaymentqueue defaultqueue] startdownloads:transaction.downloads];                     nslog(@"transaction downloading now...");                 } else {                     // unlock features                     [[skpaymentqueue defaultqueue] finishtransaction:transaction];                     nslog(@"transaction finish");                 }                 break;             case skpaymenttransactionstatefailed:                 nslog(@"transaction failed");                 [[skpaymentqueue defaultqueue]                  finishtransaction:transaction];                 break;              default:                 break;         }     } } 

what seems wrong , how can debug part? there way me clear previous transaction test or check if there pending transaction interfere current test? still testing in sandbox mode. error thrown in quite immediate manner give me impression did not go through apple server , transaction error happen locally, sort of previous transaction test conflict or still yet find out.

one more point mention purchasing non-consumable item, if transaction successful, trigger download(i hope.).


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -