TestFlight App uses wrong sandbox account for payment

I'm using TestFlight to test an app with payment/subscription functionality. I created sandbox accounts in AppStore Connect accordingly to be able to test the subscriptions. I'm logged in with the sandbox account.

When I try to subscribe in the App the wrong account (this is my actual real AppleID) is used for the subscription although it is recognized that this is just a sandbox subscription. I tried: logging off/on into the sandbox account creating a totally new sandbox account trying to trigger the payment with no logged in sandbox account The result is always: in the payment popup it is stated that the purchase account will be my original AppleID and not a sandbox account. How can I switch the accounts? Is this a bug at Apple's side somehow?

Post not yet marked as solved Up vote post of fwuen Down vote post of fwuen
13k views

Replies

I also noticed strange behaviour with sandbox env regarding payment and subscriptions at all... Available products request (SKProductsRequest) firstly returns products and then causes stuck of app store and test flight app downloading (even installed apps shows as not installed yet). Also it stops returning subscriptions products at all. Device should be rebooted to be returned in normal state.

Please, somebody can clarify what is going on? @apple

TestFlight does not use Sandbox Apple ID’s created in App Store Connect, those are only used for apps locally distributed/signed. While TestFlight effectively uses sandbox behind the scenes, it just uses your regular Apple ID. Your production Apple ID is not charged nor will you see these transactions in your purchase history, invoices, etc. - prod and TestFlight are fully independent.

As for your other issue, I’m not entirely clear but if you can provide more info such as steps to reproduce, screenshots and a sysdiagnose then please file a ticket at: FeedbackAssistant.Apple.com

welcome to followup with a FB# here in this thread.

  • As @johnny12 said, if TestFlight doesn't use sandbox test accounts from App Store Connect, how do you clear purchase history for your main account to test?

  • Exactly. Same issue here

Add a Comment

@apple Since TestFlight purchase uses regular Apple ID, is it possible to clear purchase history for that specific Apple ID in TestFlight Sandbox?

I'm facing exact same problem. When making purchases on the TestFlight environment, it always makes purchases against my real Apple ID. But the doc says we can test on TestFlight using Sandbox. https://developer.apple.com/documentation/storekit/in-app_purchase/testing_at_all_stages_of_development_with_xcode_and_sandbox

I've been experiencing the same issue. I've created multiple sandbox testers. However, when performing a purchase, it's using the apple id instead of the sandbox login. If I log out from the "iTunes & App Store" with my apple id and use the sandbox tester email, I get the "iTunes account creation not allowed" error.

I would really like to know what it is we need to make sure our sandbox tester accounts are being used to test purchasing via TestFlight builds.

Facing the same issue. App ignores my sandbox account during test in-app purchases and use my real appleId.

Does anyone know how to switch accounts or is it possible to clear purchase history for that specific Apple ID in TestFlight Sandbox?

There is the following workaround I discovered: you need to open youe App Store app, tap on account icon, scroll to the bottom, tap "Sign out". Then you open your app, purchase a subscription, a form for entering Apple ID creds will appear. Fill it with your Sandbox creds, your sandbox acc will be used for purchase.

  • Doesn't work - doesn't allow to log-in with sandbox account to testflight

Add a Comment

@Apple - are you going to solve this nightmare?

Post not yet marked as solved Up vote reply of nbe Down vote reply of nbe

This is the solution:

  1. Get the application via testflight, as a real tester account and install the app locally on the phone
  2. In iphone settings, log out from the real app store id, and log in with the sandbox account (not a tester account).
  3. Open the already-installed app, and pay. It will use the sandbox account.

Dear @apple please fix this stuff and return the possibility to make in-app purchases via Sandbox

for now, it's really uncomfortable for testers

There is a workaround:

  1. Install the app being logged in under real Apple id
  2. Create a sandbox email
  3. Sign out from the real Apple ID
  4. Sign in using Sandbox email instead of real apple id
  5. Open the app ( you don't need to use TestFLight!). Just open as an app from the screen.
  6. Pay from the app
  7. Open Settings - App Store - Sandbox - Manage - see your subscriptions

(NOTE! to update the app to the newest version you'd need to log in back with real apple id, upload new version, repeat steps 3-7)

  • This works for me, but man is it a mess to do. How is @Apple not fixing this?

Add a Comment

I can't understand why this bug has been around for over a year.. it really makes testing difficult :(

[@App Store Commerce Engineer](App Store Commerce Engineer) please help us

Hello @App Store Commerce Engineer

If we can't use a sandbox ID for the purchase TestFlight build then please give the option for a clear transaction from Tester Apple ID (TestFlight purchase transaction).

I think i understand how this is handled.

If you build and deploy the app in the device directly from a mac with Xcode then the payment api will take the sandbox tester you have on the client. If you get the app from TestFlight then the payment api will take the main account of the client.

Hope will help someone

Hello, PaoloGi

I'm also have this question that's why I searched and find this thread. It's seem not really answered what Ravi1207 asking. But Thanks, I got a good picture here.

If you build and deploy the app in the device directly from a mac with Xcode then the payment api will take the sandbox tester you have on the client.

--> Yes, this is clear. Developer can check the Transaction in Sandbox account.

If you get the app from TestFlight then the payment api will take the main account of the client.

--> Understand the behavior for TestFlight which will link the payment api to main account of the client. In this case, how to check the Transaction ? I check the main account subscription. It didn't show the TestFlight purchase transaction.