#bogdan_api
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/1219232522643312764
đ 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.
- bogdan_api, 19 minutes ago, 10 messages
- bogdan_connect-payout-timeline, 6 days ago, 28 messages
Long chargeFee = charge.getApplicationFeeAmount();//I get null
Not the application fee amount
you need to check the balance_transactions object on the charge
getBalanceTransactionObject is not exposed anymore paymentIntent.getLatestCharge()
I do not have that method
What SDK are you using ?
implementation 'com.stripe:stripe-java:24.1.0'
Let me check...
getLatestCharge returng the charge Id (String) you need to use getLatestChargeObject in order to get the object
paymentIntent.getLatestChargeObject().getBalanceTransactionObject()
one sec
I see I got lost in methods. Sorry about that. I got the method. I'm testing this now.
No worries! Happy to help!
Is there a way to triget via sdk an succesful checkout.session.completed event without using the browser as long as I know the sessionId and the payment method (card) ?
It would be usefull for integration testing in test mode
I only have the sessionId. How do I get from there to
stripe trigger payment_intent.succeeded
via cli?
stripe trigger checkout.session.completed should also trigger a payment_intent.succeeded event
I'm trying to build this. I do not find how to pass the seesionId as param
You can use the --override flag: https://docs.stripe.com/cli/trigger#trigger-override
stripe trigger checkout.session.completed --override checkout.session.id=cs_xxx
But otherwise the CLI actually makes requests to the API and generates new objects with new IDs
If you already have a cs_xxx ID of a completed session and you want to re-send an event then use the resend command: https://docs.stripe.com/cli/events/resend
I want to avoid opening a browser and comleting the session so I can continue automatic integration tests in test env.
Can I specify also the method used or by default is considered card?
Then you just use the stripe trigger command which will create and complete the session automatically for you
Depends, what specifically are you trying to test?
some payments funds sould be routed directly to connected accounts and I want to make suer that the routed funds do not exede the net from previously discussedBalanceTransactionObject. I also need to look that sessionId in my platformDatabase to know what to do with it.
Allow participats be active or not in different events.
OK and what issue are you running into with the CLI testing that?
Utill now I was oppanig the browser and compliting the payment. I want to automate this part just setting the sessionCompleted. Can I specify the modhod also (card, bankTransfer, etc..) ?
Well we don't encourage automated end-to-end testing with Checkout like you describe. What specifically differs in your logic depending on if the session wasa paid by card or a different method?
I understand that. I will not abuse it. But you still need as developer automation for testing. Especialy when you deal with fiat. It would be cool for you to provide a stripeEmulator. But I guess that is not on the table at the moment.
Ill see if I can triger this.
stripe trigger checkout.session.completed --override checkout.session.id=cs_xxx
If I do not get it working I would bropably pop back here again.
Is not working.
stripe trigger checkout.session.completed --override checkout.session.id=cs_test_a1McUFkeMACPwsKcyjV0jJX2E4ryCd66bAiEodrjoL1vKxP75o1JMIrfYo
A newer version of the Stripe CLI is available, please update to: v1.19.2
Invalid value for override flag (checkout.session.id=cs_test_a1McUFkeMACPwsKcyjV0jJX2E4ryCd66bAiEodrjoL1vKxP75o1JMIrfYo). The override flag requires the name of the fixture to apply (--override fixtureName:path.to.param=value).
Valid fixture names are: [product price checkout_session payment_page payment_method payment_page_confirm]
OK, maybe it's --override checkout_session:id=xxx
Not overly familiar with the syntax
stripe trigger checkout.session.completed --override checkout_session:id=cs_test_a1McUFkeMACPwsKcyjV0jJX2E4ryCd66bAiEodrjoL1vKxP75o1JMIrfYo
A newer version of the Stripe CLI is available, please update to: v1.19.2
Setting up fixture for: product
Running fixture for: product
Setting up fixture for: price
Running fixture for: price
Setting up fixture for: checkout_session
Running fixture for: checkout_session
Trigger failed: Request failed, status=400, body={
"error": {
"code": "parameter_unknown",
"doc_url": "https://stripe.com/docs/error-codes/parameter-unknown",
"message": "Received unknown parameter: id",
"param": "id",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_aGiiKkhMu9rLsw?t=1710761402",
"type": "invalid_request_error"
}
}
Yeah then I guess that won't work unfortunately
I will swap in my tests the id to a manual payid sesion and then query that.
Thank you for support.