简体   繁体   中英

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

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.

Invoices are not sent for payments made using payment mode in Checkout. You can configure your email settings to automatically send an email receipt after a successful payment: https://stripe.com/docs/receipts

If you need to retrieve a receipt URL at a later date, you can access it from the underlying Charge object: https://stripe.com/docs/api/charges/object#charge_object-receipt_url

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM