BreX900 / mek-packages

12 stars 17 forks source link

Support for cancelCollectPaymentMethod #91

Open kekko7072 opened 1 day ago

kekko7072 commented 1 day ago

Feature Request: Support for cancelCollectPaymentMethod in mek_stripe_terminal

Description I am currently using the mek_stripe_terminal Flutter implementation, and I would like to request support for the cancelCollectPaymentMethod functionality. This feature is necessary to programmatically close a payment method request from the app.

At present, while attempting to use cancelPaymentIntent, the screen with the payment request remains visible, causing a disruption in the user experience. Supporting cancelCollectPaymentMethod would address this issue by providing a proper way to cancel the payment method request and close the related UI.

References Here’s the link to the relevant API in the Stripe Terminal React Native SDK: StripeTerminalSdkType - cancelCollectPaymentMethod Stripe docs

Expected Behavior • When invoking cancelCollectPaymentMethod, the payment method request should be canceled, and any related UI screens should be properly closed.

Current Behavior • Using cancelPaymentIntent does not close the screen with the payment request, leading to a less-than-ideal user experience.

Steps to Reproduce

  1. Initiate a payment method collection using the mek_stripe_terminal plugin.
  2. Attempt to cancel the request using cancelPaymentIntent.
  3. Observe that the payment request screen remains visible.

Why This Matters • This feature is critical for providing a seamless user experience in scenarios where payment collection needs to be canceled or reset programmatically. • It aligns with the existing functionality provided by Stripe’s React Native SDK and would greatly enhance the usability of the Flutter implementation.

Thank you for considering this feature request! Let me know if you need any additional details or logs to assist in the implementation.

kekko7072 commented 22 hours ago

I see that it already support the method on terminal.dart but it's not made public, i tried with adding a public callable function but didn't work.

  /// Cancels an [CaptureMethod].
  ///
  /// Cancel the request of payment method
  Future<void> get stopCapturePaymentMethod async =>
      await _platform.stopCollectPaymentMethod(hashCode);

i don't get any response from the terminal.