Sandbox Test Account : IAP - No 'Transaction Response From Apple' Received - ios

I am testing my In-App Purchase code. I am presented with the following dialogue in the Xcode console:
Transaction is initiated:
About to fetch the products
Checks if user can make payments:
User can make purchases and will fetch products from Apple Store now
Product(s) exist and are retrieved from Apple servers ...
Full Access To xxxxxx xxxxx xxxx (my product description)
Sending the Payment Request to Apple
Received Payment Transaction Response from Apple
And transaction is stuck here. NO response from Apple servers received.
I have read a lot of content that states sandbox accounts testing is often riddled with bugs.
Is this one of them?
I have played around a lot with sandbox testing accounts and have never been presented with this particular situation.
Is anyone able to shed any light on the situation for me?
Thank you in advance.

My IAP code works now on my test device.
What I did was:
Perform a soft reset of my device; and
Completed some app updates that had not completed under my 'normal' Apple ID.
The combination of the two steps resolved my inability to receive a Payment Transaction Response.

Related

How to access Apple Pay transaction History made by iOS App?

I have done the Apple Pay integration https://developer.apple.com/documentation/passkit/apple_pay/setting_up_apple_pay_requirements and tested https://developer.apple.com/apple-pay/sandbox-testing/.
I have done the testing successfully by using sandbox and real cards but cannot see the transaction history for any of them. There is no record on Card Issuer Bank statement.
I've followed the following guidelines to check transaction recordshttps://support.apple.com/en-gb/guide/iphone/iph7b666943a/ios but couldn't see any change?
Has anyone done this yet? if yes, then please guide me through the process to check the transaction history record of payments made by Apple Pay iOS app and where can developer(retailer/owner of the app) can see the transactions done by user?

How to find user's lost in-app purchases on iOS?

So I followed the official manual and implemented this:
https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-CH104-SW1
user pays in app
app gets receipt info from Apple
this receipt info is sent to my server
my server verified receipt by calling Apple API and activates membership for client
The obvious problem is that 3. can fail. I have clients complaining they paid, they are sending me SS of the amount being deducted, but my server was never notified. And I have no way to find these users. Is there some CP where I can search by customer e-mail or transaction ID to check if this is Photoshopped screenshot or valid one?
Is there some API that can be called to list transactions by product and e-mail of client?
https://appstoreconnect.apple.com/ - Apple CP is useless for this
There is no method to correlate the customers details with your transaction details. Only Apple can do this.
My first suspicion is that you may have a logic problem in your purchasing process. If implemented correctly, a transient failure at step 3 doesn't matter.
You should:
Create your transaction queue observer a soon as your app starts. This will enable any pending transactions to be delivered to your observer
When you get a purchase transaction in your observer you verify with your server
Only once you have a response from your server that the purchase has been recorded successfully do you call finishTransaction.
This way if something goes wrong with your server or the app crashes the transaction is still pending in the queue.
If you are using auto-renewing and/or non-consumable IAP then I
strongly suggest you provide a "restore purchases" button in your
UI. This makes it simple for the user if something goes wrong or when
they move to a new device.
If you have users who claim that they did not get what they paid for then you can refer them to Apple App Store support who can refund the transaction.
If step three fails you can fall back to local verification and then let the user through for this session (or some number of sessions before you require it to succeed). Unfortunately local authentication is a pain in the ass because the receipt is encrypted. See this link for an example: https://github.com/andrewcbancroft/SwiftyLocalReceiptValidator . You can also report failures of step 3 to your analytics tool so you can see who is actually affected by this issue (obviously this only works if the analytic eventually get an internet connection.

How can I debug a failed in app purchase?

