Skip to content

Payment Modal Not Dismissing #66

@AhmedHF

Description

@AhmedHF

GoSell SDK React Native - Payment Modal Not Dismissing After Callback

Issue Summary

The GoSell SDK's native payment modal does not automatically dismiss after the payment callback fires, causing the app to become frozen/unresponsive. Although the payment completes successfully and JavaScript navigation occurs, the native payment screen remains visible on top of the React Native views, blocking all touch events.

Environment

  • Package: @tap-payments/gosell-sdk-react-native
  • Version: 2.3.71 (tested)
  • Platform: iOS and Android
  • React Native Version: 0.80.0

Steps to Reproduce

  1. Initiate a payment via the GoSell SDK
  2. Complete the payment successfully (card processing succeeds)
  3. Observe the SDK callback fires and returns SUCCESS status
  4. Expected: Payment modal dismisses, app returns to normal state
  5. Actual: Modal stays on screen, app becomes frozen and unresponsive

Root Cause

The SDK's session.start() method displays a native payment modal, but there is no automatic dismissal mechanism triggered by the callback. The callback fires and is handled in JavaScript, but the underlying native UIViewController/Activity is never dismissed.

Evidence

From iOS Bridge.swift (ios/Classes/Bridge.swift):

  • session.start() is called in startPayment() method
  • session.stop() is available but only triggered by timeout in terminateSession()
  • No automatic dismissal occurs when payment callback fires

From Android (RNGosellSdkReactNativeModule.java):

  • Similar issue: startSDK() initiates the payment flow
  • No corresponding method to terminate/dismiss the session from JavaScript

Expected Behavior

After the payment callback fires (success, failed, or cancelled), the SDK should either:

  1. Automatically dismiss the payment modal, OR
  2. Expose a public method to dismiss/terminate the session from JavaScript

Workaround (Temporary)

We implemented a patch that exposes terminateSession() method to JavaScript:

// Call after SDK callback fires
RNGoSell.goSellSDK.terminateSession();

Patch file: Available upon request

Suggested Fix

  1. Add automatic dismissal of the payment modal after callback completion
  2. Alternatively, expose a terminateSession() / closePayment() method that can be called from JavaScript
  3. Update documentation to clarify the lifecycle of the SDK session

Related Code

Impact

  • Severity: High - App becomes completely unresponsive
  • Frequency: 100% reproducible on successful payments
  • Platforms Affected: iOS, Android

This issue blocks production usage of the SDK. A workaround has been implemented via patching, but an official fix is needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions