#ankit_638-paymentsheet-callback

1 messages · Page 1 of 1 (latest)

zenith merlin
#

Hello there. Are you seeing a specific error?

fervent aurora
#

No error

#

But Not getting callback on this function

zenith merlin
#

Can you share code please

fervent aurora
#

public void onPaymentSheetResult(final PaymentSheetResult paymentSheetResult) {
if (paymentSheetResult instanceof PaymentSheetResult.Canceled) {
Toast.makeText(fragment.getContext(),
"Payment Canceled, please try again",
Toast.LENGTH_LONG
).show();
} else if (paymentSheetResult instanceof PaymentSheetResult.Failed) {
Toast.makeText(
fragment.getContext(),
"Payment failed, please try again",
Toast.LENGTH_LONG
).show();

        Log.e("App", "Got error: ", ((PaymentSheetResult.Failed) paymentSheetResult).getError());
    } else if (paymentSheetResult instanceof PaymentSheetResult.Completed) {

        
    }
}
#

public StripePaymentHelper(Fragment frag){
this.fragment = frag;
PaymentConfiguration.init((Context) fragment.getActivity(), STRIPE_PUBLISHABLE_KEY);
paymentSheet = new PaymentSheet(fragment, this::onPaymentSheetResult);
}

fervent aurora
#

@zenith merlin : can you pls let me know

#

what is the issue.

zenith merlin
#

Sorry, I'll take a look shortly

fervent aurora
#

sure, pls let me know if you need more code

zenith merlin
#

Hey, sorry for the delay

#

To be clear, you're expecting a callback on a successful payment?

#

There's nothing in your else if block (that I'd expect to be triggered on a successful payment):

} else if (paymentSheetResult instanceof PaymentSheetResult.Completed) {
}
fervent aurora
#

yes

#

Even onPaymentSheetResult is not getting called.