flutter_stripe_demo icon indicating copy to clipboard operation
flutter_stripe_demo copied to clipboard

Backend Function Clarity

Open OGmetamonkey opened this issue 3 years ago • 0 comments

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'];

OGmetamonkey avatar May 31 '21 21:05 OGmetamonkey