#sree
1 messages · Page 1 of 1 (latest)
👋 happy to help
Hi tarzan
here is my issue
I am having questions regarding express connect integration and webhooks.
-
I use version 20.111.0(java) before. Then I had "Deserialization failed, probably due to an API version mismatch" for webhook events. Then I changed to 21.0.0 the issue is solved. Webhook worked perfectly.
-
When I integrated express connect, account creation, and account link creation both worked perfectly. But when I tried to implement payouts for connected accounts through the stripe checkout, I was having an issue with price_data. The issue is the price/amount is dynamic( not fixed product or price). setAmount(), setName() etc parameters are not working with current version( 21.0.0).
So my question is : -
Do we need to product and price for each payment in this version?
-
How to set dynamic amount and name with version 21.0.0
Thanks in advance.
this would take a moment please bear with me
sure
- I use version 20.111.0(java) before. Then I had "Deserialization failed, probably due to an API version mismatch" for webhook events. Then I changed to 21.0.0 the issue is solved. Webhook worked perfectly.
yes because the Java SDK are bound to a specific API version
ok
- When I integrated express connect, account creation, and account link creation both worked perfectly. But when I tried to implement payouts for connected accounts through the stripe checkout, I was having an issue with price_data. The issue is the price/amount is dynamic( not fixed product or price). setAmount(), setName() etc parameters are not working with current version( 21.0.0).
So my question is :- Do we need to product and price for each payment in this version?
- How to set dynamic amount and name with version 21.0.0
let me check that for you give me a moment please
ok sure, hope you understood the scenerio
yes just working on it
so basically starting version 21.0.0 related to the API version 2022-08-01 https://stripe.com/docs/upgrades#2022-08-01 we now have setUnitAmount for PriceData
The following parameters have been removed from create Checkout Session:
line_items[amount]
line_items[currency]
line_items[name]
line_items[description]
line_items[images]
You can use the price and price_data parameters instead.
we can't use just amount, instead need to create price data right ?
exactly
that means for every payment there should be a product->price right /
.addLineItem(LineItem.builder()
.setPriceData(
PriceData
.builder()
.setUnitAmount(100L)
.setProductData(
ProductData.builder().setName("").build()
)
.build())
.build())
.build();```
this is one way of making both the Price and Product be dynamic
but this will create price and product in stripe dashboard right ?
no Price/Product data wouldn't create prices/products in Stripe's Dashboard