#MurukuBaby- Checkout Session
1 messages ยท Page 1 of 1 (latest)
i am trying to follow this https://stripe.com/docs/checkout/quickstart?lang=java to test payment
but idk what to put in PRICE_ID in
post("/create-checkout-session", (request, response) -> { String YOUR_DOMAIN = "http://localhost:4242"; SessionCreateParams params = SessionCreateParams.builder() .setMode(SessionCreateParams.Mode.PAYMENT) .setSuccessUrl(YOUR_DOMAIN + "/success.html") .setCancelUrl(YOUR_DOMAIN + "/cancel.html") .addLineItem( SessionCreateParams.LineItem.builder() .setQuantity(1L) // Provide the exact Price ID (for example, pr_1234) of the product you want to sell .setPrice("{{PRICE_ID}}") .build()) .build(); Session session = Session.create(params);
you should create a product and a price first
and then use that price id
or you could use price data https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oke thanks ill try it out
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!
Is it possible to use check Out without an account? Just need it for testing purposes for my project.
Not really no. There's a demo you can try out here: https://checkout.stripe.dev/
Preview some of the features available in our prebuilt, hosted payment page.