#ignasidedieu_expanding-responses
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/1337100439543611484
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- ignasidedieu_api, 1 day ago, 17 messages
- ignasidedieu_docs, 1 day ago, 4 messages
Hello there
Can you share a request ID where you see this error?
The PaymentIntent you shared was generated from a Checkout Session?
Sorry, the PaymentIntent provided is not correct because I cannot create it. This is the request_id req_0JwOMg1vosk30n, I am seeing the error in our Integration Tests
Probably this piece of code can help understanding the issue:
List<String> list= new ArrayList<>();
list.add("latest_charge");
Map<String, Object> expandList= new HashMap<>();
expandList.put("expand", list);
expandList.put("payment_intent", createParams.build());
LOGGER.info("DEBUG: Create PaymentIntent with expandList={}", expandList);
paymentIntent = PaymentIntent.create(expandList, requestOptions);
Yep so if you look at that request in your Dashboard you can see you are passing payment_intent: "com.stripe.param.PaymentIntentCreateParams@5016013e", in the request body: https://dashboard.stripe.com/test/logs/req_0JwOMg1vosk30n
I'm not sure if PaymenyIntent.create allows to be expandable
So the expansion piece is correct
It does
The rest of your parameters are not being passed correctly.
And payment_intent is not accepted as part of the request, is it?
Hi ๐
I"m stepping in as my colleague needs to go. GIve me just a sec to check this request.
Okay, on the same page now. payment_intent is not a valid parameter when you are attempting to create a Payment Intent. What are you trying to do here?
I am trying to create a paymentIntent with the expansion of latest_charge in its response.
Okay so you need to pass amount and currency as parameters as we explain here
The expand parameter is being passed correctly but not the other parameters
So in this case instead of using PaymentIntentCreateParams I need to pass each value as a key pair
The doc I linked in my previous message shows the Java syntax in the code window on the right hand side
Or create a Payment intent like before and retrieve it after
e.g.
PaymentIntentCreateParams params =
PaymentIntentCreateParams.builder()
.setAmount(2000L)
.setCurrency("usd")
.setAutomaticPaymentMethods(
PaymentIntentCreateParams.AutomaticPaymentMethods.builder()
.setEnabled(true)
.build()
)
.build();
You need to use the correct setter methods for each parameter
Okay, I'll try set "expand" attribute
As you can see in our Expand doc, you can also use the addExpand() method for your params builder
I think this should work,
PaymentIntentCaptureParams params = PaymentIntentCaptureParams.builder()
.setAmountToCapture(amountToCapture)
.addExpand("latest_charge")
.build();
paymentIntent.capture(params, requestOptions);
Are you trying to create or capture funds for an existing Payment Intent? Those are two entirely separate actions