flutter-stripe / flutter_stripe

Flutter SDK for Stripe.

Home Page:https://pub.dev/packages/flutter_stripe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can we have Stripe Subscription integration in fLutter

cresolindiateam opened this issue · comments

Describe the bug
We have implemented Stripe payment integration on our website using the checkout method. This includes creating customers and subscriptions, and storing the Checkout ID in our database.

Current Implementation
For our Flutter application, we replicated the backend system to create customers and checkouts. We generate a checkout session and retrieve the client secret to be passed to the Flutter app.

Issue
When the Flutter developer attempts to use this client secret on the mobile app, an error is encountered stating that the secret's format does not match the expected client secret formatting.

Error Message

flutter: exception StripeException(error: LocalizedErrorMessage(code: FailureCode.Failed, localizedMessage: "secret format does not match expected client secret formatting.", message: "secret format does not match expected client secret formatting.", stripeErrorCode: null, declineCode: null, type: null))
Client Secret Example
secret-cus_P89GSD6zWgADp6_1718266392_1718266392

Backend Technology
The backend is implemented in PHP.

Request
Please advise on the correct method to implement Stripe subscription integration using the checkout method in our Flutter app, ensuring the system works with the Stripe checkout ID.