#cyclops_api

1 messages ยท Page 1 of 1 (latest)

silent micaBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

vapid joltBOT
#

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.

lunar bear
#

Hi there!

acoustic fox
#

So just to add when i do advance time the susbcription should use default payment method but it isn't using it

lunar bear
#

Just reading through your question to make sure I understand

acoustic fox
#

Hey!

#

Sure

lunar bear
#

I don't quite follow this:

after that I'm updating the default payment method where the card gets attached to customer but the payment gets failed and then I tried to advance time

What default payment method are you updating? Is this subscription.default_payment_method or customer.invoice_settings.default_payment_method ?

acoustic fox
#

customer.invoice_settings.default_payment_method

#

Quick question just to clarify, the option to make a payment_method default on customer "https://dashboard.stripe.com/test/customers/" url uses which api is it

stripe.Customer.modify(
"cus_NffrFeUfNV2Hib",
)

OR

stripe.PaymentMethod.attach(
"pm_1MqM05LkdIwHu7ixlDxxO6Mc",
customer="cus_NbZ8Ki3f322LNn",
)

lunar bear
#

Sorry, don't quite understand. The Dashboard doesn't always use the API to update/create objects; there are some Dashboard-specific endpoints.

acoustic fox
#

okay

lunar bear
#

Let's take a step back. Could you clearly summarize what you're trying to test with Test Clocks and what isn't working as expected?

acoustic fox
#

Yeah, sure

So I created an trial subscription with 4242 card which works as expected then I went to customer dashboard in stripe and change the default payment to 0341 (which gets attach to customer payment method but fails when invoice is charged), but when I use test clock to go to future time to charge to the subscription the subscription uses 4242 card insted of 0341 card (which is my default card which I changed manually for stripe customer dashbaord)

lunar bear
#

Gotcha, okay! If you look at the subscription, its default_payment_method is the 4242 card. If there's a value here, this takes precedence over the customer's invoice_settings.default_payment_method

acoustic fox
#

Okay got you on that now I want to understand how to make sure this case take customer default payment methid

#

method*

lunar bear
#

You should update the subscription to remove default_payment_method.

acoustic fox
#

Any reference, how can I do that?

#

If I don't send a "default_payment_method" while creating the subscription will it use customer default payment method?

lunar bear
#

Yes, if neither subscription.default_payment_method nor subscription.default_source are set, we'll default to customer.invoice_settings.default_payment_method

acoustic fox
#

Is it okay to pass it empty while creating the subscription?

#

This way I won't have to update it again, to save api calling.

lunar bear
#

Yep, this can be empty when creating the subscription

acoustic fox
#

Okay, thanks for the help, I have one more question if you can help me on that too

#

How to update default payment of a customer using stripe api

lunar bear
#

Can you be more specific? Is this after you've already created a PaymentMethod?

acoustic fox
#

Yes

#

Once I create a Paymentmethod and I have attach it to customer now I want to make it as a default payment method

lunar bear
#

But lets take a step back. You shouldn't have to make a separate call to attach a PM to a customer. How are you currently creating the PM?

acoustic fox
#

Creating PM on front-end and the parsing that PM ID to backend, calling PM.attach api on backend, to attach to the specific customer

lunar bear
#

Gotcha. And your intent in this case is to save and use that PM for future charges, correct? You're not saving that PM for an immediate payment?

acoustic fox
#

Yes, first a PM would be added and that is going to be a default one to the specific customer, so stripe can use it for subscription creation and in future if the end-user changes there default payment method we can charge it directly without updating the subscription.

lunar bear
acoustic fox
#

We are using PM method in frontend for the card entered by the customer, is it different then setup-intent?

#

We aren't using client_secret for payment, that's something which is getting handle on backend part and not on front end we are just creating PM from front-end parsing it to backend and the using it to do the payments

lunar bear
#

I recommend reading through the SetupIntent guide above. SetupIntents also use client secrets, but these are totally separate from the client secret used for a payment.

#

The guide above will still create a PM frontend, as part of a frontend request to confirmSetup. This confirmation request will automatically create a PM and attach the PM to a customer (as long as you passed a customer ID when creating the SetupIntent server side)

acoustic fox
#

Okay, let me go through the documentation, thanks for the help on payment_method ๐Ÿ™‚

lunar bear
#

Sure thing!

acoustic fox
#

Just last thing

#

Is setupintents similar to paymentmethod or both are completly different?

lunar bear
#

A SetupIntent is used to collect payment method details from a customer. When a SetupIntent is successfully confirmed, a PaymentMethod will be created

acoustic fox
#

okay, got it

lunar bear
#

This doesn't go into much detail regarding SetupIntents but they're similar to PaymentIntents. The primary difference is that a PaymentIntent is used to manage payment attempts/charging a customer now, while a SetupIntent is used to collect and store payment method details for future charges.

acoustic fox
#

Can we use it for subscription?

#

SetupIntents

lunar bear
acoustic fox
#

Okay, thanks for the help will look into it and will ping back to help if something else come's up ๐Ÿ™‚