code: @SuppressWarnings("unused")
      @Override
      public void onPaymentSuccess(String razorpayPaymentID) {
          try {
              Toast.makeText(this, "Payment Successful: " + razorpayPaymentID, Toast.LENGTH_SHORT).show();
          } catch (Exception e) {
              Log.e(TAG, "Exception in onPaymentSuccess", e);
          }
      }
docs: The name of the function has to be
  onPaymentSuccess
  Wrap your code in try catch, as shown, to ensure that this method runs correctly