'How to send stripe request to python backend as production(live) mode with react?

I'm trying to implement subscription system with stripe. The backend python code(flask) if below. But "payment" method is always test mode and then I cannot use this script in production environment.

@app.route('/sub', methods=['POST'])
def sub():
    email = request.json.get('email', None)
    payment_method = request.json.get('payment_method', None)

How can I send the request to this backend as production mode? Does anyone show sample of react frontend scripts that can send requests as production mode???



Solution 1:[1]

To make Stripe requests in live mode (not test mode), you need to use your live mode API keys located here: https://dashboard.stripe.com/apikeys. You are probably using your test mode API keys here: https://dashboard.stripe.com/test/apikeys.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 codename_duchess