当前位置:编程学习 > wap >>

重复购买非消费品时的问题

使用同一个appID购买同一个非消费品时,苹果是不会重复扣费的,但是在下述函数中,transaction.transactionState却是SKPaymentTransactionStateFailed,请问此时应该如何处理呢?

另外听说可以使用[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];来恢复之前的购买记录,可是我调用了之后,发现进入 paymentQueueRestoreCompletedTransactionsFinished后,有的appID确实有收到内容,可是有的并没有内容,这样又改如何处理呢?

在线等,请高手不吝赐教!


- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
    for (SKPaymentTransaction *transaction in transactions)
    {
        NSLog(@"transaction.transactionState = %d", transaction.transactionState);
        switch (transaction.transactionState)
        {
            case SKPaymentTransactionStatePurchased:
                [self completeTransaction:transaction];
                break;
            case SKPaymentTransactionStateFailed:
                [self failedTransaction:transaction];
                break;
            case SKPaymentTransactionStateRestored:
                [self restoreTransaction:transaction];
                break;
            default:
                break;
        }
    }
}
补充:移动开发 ,  iPhone
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,