Testing in-app purchases - ios

I want to test in-app purchases in my app on device with different Apple ID(not developer Apple ID). I add device in Apple Developer. But I still can’t do it. How I test purchases on device with not developer Apple ID?

if you're getting "Unknown Errors while creating Sandbox Tester, Please check Error Log, email=********#*****.****"
Here's the solution:
some email servers aren't accepted (for example #bk.ru didn't work, #gmail.com accepted);
you must use "strong" password (at least 1 capital letter, 1 number and 1 punctuation char);
you may not use same email address twice (even if previously removed).
Recommendation (also recommended by Apple): gmail supports "extended" pseudo-addresses you may (and should) use for sandbox users:
pretend you own myname#gmail.com - you may use myname+anythinghere#gmail.com (anything after + sign)

You must create Sandbox Tester Account to test In App Purchase.

For testing In App purchase you must have to use Sandbox Tester Account.

To add any sandbox testers, add a new user as admin and then login to itunes with the new admin account and try to add the sandbox testers. You will be easily add number of sandbox testers.
Let me know if you are still not able to add sandbox testers.

Related

Required to sign Paid Applications Agreement to enable initial IAP testing on iOS?

I'm developing a iOS app containing in-app purchases.
I'm having problems testing the app because it can't download IAP products from iTunes. Do I need to sign the Paid Applications Agreement even to perform initial (local) testing?
To test the purchase add one user / email ID which is not an apple ID under User and Groups >> Sandbox Account in iTunes account.
Refer below screenshot for the same
and If you are not able to get the IAP products from iTunes try this link and check wheather the store is working for you.
https://sandbox.itunes.apple.com/verifyReceipt?uo=8&at=11ld4k
if the link responsd with status code its working.
Resolved after signed the Apple Paid Applications contract.

Apple Test-Flight test in a payment application

