#lou-from-evergiving_unexpected

1 messages ¡ Page 1 of 1 (latest)

high flickerBOT
#

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

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

tulip bough
#

Hi there

#

Could you be a little more explicit about the double charge? What are those PaymentIntent ids?

scarlet forum
#

Hi there, thanks for getting back to me! Let me provide more details

#

For this customer, I have a first payment processed : pi_3SubwKBcQAyRw7rx069LMnUO

#

Followed by a second payment when setting up the subscription : pi_3SubwOBcQAyRw7rx0Vsq7vQU

#

I would only want the second one, not the first

#

The outcome I'm looking for would be identical to cus_TsMdQM7ldTOnCW with payment ID pi_3SubuRBcQAyRw7rx15LgThed

tulip bough
#

But my point is you control this - when you call the PaymentIntents API, you create a one-time payment.

When you call the Subscriptions API (and the subscription is charging up front) you create a payment now indirectly, which results in a PaymentIntent and then Stripe will create further payments according to the way the Subscription is configured

scarlet forum
#

For cus_TsMfPf6DU9QAnY, in the Stripe dashboard, I have those two payment IDs

#

And I'm doing the exact same call for cus_TsMdQM7ldTOnCW, which only generates the payment linked to the subscription

#

This is using another test card

high flickerBOT
scarlet forum
#

4000002500003155

#

So, why would one only generate one payment ID (and one charge) correctly, and the other generate two payments?

#

I understand we control this, but I need to understand wht we need to change in the code to prevent multiple charges on some cards

magic coral
#

hey there, stepping in for my colleagues

#

let's take a step back: what is your actual end goal? A subscription created on a customer with one payment for the first invoice?

scarlet forum
#

Hey there, thanks
Yes, the end goal is to create a subscription with one payment on the first invoice

#

I achieve this with our current code for some test cards, but 4242 is behaving differently

magic coral
#

Broadly speaking, it doesnt really make sense to me that the test card you use would change the behaviour as youve described

scarlet forum
#

me neither

magic coral
#

I'm not saying its impossible, but i find i quite surprising

scarlet forum
#

me too

magic coral
#

I suspect there is some other factor here

scarlet forum
#

there may be, but I have some very unhappy clients

#

Do you want an example of the expected outcome we are looking for?

magic coral
#

Thats cus_TsMdQM7ldTOnCW as a model? right?

#

I see the following steps here:
1/ create the customer
2/ attach a PM
3/ setting this customers invoice default PM
4/ creating a setup intent & confirming for that PM
5/ creating a subscription, allowing it to use the default PM you've set up

scarlet forum
#

I'm not a developer, but that sounds right

magic coral
#

This seems fine, if a bit verbose/suboptimal (you can create the subscription and get a setup or payment intent automatically to confirm with a new payment method, but lets put that aside)

#

And what is the example payment that is not what you expect?

scarlet forum
#

The cus is cus_TsMfPf6DU9QAnY

#

I have the subscription, the second one in the image above

#

But I seem to have a payment intent prior to the subscription

#

and I end up with two charges / two payments

magic coral
#

Payment pi_3SubwKBcQAyRw7rx069LMnUO happens first with this standalone payment intent request: https://dashboard.stripe.com/acct_1EuGO9BcQAyRw7rx/test/logs/req_CzzXsLN03u9S9W
Payment pi_3SubwOBcQAyRw7rx0Vsq7vQU happens second during this subscription creation: https://dashboard.stripe.com/acct_1EuGO9BcQAyRw7rx/test/logs/req_YDQncqRLzOfgXf

#

That standalone payment intent request seems to be the piece you dont expect, since you say you're dealing with subscriptions only

scarlet forum
#

So, for this card we add a request for a standalone payment intent request?

#

Yes, it is. And I don't get :

  1. why we're requesting a payment intent
  2. why it only happens with this test card
#

I can assure you I used the same code for all my tests, and the change in behaviour doesn't make sense to me

magic coral
#

It may be the same code, but it must be a different path

#

I can't really tell you why, you (or your developer) will need to review your integration to determine why that happens

#

But this request to create that separate payment intent is an explicit separate request from your servers

scarlet forum
#

And on your side can you see if we sent the same payment intent request for cus_TsMdQM7ldTOnCW?

#

I understand that I'm a pain, but knowing the above would be helpful to me

magic coral
#

No, i don't see that same pattern on cus_TsMdQM7ldTOnCW -- i see no standalone payment intents there

scarlet forum
#

Thanks. Do you know if test card 4242 requires a microtransaction to trigger 3DS?

magic coral
#

What do you mean?

scarlet forum
#

Let me rephrase, if I was to post a request only for a subscription using that test card, would 3DS get triggered?

magic coral
#

No likely no, the 4242 card does not require 3ds and payments can be completed without authentication

#

If you want to require authentication for a first payment, thats what the 3155 card is for

scarlet forum
#

Yeah, I think my code is taking an incorrect path because 3DS isn't triggered when it expects it to be

#

Final question, does Stripe offer a code review service? As in, if I was to share our code, could Stripe developers review it and tell us what we're doing wrong ?

magic coral
#

Not exactly, no, in terms of high level review aligning with your product requirements. BOth here and via support we can help you identify how/why something is happening and how to change it, but in terms of flows in your app logic you will need to review that.

scarlet forum
#

TBF, we're already paying 10 developers, I would hope they can nail it at some point. But this is our fourth iteration of this specific flow and we keep hitting errors.

#

Thanks for your help, I appreciate it.

magic coral
#

NP -- happy to get your focus pointed in the right direction