Why In-App purchase sandbox always ask “Verificati

2019-01-14 07:55发布

问题:

I have signed out from the store in device settings. I entered user credentials only in my App. I have set up a brand new (actually around 4 times) test user.

Why this message keep poppin' up?

Is it something connected to iOS 5, automatic app sync, or iCloud?

回答1:

I had exactly same problem with sandbox in-app purchases, in built-in model (no receipt verification), app received valid products, now i called addPayment, everything alright. But now "Verification required" appeared and payment was canceled.

After hours of pain I discovered, my problem was in test account.. i created test account for Czech Republic iTunes store... and that was the reason of fail. Dumb. I tried to create Canadian test user and it suddenly worked! "Verification required" will no longer appeared.



回答2:

I've dealing with this problem for about one week, trying to use accounts in US/Canada without any success. Finally I found this post and it works: http://iphonedevsdk.com/forum/iphone-sdk-development/63008-in-app-purchase-test-account-verification-required-cant-get-passed.html You need a test account that NEVER has a credit card attached to it, NEVER is logged into itunes store or app store via device, and if you do login to itunes or agree to any app store stuff it voids the test account and will never work again.

So, To test your In App Purchase app, you need to use a new account that does not have a credit card. logout of the store, and only use your new account inside the app you are testing.

Update: After a long time system maintenance of iTunes in Sept 2013, only test accounts in US can make test purchases.



回答3:

I have struggled with this myself, i finally found a workaround that worked for me...

  1. On the device Log out of iTunes account in settings (also hard close settings and iTunes if you have them open as a precaution)
  2. Delete app
  3. Create a new test user at “itunesconnect.apple.com” – selecting the United States as your store
  4. Reinstall app
  5. Try to make a purchase in the app
  6. Enter you new test user account details
  7. If a pop up states that it needs to swap stores, immediately press home. DO NOT press OK.
  8. Relaunch the app, and try again. It should now work as expected.

Hope this works...



回答4:

In addition of the above answers, note the below points also :-

1) Uninstall your app from the device.

2) Create a new test account on iTunes Connect and verify its email address. Never add any payment information for this test account, not online, not on iTunes, not on your device. Doing so might invalidate your test account (and trigger the "verify payment info" vicious cycle.) Also never use this test account out of the Sandbox.

3) Log-out from the App Store on your device. DO NOT log back in the App Store via Settings > iTunes & App Stores on your device. You will be asked your login credentials from your app later (see points 5-6)

4) Re-install your app.

5) Attempt an in-app purchase. You should now be prompted to enter both your username and password (as you logged out from the App Store)

6) Type in your username and password: you should not see the dreadful "Verification Required: before you can make purchases, you must verify your payment info" message and the purchase should be successful.



回答5:

Even in sandbox, you need to complete the buy verifying the receipt to the server. It corresponds to steps 6-7-8 of built-in model and 11-12-13 of the server model.

http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/APIOverview/OverviewoftheStoreKitAPI.html

All you need to do is:

Retrieve the receipt data from the transaction’s transactionReceipt property and encode it using base64 encoding.create a json like this:

{
    "receipt-data" : "(receipt in base 64 encoding)"
}

Make a post to verification URL for production:

https://buy.itunes.apple.com/verifyReceipt

For sandbox :

https://sandbox.itunes.apple.com/verifyReceipt

The response is like this:

{
    "status" : 0,
    "receipt" : { ... }
}

If the value of the status key is 0, this is a valid receipt. If the value is anything other than 0, this receipt is invalid.

For further information look the guide: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/VerifyingStoreReceipts/VerifyingStoreReceipts.html



回答6:

Swift 3

Insert this temporary code somewhere in your project:

for transaction: AnyObject in SKPaymentQueue.default().transactions {
    guard let currentTransaction: SKPaymentTransaction = transaction as? SKPaymentTransaction else {return}
    SKPaymentQueue.default().finishTransaction(transaction as! SKPaymentTransaction)
}

This clears out the payment queue. Make sure to run it much later than viewDidLoad if you can. I made mine triggered by a button. Ran it a couple times, then removed the code. No more annoying verification pop-ups.



回答7:

I saw this issue after iOS5 got released.

Earlier I used to create test accounts with dummy email addresses and it used to work well for me, but post iOS5, it started showing verification required for test accounts.

Thus I ended up using actual email addresses for the test accounts and verified when asked for, which seemed to do the trick for me.



回答8:

I was facing same problem after spending several hours i figured out that county/region of your itunes connect test account and your device/simulator must be same.

Please verify it as it solved my problem



回答9:

Register a fresh test user for the USA. You can put any email address.

Log out under settings. Delete the app. start it again via xCode login with your new user within the app.

It may say that you are not located in the USA and it opens the browser, Close the browser and start it again.

It should work now.



回答10:

If you are having such problem for 4th IAP item to buy.

It looks, each test account does not work for purchasing more than 3 items of an application. You may create a new test account from itunesconnect.apple.com->Manage Users->Test User to test your 4th IAP item.



回答11:

Creating a canadian test user solve this issue.