I am developing a payment application for apple users, where users will have an account and will be able to recharge using apple pay.
Its fine while my application is in production. Below Figure 8-1 Production.
But while my application is in testflight of apple. A listed users(allowed by me) can download/update his/her testflight application from store, Also can recharge his account balance using sandbox of apple pay.
According to guideline of Apple store.
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/AppReview.html#//apple_ref/doc/uid/TP40008267-CH10-SW1
As the Figure 8-1(App review) of the above link though the users pay from his/her sandbox apple pay account user will receive money in his production account!!!
My question is
What is the better way to handle those transactions of apple sandbox transactions?
and
How typical payment applications handle those types of situations?
You have to understand the difference between Testflight users and sandbox users for testing in-app purchases.
You are sending your test users to test the app via Testflight and you invite them with their real email address.
They can never do a sandbox purchase with their real (production) account that they currently use in the App Store for example.
Here is what you have to do:
Go to iTunes Connect - https://itunesconnect.apple.com
Go to Users and Roles
In the top right select Sandbox Testers
Add a test user (first & last name, email address (not the email that someone uses for the App Store - I like to use a fake email like test#testApp.com or whatever)
Now you can share this email address with your tester(s), then they have to go to App Store or Settings - iTunes & App Store and log out of their account and log in with your sandbox account (they will be switched to the App Store that you specified for the sand box user so you can see how it would work for someone in USA vs. someone in Italy or China).
As you can see in the image below all Sandbox payments will have [Environment: Sandbox] written on them. And no money will be exchanged since you are only testing to see if your in-app purchases or subscriptions work...hope it helps
I think Apple has given recommended approach in your mentioned article.
When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code “Sandbox receipt used in production”, validate against the test environment instead.

Beta testing of in-app purchasing without testers having to spend own $$$? [duplicate]

This question already has an answer here:
Beta testing and in-app purchase
(1 answer)
Closed 8 years ago.
I would like to recruit beta testers for an iOS app as part of the general procedure described here.
Is it correct to assume that beta testing occurs strictly outside the development sandbox environment and hence beta testers have to use their own Apple IDs to test in-app purchases, etc? Since I cannot really expect them to shell out their own $$$ for my testing, is there a proven way forward?
You can setup test users in iTunes Connect that allow your users to make purchases in the "sandbox." This goes through all the IAP lifecycle without actually charging the user.
https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnectInAppPurchase_Guide/Chapters/TestingInAppPurchases.html
I've found that it's useful to setup test users with an existing email address but just adding "+iaptest" before the # in the email. For example, with my test#example.com I'd use test+iaptest#example.com. Mailers typically ignore what appears after the + and before the # and then deliver to the remaining email address. This obviates having to create a new email account just for testing.
In order to use the test account, the user must log out of their current iTunes account by going into Settings -> iTunes & App Store, then tap on the existing ID and "Sign Out." Then start your app and attempt to make a purchase. THEN log into the test account when prompted. If you try logging into the test account from Settings -> iTunes & App Store it doesn't work.

the apple id you entered couldn't be found or your password was incorrect

I am debugging my in-app purchase on ipad ( ios 7.0.3).
But when I enter my password, it always says "the apple id you entered couldn't be found or your password was incorrect".
my developer id and the apple id registered on this ipad are different.
when I intentionally enter wrong password, it displays a different message "Your Apple ID or password is incorrect".
My in-app purchase is in review state. But I feel, it doesn't have any impact on sandbox testing
I have restarted my device. I can use the same password for downloading/purchasing other apps from itunes.
I am not posting my in-app purchase code as this is out of our coding context.
In order to test in-app purchases before they are approved, you have to use test users, which you can create in iTunes Connect.
Once you sign in to iTunes Connect, you click where it says "Manage Users", which will let you create test users. Once you create a test user, you can use it within your development build of your app to test your in-app purchases. You can also create multiple test users if you need to repeatedly test non-consumable in-app purchases.
we have had same issue, spent whole day chasing rabbit at the end what solved issue was to set test account App Store Territory/country United states, in our case we have set country Pakistan on test account user causing issue
We also recently experienced this issue.
We "solved" it by using shorter email addresses for test users.
Emails longer than about 25 characters seemed to cause the error.

How check sandbox server status? ("Cannot connect to itunes store")

I'm developing in-app purchase using this excellent tutorial:
http://www.raywenderlich.com/21081/introduction-to-in-app-purchases-in-ios-6-tutorial
and I'm getting an error "Cannot connect to itunes store" which it seems can be related to Apple's sandbox servers being down; apart from googling for tweets regarding sandbox status, is there any other way of confirming their status otherwise it's difficult (read ipossible) to debug.
Almost a year late, but I'm facing the same problem right now. As far as I know, the best way to test the status of the iTunes Sandbox environment is checking this url:
http://sandbox.itunes.apple.com
An Http/1.1 Service Unavailable means SSErrorHTTPStatusCodeKey=503 in your debugger output.
I'll answer this in case someone else also comes up against this. I have an app in the app store that was built using the tutorial mentioned in the question, and it performs flawlessly. Unfortunately, in my experience the reliability of the Apple Sandbox servers can be iffy, with no obvious place to check online aside from posting to the Apple forums and hoping for a corroborative reply.
As others have said on StackOverflow, the key is to make sure that:
You create at least one test user account at itunesconnect.apple.com
Make sure that there is NO credit card associated with the test account
DO NOT sign into iTunes on your test device with the test account. Instead, SIGN OUT of any iTunes Store account you are signed into. Then try purchasing an IAP. It will ask for your username and password - give it your test username(s).
I got the "Cannot connect to itunes store" error when using a tester sandbox account. The problem was I had signed in on my iPhone with that account and confirmed the email address associated with the test account.
I solved the problem by creating a new tester account under Users and Roles in Itunes Connect and never sign in on my device with the account.
The reason for the error in my case was that when I confirmed the email address, the account was registered as a production account in AppStore and it did not work as a sandbox account anymore.
So if you sign in on your device once, the account will be registered as a production account and even if you sign out again, that account won´t work in the sandbox.
For testing an app in Sand Box . Follow these steps
To test IAP ,we have to create a test user at itunesconnect.apple.com
Go to Settings and sign out from all active accounts (mail, iTunes & App Store , Game Center)
Restart your device.
Run your app on the device. Click on the IAP button -> choose existing account -> enter apple id and password created from step 1. Now everything will be fine.

Resources