#kaustuva-le-sources

1 messages · Page 1 of 1 (latest)

gray bone
fleet thunder
#

Thanks Alex.

What I am also looking for is....a way to pass card information and create a source.
This document is not super detailed about the options I need to pass for creating the source with a card (i.e. card number, other details etc) -> https://stripe.com/docs/api/sources/create

My code:
const source = await stripe.sources.create({
type: 'card',
currency: 'aud',
owner: {
email: 'test1@example.com'
},
// need to check params to pass for a card here
})

error message:
Error: Missing required param: card.

gray bone
#

using PaymentIntents and PaymentMethods would allow you access to many new features which using Sources and Charges wouldn't have

fleet thunder
#

Thanks. However if I did want to create a source with a card how would I do that?

frosty zinc
#

Hi, I'm taking over alex-stripe.

#

But I would strongly recommend to use Checkout Session or PaymentIntent instead.

#

Token and sources are an old way of implementing Stripe.

fleet thunder
#

Thanks Soma

fleet thunder
#

How do I make my subscription schedule use a particular source? Can I pass the source id as a parameter?

frosty zinc
#

I don't see a way to set that on the subscription schedule.

fleet thunder
#

So if I'm using sources how do I start a subscription for a customer on one of their saved sources?

#

Also, in case of paymentIntent/PaymentMethod how do I attach it to a subscription schedule(can I create subscription schedule with a peymentMethod)?

frosty zinc
fleet thunder
#

Thanks

fleet thunder
#

I'm trying to attach an existing source to a csutomer object. Both the source and customer are in the connect account. I'm however using my platform key.

await stripe.customers.createSource(
connectId,
{
source: subscription_data.source,
},{ stripeAccount: stripe_connect_account_id })

This doesn't seem to work. The error I get is missing required param: source

Is there any way to attach the source to the customer on my connect account?

elder pebble
#

Can you share the ID of the failing API request? (req_xxx)

fleet thunder
#

req_n4aIh3hKCWVrhe

elder pebble
#

Yeah, there's no parameters passed in the payload we've received

#

Are you sure that's the code that's being executed?

fleet thunder
#

Yeah

elder pebble
#

My guess is subscription_data.source is undefined. stripe-node will remove any parameters without a value

fleet thunder
elder pebble
fleet thunder
#

So the autodebit will happen from the default_source of the subscription schedule no matter what the user's default source is?

elder pebble
#

Yes, exactly. default_source on the subscription will take precedent over the default source of the associated customer

fleet thunder
#

So if I have default_source set on subscription schedule....I don't need to worry if the customer's default source changes before the autodebit as long as the default_source on sub schedule remains the same?

elder pebble
#

Exactly

fleet thunder
#

actually soma mentioned in the thread above that setting a source on sub schedule is not possible. But seems to be working fine for me.

elder pebble
fleet thunder
elder pebble
#

Yeah I guess it's undocumented. Sources are an older API now so we don't recommend using them unless a legacy integration

fleet thunder
#

So for now, we're creating a source, attaching the source to the customer and then creating a sub schedule with the source as the 'default_source' for the sub schedule.
We'll switch to paymentMethods soon.

elder pebble
#

Cool!

fleet thunder
#

Thanks a lot for all the help

elder pebble
#

Np!