#miaina_api

1 messages · Page 1 of 1 (latest)

rough axleBOT
#

👋 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/1360282162003316857

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

charred hazel
#

Hi! What exception are you getting? What Stripe SDK (or programming language) are you using?

stark geode
#

hello

#

Cannot cancel a refund unless it has a status of requires_action.

#

I just executed a refund

charred hazel
#

That Refund was in a 'submitted' state, so you can't cancel it.

Can you tell me more about the underlying thing you're trying to accomplish here?

stark geode
#

Well

#

I did not want to cancel it

#

I just want to create a refund

#

i did it

#

but

#

automaticaly a cancel request is raised

#

1 second later

#

i'm working on the testing environment

#

with the PHP SDK

#

Version de l'API
2025-02-24.acacia
Par défaut

#

I ask myself if it's an bug from the test environment.

#

I will test on Production Test environment

charred hazel
#

One sec.

#

automaticaly a cancel request is raised

What does that mean?

stark geode
#

every time i execute a Refund::create I get this error

charred hazel
#

Right. What is the status of the Refund that you are trying to cancel?

stark geode
#

The refund works well

#

the error is raised right after (1 second according to the stripe log) I execute the refund request

charred hazel
stark geode
#

I don't know to check that

#

succeeded

#

I checked the "refund.updated" event and it's succeeded

#

"id": "pyr_1RCjm8PZRhwkJRa3IQGs8S5x",
"object": "refund",
"payment_intent": "pi_3RByANPZRhwkJRa32LhPYeTh",
"status": "succeeded",

charred hazel
#

Then you can't cancel it, because it's not in a requires_action state.

stark geode
#

Well

#

i don't try to cancel it

#

I just send a Refund request

charred hazel
stark geode
#

Ok

#

the only thing I do is

#

try {
$refund = Refund::create(
[
"charge" => $paymentOrder->getStripeChargeId(),
"amount" => $amount * 100
]
);

#

An exception is raised

#

automatically

#

with this error

#

I don't get why

charred hazel
#

That code is not what is causing this error.

stark geode
#

I catch the exception in this try

#

Guess I will try on the Prod test environnement. I've already encountered some strange behaviour with the new Test environnment

#

thank you for your time

charred hazel
#

Don't test in prod.

#

You have more than one API call in that try/catch block if you're getting that exception.