purchased twice use the same apple id

when i purchased the same product twice using the same apple id .The second time i recieved SKErrorPaymentCancelled status at first, then i could recieve SKPaymentTransactionStatePurchased status everyday, why, can someone helps me?

what type of iap product?

auto renewing subscription,and why?Thanks.

Why did I ask....

When you repurchase a consumable or a non-renewing subscription it should show up as a repurchase, no error.

When you repurchase a non-consumable it should show up as a 'repurchase for free' - again no error and no charge

But when you repurchase an autorenewable there is some ambiguity because your subscription is current and scheduled to be renewed so Store Kit is saying 'what are you trying to do?"


Only you knew the 'secret' that it was an autorenewable.


To help developers develop IAPs Apple created a sandbox environment. In that environment they let a test user make a single purchase of an autorenewable and get ONLY 5 renewals in a speeded-up time frame. If they did not limit that to 5 then a test user would get 1000's of renewals over a few days. But after the 5 renewals the sandbox 'function' diverges from the production environment which would require the user to cancel the subscription to stop a renewal. The failed transaction indicates, correctly, that the user already had an ongoing transaction. The purchased transaction indicates that the user purchased the subscription again.

I am not certain what happens in production if a user purchases a subscription on device A and then purchases the subscription again on device B (or device A). I know they will not be charged but I do not know what transactions will hit updatedTransactions. You should code for a failed transaction and a subsequent purchased transaction because this is what happens when a user needs to refresh their credit card information at the App Store after requesting a purchase. The user should preferrably be offered the option of requesting a restoreCompletedTransaction rather than a repurchase-for-free which will generate just a 'restored' transaction hitting updatedTransactions.


do not you have the same problem?The core code as below:

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions

{

if (transactions.count > 0){

/

for (SKPaymentTransaction *transaction in transactions)

{

switch (transaction.transactionState)

{

case SKPaymentTransactionStatePurchasing:

{

break;

}

case SKPaymentTransactionStatePurchased:

{

[queue finishTransaction:transaction];

MDPaymentTransaction *transactionTemp = [[MDPaymentTransaction alloc] initWithTransaction:transaction];

[delegate payToAppleSucceed:transactionTemp];

/

if (saveInPayVip) {

/

DBVipPaymentProvider *dbPaymentProvider = [[MDContext currentUser] dbVipPaymentProvider];

[dbPaymentProvider setPayment:transactionTemp];

[transactionTemp release];

} else {

/

DBPaymentProvider *dbPaymentProvider = [[MDContext currentUser] dbPaymentProvider];

[dbPaymentProvider setPayment:transactionTemp];

[transactionTemp release];

}

break;

}

case SKPaymentTransactionStateFailed:

{

[queue finishTransaction:transaction];

NSString *errMsg = @"";

switch (transaction.error.code) {

case SKErrorPaymentCancelled:

errMsg = @"";

break;

case SKErrorPaymentNotAllowed:

errMsg = TEXT_APPLE_NOT_ALLOW;

break;

default:

errMsg = TEXT_APPLE_ERROR;

break;

}

[delegate payToAppleFail:errMsg];

break;

}

case SKPaymentTransactionStateRestored:

{

[queue finishTransaction:transaction];

break;

}

default:

break;

}

}

} else {

[delegate payToAppleFail:TEXT_APPLE_LOST];

[[[MDContext currentUser] emotionVipApi] feedbackAccountIAPLog:nil target:nil okSelector:nil errSelector:nil failSelector:nil];

}

}

What you are asking is unclear. These two lines of code are wrong because you can't use a transaction after you finish it.


                    [queue finishTransaction:transaction];
                    MDPaymentTransaction *transactionTemp = [[MDPaymentTransaction alloc] initWithTransaction:transaction];

My product is autorenewable.when user purchases the product twice using the same appleid,the app receives SKPaymentTransactionStatePurchased notification everyday and i do not know why,please help me 😟.Thanks.

That is to say,when user repurchased the same product which is autorenewable,what can i do?

purchased twice use the same apple id
 
 
Q