When I test my app with a real product ID, I can only pay with a test card - in-app-purchase

My app displays ads and I want to give the user the ability to block the ads by making an in-app payment. So I added in-app purchasing and tested it with test product IDs; the fake credit card is displayed and everything looks good. However, when I changed the product ID to match the real one I configured in Google Play and try to complete the purchase, I'm still seeing the fake card:
I couldn't find any similar questions on Stack Overflow, so I assume my problem is unique. What am I missing here?

There is no need to create test products for testing, you can make test purchases with the final product, in this way you should do it to the test the whole process.
In fact there is no option in the Play Console to mark an in-app product as a test product.
What causes the test card to be shown is that the google account from which the purchase is made is in the list on : Google Play Console >> Settings >> Account details >> License Testing

Related

How to test my 1st In-App Purchase without releasing the App itself?

Ok, I suspect the answer to this is simple. But here goes...
I am in the process of submitting my app. I am submitting for review even though my In-App purchase integration has not been tested. This is essentially because I am unable to retrieve my list of IAP items if the IAP items have not been submitted/verified. So it seems to me this is like a "chicken or the egg" kind of situation.
My plan is to submit the App and the 1st IAP item. Then I am assuming this will allow me to magically retrieve the IAP item when I run the App.
Am I approaching this correctly, or is there a more intuitive/simpler way to test the IAP retrieval process (and the many other things to test once it is retrieved)?
Per Apple's Documentation:
To perform testing for in-app purchase products Set up test user
accounts within Users and Roles in iTunes Connect, as detailed in
Creating Sandbox Tester Accounts in iTunes Connect Developer Guide.
You’ll need a test user for each territory you want to test the app
in.
Clear any account information stored on your test device.
In Settings, go to the Store settings. Click the Sign Out button. This
prevents an actual user account from automatically being used when
testing.
Important: Don’t enter your test account information in the Store
settings panel. Doing so may invalidate your test account. Connect
your test device to your Mac.
In Xcode, set your test device as your scheme’s destination.
Open your app, and perform your in-app purchase product testing.
Use your test account credentials to test the purchase.
When your app uses the Store Kit API to request a payment, you’re
asked to sign in. Select Use Existing Account and enter your test
account user name and password. You are then asked to confirm the
purchase. The transaction completes.
No financial transaction takes place, but a receipt is generated for a
successful transaction.
It's pretty straightforward, just takes a bit of set up. Good luck!

What are the considerations when submitting an app to Apple that requires a credit card to create an order and use half the functionality

I'll be submitting my app to Apple for review at the end of the week. The app is a marketplace platform so users need to enter a credit card when creating an order.
In order for Apple to test the app I assume they need to go through every screen but a credit card is needed for to get to most of them. I'm using Stripe for payment processing and have a dummy card I use for testing, but when I switch to the live environment I don't think the dummy card works any more so how can I allow apple to test it?
I can't figure out how I can submit a production ready app with live API keys and let apple test without processing a real order and charging a real card.

Testing IAP edge cases in iOS (eg: missing credit card info, etc.)

We currently have an app in the app store that uses IAP to disable ads and add a few features.
However, we've noticed that some users have problems buying the IAP. After scrutiny it seems most of it comes down to not having an active internet connection on the moment of purchase. About a dozen cases however could not be tracked down and resolved.
One of these:
tap buy IAP
Credit Card security code was not yet filled in
purchase fails
user is automatically moved to his App Store account to fill in the missing code
user fills in code and confirms buying the IAP
user goes back to the app
purchase is still failed (!)
Conclusion: user paid and did not yet receive the IAP.
(of course this can be resolved by tapping the IAP again and downloading for free, but that's not ideal)
We're looking to test a solution to such edge cases.
However test accounts usually do not require valid CC info. Thus..
Question: How do I test such cases?
I have been using prepaid credit cards to test and make sure it goes through.

Is it possible to test in-app-purchase without having to enter bank details etc?

I want to test IAP, however it seems this isn't going to be possible without going through multiple hoops on iTunes Connect and entering bank information etc.
Reasons for SKProductsRequest returning 0 products?
Can anybody confirm if this is the case or not? If so then is there any reason why I can't just create a dummy test app entry in iTunes connect, enter garbage for the bank info, then after finishing testing delete the app entry from iTunes connect?
Yes, you definitely do have to enter banking and US tax info before you can do in-app purchases. I was getting "invalid product ID", but it started working as soon as my banking/tax info was set up. This doesn't seem to be documented anywhere.
Did not work for me. If it works out for you, let me know.
I tested in-app payment this late December 2013 / early January.
Yes you can test IAP without entering bank info. what you need to do is
Create a test user in itunesconnect
Run your app on an actual device
Launch AppStore App on your iphone/ipad
logout and login with your test user id
Go to your app and try to make an in-app purchase
You should get a prompt saying something like "Charge $0.99 to Sandbox"
You won't be charged to your actual account.
This is all documented by Apple HERE
Expand tab that says To perform testing for In-App Purchase products

Deleting a purchase in a In App Purchase Test User account [duplicate]

This question already has answers here:
Clearing purchases from iOS in-app purchase sandbox for a test user
(11 answers)
Closed 9 years ago.
I have a test user account that is working just fine for testing in app purchases.
I would like to "delete" a purchase from this account, so I can test the purchase multiple times. Right now, if I try to purchase, it logically says the the Test User has already purchased the product in question.
Can I delete a purchase from a Test User account so that I can test the same purchase multiple times. I'd hate to have to create a new Test User every time I want to test the purchase.
EDIT: Each time I try to purchase, I get a dialog with "You've Already Purchased this. Tap OK to download it again for free".
If you really want to test it clean, you are going to have to create another test user. However, I don't see the need for this. Redownloading an in-app purchase is a nearly identical code flow. The actual purchase and verification logic is not part of your application, and a user buying something multiple times is not something that is supposed to happen (unless you specify that it is that kind of consumable). If it works for redownloading, it is safe to assume it will work for the initial purchase.
You do not have access to this data. If Apple exposed a way to reset purchases, they would risk opening themselves up to a security risk since I assume their sandbox server code is practically identical to their production code (otherwise the sandbox would be meaningless). Because the data is on Apple's servers, associated with an iTunes account, it can span across multiple devices.
An alternate idea would be to delete the in app purchase from your iTunes Connect, and make a new one.
If the type of your in-app purchase is consumable then you can just reinstall your app. If your in-app purchase is non-cosumable, then you will need to create additional test users.

Resources