#yomapi_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1337296811752165426
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! The PaymentIntent itself doesn't have a parameter that points to the Checkout Session. However, you can pass the metadata in the Checkout Session such that it's reflected in the underlying PaymentIntent.
If you pass in the metadata in https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-metadata, only the Checkout Session object will contain the metadata.
If you pass in the metadata into payment_intent_data.metadata (this is for mode="payment") - the PaymentIntent will contain that metadata : https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
If you really need to find the Checkout Session id for a PaymentIntent, you can use https://docs.stripe.com/api/checkout/sessions/list, where you can pass in the PaymentIntent id as a parameter
Thansk for fast asnwer!
so It should be like this...
import com.stripe.param.checkout.SessionCreateParams;
import java.util.HashMap;
import java.util.Map;
Map<String, String> metadata = new HashMap<>();
metadata.put("orderId", "12345");
metadata.put("customerEmail", "customer@example.com");
SessionCreateParams params = SessionCreateParams.builder()
.setMode(SessionCreateParams.Mode.PAYMENT)
.setSuccessUrl(successUrl)
.setCancelUrl(cancelUrl)
.addAllLineItem(lineItems)
.setPaymentIntentData(
SessionCreateParams.PaymentIntentData.builder()
.putAllMetadata(metadata)
.build()
)
.build();
looks correct at a quick glance, I'll recommend running it and making payment to see if it works as expected
Ok! thanks for answer!
I'm sorry for bothering you by asking something that was already in the document.