#bogdan_api

1 messages ¡ Page 1 of 1 (latest)

fresh coyoteBOT
#

👋 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.

fickle yewBOT
#

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.

tall crown
#

Long chargeFee = charge.getApplicationFeeAmount();//I get null
Not the application fee amount

#

you need to check the balance_transactions object on the charge

vocal gull
#

getBalanceTransactionObject is not exposed anymore paymentIntent.getLatestCharge()

#

I do not have that method

tall crown
#

What SDK are you using ?

vocal gull
#

implementation 'com.stripe:stripe-java:24.1.0'

tall crown
#

Let me check...

tall crown
#

paymentIntent.getLatestChargeObject().getBalanceTransactionObject()

vocal gull
#

one sec

#

I see I got lost in methods. Sorry about that. I got the method. I'm testing this now.

tall crown
#

No worries! Happy to help!

fresh coyoteBOT
vocal gull
#

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

tall crown
#

You can use stripe cli

vocal gull
#

I only have the sessionId. How do I get from there to
stripe trigger payment_intent.succeeded
via cli?

tidal holly
#

stripe trigger checkout.session.completed should also trigger a payment_intent.succeeded event

vocal gull
#

I'm trying to build this. I do not find how to pass the seesionId as param

tidal holly
#

But otherwise the CLI actually makes requests to the API and generates new objects with new IDs

vocal gull
#

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?

tidal holly
#

Then you just use the stripe trigger command which will create and complete the session automatically for you

tidal holly
vocal gull
#

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.

tidal holly
#

OK and what issue are you running into with the CLI testing that?

vocal gull
#

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..) ?

tidal holly
#

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?

vocal gull
#

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]
tidal holly
#

OK, maybe it's --override checkout_session:id=xxx

#

Not overly familiar with the syntax

vocal gull
#
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"
  }
}
tidal holly
#

Yeah then I guess that won't work unfortunately

vocal gull
#

I will swap in my tests the id to a manual payid sesion and then query that.
Thank you for support.