From time to time, our users claim that they've made an in app purchase in our IOS application but they did not receive their product.
Our purchase flow goes like this:
Once the user purchases an item, the app makes a request to server including the transaction receipt.
Server saves this purchase with the transaction receipt in "new" state.
Server tries to verify this receipt on Apple servers.
If verification succeeds, the product is granted to user.
If verification succeeds, the purchase is marked as "Success".
If verification fails, the purchase is marked as "Fail".
On some occasions, we can find the purchase attempt in between one of these steps and we recover from there.
But sometimes we cannot find any purchase records relative to this user. I personally believe that most of our users are not lying but some bugs or network problems exist instead.
Is there a way I can debug these issues? Is there any information that I can request from the customer and compare that information to some records on iTunes pages or somewhere? Are we doing any mistake during our purchase process? What can we do better to prevent these issues?
Edit
We are verifying purchases by making calls to Apple Api (by using We are verifying purchases by making calls to Apple api (by using nodejs's iap_verifier).
We do not handle any duplicates since we had none so far but I do not think that that is relevant for this specific case.
I understand that this might be an Apple outage, a problem on the Apple side, a network problem or any other problem that are not related to our servers. But I still need a way to confirm a user's purchase when he or she approaches us claiming that he or she made a purchase but did not get their product. Does such a way exist?

Apple In App Purchase & Apple "Store Credit"

We recently had a purchase on one of our apps. However, to our knowledge or the apps knowledge, the purchase never came through.
This only came to our attention when our user alerted us that they never received their virtual good. After looking into this, we saw the app sent the call off to itunes to process the payment, but never received the call back.
We asked the user to forward on the receipt to confirm the payment. The iTunes receipt read:
In App Purchase $15.99
Store Credit Total: $0.13
Payment Card Total: $15.86
Order Total: $15.99
"Store Credit"?! Would this have had some effect on the call back process to our app? Meaning we missed this sale totally? Is there a way around this issue?
I don't know if the 'Store credit' have any effect but we are experiencing a similar situation:
Sometimes our customers complain that they have purchased an IAP item and never received the credit in the app.
When we check their log (we keep a special log for that) we see that we got SKPaymentTransactionStateFailed response with 'Cannot connect to iTunes store' and later on, after 1-3 minutes we get SKPaymentTransactionStatePurchased.
We tried to ask Apple about it but couldn't get any explanation. I hope more people are having the same problem and can help us understand the situation.

Error 21007: status result returned by Apple during in-app subscription restore

We are testing 'restore subscription' using Apple's new in-app subscription model. The In App Purchase Programming Guide lists 6 status codes that are returned by the Apple server during the restoration/purchase process ("Verifying an Auto-renewable receipt" - page 33/34).
However, the errors start at 21000 and end at 21006. We just tried to restore a subscription and received a status result of 21007. I have googled this error and am not finding any information about what this status result means.
Thank you in advance ....
Error 21008 is also another Error response that Apple returns if you point to the wrong production/sandbox server.
Do not point your script to the live Apple server when you're testing using the sandbox(!)
Lesson learned. Hope this post helps someone else.
I just returned from iOS 5 Tech Talk World Tour 2011 and the Apple Tech in the In App Purchase session said that the app review process uses the sandbox when reviewing a submitted app and that they would appreciate it if we would check for this error code and forward the request to the sandbox if we get this error code.
Error code 21008 was the same issue but for a different IAP. i.e. consumable versus non-consumable. I assume the same goes for that code as well. i.e. to forward to the sandbox if received.
Sounds like this might speed up the review process a little.
From Validating Receipts with the App Store:
Verify your receipt first with the production URL; then verify with the sandbox URL if you receive a 21007 status code. This approach ensures you do not have to switch between URLs while your application is tested, reviewed by App Review, or live in the App Store.
I know that this is late but I figured anyone else come across this question, they would like to know what the proper URL to use.
You should use the: https://sandbox.itunes.apple.com/verifyReceipt URL to test with the sandbox.
If you have a server-side script that connects to the sandbox or real AppStore server to validate receipts, always try the real server first, and if you get a 21007 status code, fallback to the sandbox server, in order to support both environments when you submit your application for review, as they will test it with a sandboxed user account!
More info in the following post:
(iOS + StoreKit) Can I detect when I'm in the sandbox?
I'm seeing this also but from Apple's own tests (app is in review) and just received and email from Apple saying the review will take longer.
Perhaps it's some transient problem with App Store itself.

Resources