Search code examples
iostestingstripe-paymentsproduction

Stripe switch to production


I'm developing an iOS app that uses Stripe for purchasing real-world services.

I'm wondering what is the proper way to switch app from using "test" keys to "live" keys. Can not find any useful info in Stripe documentation.

As far as I understand application needs to proceed review in the app store, so I assume it needs to use "test" keys during review, but won't it be a RELEASE configuration? How can I switch keys to "live" programmatically after the submission? Maybe I need to hardcode some condition or use preprocessor macros?

Thanks


Solution

  • So stripe support answered me with the following :

    You should not embed the publishable key directly in your app. If you ever need to roll it for any reason, you'd have to update your app, costing time and money, and users stuck on an older version wouldn't be able to pay you until they upgrade.

    Instead, what you should do is have the app obtain the publishable key from your own server at runtime. That way, you can swap the keys any time you want without having to update the app itself. It would also let you switch from live mode to test mode easily.

    I hope this helped. Do not hesitate to reply if you have more questions!