#chalmagean

1 messages ยท Page 1 of 1 (latest)

lament belfryBOT
near lion
#

๐Ÿ‘‹ happy to help

coarse sundial
#

one example would be req_h0JMh78fAUjoB1

near lion
#

taking a look

coarse sundial
#

it looks like the las one I tried went through... so I'm confused

#

req_59BhCgx8S5pXlh

#

I'm missing something and I don't know what ๐Ÿ™‚

near lion
#

these are totally different requests
the 1st one:

  • collection_method: "charge_automatically"
  • payment_behavior: "default_incomplete",
    the 2nd one
  • collection_method: "send_invoice"
  • payment_behavior: "allow_incomplete",
#

so it's normal to see a different behavior

coarse sundial
#

with charge_automatically why do I get the error?

#

my goal is to charge for the subscription right away, without sending invoices

#

and I'm getting that error even though I fill in the card details

#

and the card payment method is configured

#

if I look at the customer object (req_h0JMh78fAUjoB1), I can see that there's a ACH Credit Transfer payment method configured

#

I don't know where that's coming from

boreal pebble
#

Hi, I'm taking over my colleague, please let me catch up

coarse sundial
#

sure, thank you

boreal pebble
#

For your case, you need to add payment_behavior: 'default_incomplete', and collection_method: 'charge_automatically'

coarse sundial
#

ok, I can do that

#

why isn't error_if_incomplete working?

boreal pebble
#

Why is it not working?

coarse sundial
#

I mean if I set the payment behavior to error_if_incomplete, I get that missing payment method error message

#

which I don't get with default_incomplete

boreal pebble
#

Because, as the name suggests, it throws an error if it is not possible to complete the payment.

coarse sundial
#

and why is it not able to complete the payment? I'm providing the card details for it

boreal pebble
#

Can you share the request ID req_xxx?

coarse sundial
#

req_3XeR3yiMvvyEPw

boreal pebble
#

What are you expecting to happen?
Do you want to charge the Customer's default_payment_method? Or collect the Payment Method afterwards?

coarse sundial
#

I want to charge the customer immediately after submitting the checkout form (using the card they used on the form)

boreal pebble
#

I understand.
You need to create a subscription with payment_behavior: 'default_incomplete' and then use the Client Secret to collect the payment details on the frontend.

coarse sundial
#

yes, I noticed that one works, but I was wondering why error_if_incomplete does not work

boreal pebble
#

Because when you create the subscription there is no working default payment method available.

coarse sundial
#

even though I'm providing one? via the form

boreal pebble
#

What form?

coarse sundial
#

the checkout session form

boreal pebble
#

Have you created a SetupIntent?

coarse sundial
#

I'm creating a subscription on the callback from this ๐Ÿ‘†๐Ÿป form

#

so I'm providing a payment method

boreal pebble
#

So, are you creating a Checkout Session with type "subscription"?

coarse sundial
#

yes

boreal pebble
#

Okay, so what's the problem?

coarse sundial
#

I don't see why I need to go through the incomplete status

#

since I have the payment method right there

#

so it could either charge the card, or fail

#

if successful, I create the subscription, and if not, I won't create the subscription

boreal pebble
#

Because the Subscription is created in the incomplete state when the Checkout Session is created, and we don't have the Payment Method at that time

coarse sundial
#

Ok, I see... thank you

boreal pebble
#

Happy to help. Let me know if you have any other questions.