Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PaymentSheet crashes on Android #232

Closed
1 of 3 tasks
anonimitoraf opened this issue Nov 16, 2022 · 1 comment
Closed
1 of 3 tasks

PaymentSheet crashes on Android #232

anonimitoraf opened this issue Nov 16, 2022 · 1 comment

Comments

@anonimitoraf
Copy link

anonimitoraf commented Nov 16, 2022

Platform

  • Web
  • iOS
  • Android - Capacitor 4

Describe the bug
I get this error when I attempt to present a PaymentSheet (and the app just crashes). Happy to share more info if needed.

2022-11-17 09:39:53.573 15361-15361/com.joinflux.flux E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.joinflux.flux, PID: 15361
    android.util.SuperNotCalledException: Activity {com.joinflux.flux/com.stripe.android.paymentsheet.PaymentSheetActivity} did not call through to super.onCreate()
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3661)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3813)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2308)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7898)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

JS code:

const createRes = await stripe.createPaymentSheet({
  paymentIntentClientSecret: clientSecret,
  customerEphemeralKeySecret: ephemeralKey,
  customerId: userId,
})
console.log({ createRes })
const paymentResult = await stripe.presentPaymentSheet()
console.log({ paymentResult })

Java code:

public class MainActivity extends BridgeActivity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      registerPlugin(com.getcapacitor.community.stripe.StripePlugin.class);
  }
  
  @Override
  public void onStart() {
    super.onStart();
  }
}
@anonimitoraf
Copy link
Author

Setting merchantDisplayName in the call to stripe.createPaymentSheet works

(Source)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant