flutter_stripe_demo
flutter_stripe_demo copied to clipboard
Backend Function Clarity
Is the purpose of the backend functions simply to dynamically retrieve the secret key and prices id to fill the body (price, quantity, payment method) and headers (client secret key) of the function below in order to create a checkout session and retrieve a session id?
try { final result = await Dio().post( "https://api.stripe.com/v1/checkout/sessions", data: body, options: Options( headers: {HttpHeaders.authorizationHeader: auth}, contentType: "application/x-www-form-urlencoded", ), ); return result.data['id'];