0

I am using com.stripe:stripe-android:20.0.0 SDK for the android stripe payment process. I did all the code and payment get success and fire on payment success event. But I did not find any way to get my succeeded payment Transaction ID or any Transaction details like other payment gateways. Even the paymentSheetResult object has no other details attributes.

 private void onPaymentSheetResult(
        final PaymentSheetResult paymentSheetResult
) {
    if (paymentSheetResult instanceof PaymentSheetResult.Completed) {

        PaymentSheetResult pr = paymentSheetResult;
        showToast("Payment complete!");
    } else if (paymentSheetResult instanceof PaymentSheetResult.Canceled) {
        Log.i(TAG, "Payment canceled!");
    } else if (paymentSheetResult instanceof PaymentSheetResult.Failed) {
        Throwable error = ((PaymentSheetResult.Failed) paymentSheetResult).getError();
        showAlert("Payment failed", error.getLocalizedMessage());
    }
}
Istiyak
  • 693
  • 6
  • 15

1 Answers1

0

You can't get the PaymentIntent ID from the PaymentsheetResult.

But you can derive the PaymentIntent ID from the clientSecret that you pass to initialize the PaymentSheet. The format of clientSecret is pi_ABC_secret_123, and anything before the _secret is the PayementIntent ID (e.g., pi_ABC).

qichuan
  • 1,110
  • 7
  • 8