1
votes

In my iPhone app, I implemented inAppPurchase, so user can purchase products in app. It's live on itunes app store. I tested it well with sandbox where any credit card verification page was not displayed. On live when user try to buy something it goes on app store from my app to approve his/her information.

enter image description here

When user pass all process, and open my app again from background.

enter image description here

Above msg prompt to user which I wrote in my failedTransaction in -(void) paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions method. This method is below:

-(void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
for(SKPaymentTransaction *transaction in transactions)
{
    switch (transaction.transactionState)
    {
        case SKPaymentTransactionStatePurchased:
            [self completeTransaction:transaction];
            break;
        case SKPaymentTransactionStateFailed:
            [self failedTransaction:transaction];
            break;
        default:
            break;
    }
}
}

Can anyone guide me what is going wrong?

1

1 Answers

1
votes

This is happening because your server where verification part is implemented.

Check following things:

{
    "status" : 0,
    "receipt" : { (receipt here) },
    "latest_receipt" : "(base-64 encoded receipt here)",
    "latest_receipt_info" : { (latest receipt info here) }
}

Check these things first at your server side and also debugging the code and let me know.

One of the above response might be creating problem.

Thanks,

Hemang.