create and get Invoice information after one-time payment in stripe

Viewed 28

I'm using spring boot to create session on stripe and validate session after payment is done.

createsession()

SessionCreateParams params =
                SessionCreateParams.builder()
                    .addPaymentMethodType(SessionCreateParams.PaymentMethodType.CARD)
                    .setMode(SessionCreateParams.Mode.PAYMENT)
                    .setSuccessUrl("some url")
                    .setCancelUrl("some url")
                    .setClientReferenceId(appProductId)
                    .addLineItem(
                        SessionCreateParams.LineItem.builder()
                            .setQuantity(1L)
                            .setPrice(15*100L)
                            .addTaxRate(taxRate)
                            .build())
                    .build();

            Session session = Session.create(params);
            SessionCreationResponseDto response = new SessionCreationResponseDto();
            response.setId(session.getId());

However, I need to get the receipt/invoice for the same. How should I create the invoice in one-time payment in stripe and how will I get the invoice information for later usage (maybe in my application, I need to show a list of downloadable pdf invoices for the account )

any suggestion would be helpful here.

1 Answers
Related