#tomasfejfar_code

1 messages ยท Page 1 of 1 (latest)

dusky lavaBOT
#

๐Ÿ‘‹ 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/1357323935011573913

๐Ÿ“ 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.

mortal sinew
#

It says that it's removed

#

And to check payments object

#

I checked inpay_0R9mTe6BNHJembTsSEn7UDpl

ashen junco
#

PaymentIntent now has latest_charge property

mortal sinew
#

And the charge is not there

#

Aha!

#

so get payments from there i get payment intent and from there paymentIntent id and I receive the P.I. and from it the chargeId ooof ๐Ÿ™‚

ashen junco
#

Yes

mortal sinew
#

Where did paid_out_of_band go?

#

It's not in payment intent

#

And it's no longer in invoice

Removed the payment_intent, charge, paid, and paid_out_of_band fields from the Invoice object.

ashen junco
#

But not sure it's saved anywhere. I guess in this case the attached PaymentIntent is cancelled

mortal sinew
#

So if paymentIntent is canceled I can be sure it's paid out of band?

ashen junco
#

Do you have an example Invoice ID?

#

Yes, I did a test on my side and it seems like there will be a cancelled PaymentIntent in this case.

mortal sinew
#

I don't have any out-of-band invoice unfortunately. It's jsut that the code checks for it.

#

I now created one in_0R9n7D6BNHJembTssfeCQ1Mi and apparently the behavior changed as well :/

#

This was how we detected out of band before:

$isNotRemainingSameAsDue = $invoice->amount_remaining !== $invoice->amount_due;
        $isPartlyPaid = $invoice->amount_paid !== 0;
        if ($isPartlyPaid || $isNotRemainingSameAsDue) {
            throw new Exception(sprintf('Invoice "%s" does not look like paid out of band', $invoice->id));
        }
#

But this doesn't work anymore as it's like this

#

But as you said the payment intent is canceled

#

Also there is

ashen junco
#

Since it's a breaking API version update it's expected that you will need to change some code to handle it

dusky lavaBOT
mortal sinew
#

So for the time being I'm using following out-of-band payment detection:

  $isPaymentIntentCanceled = $paymentIntent->status === 'canceled';
        $isPaymentIntentChargeMissing = $paymentIntent->latest_charge === null;
        $isAmoundRemainingZero = $invoice->amount_remaining === 0;
        $isAmoundPaidEqualDue = $invoice->amount_paid === $invoice->amount_due;
#

If all of those are true, it's paid out-of-band

#

Doh! I was able to create invoice that'S paid out-of-band, but ithas charge ๐Ÿ™ˆ