#brittkim

1 messages · Page 1 of 1 (latest)

bronze tapirBOT
smoky cave
#

hello! can you share the customer id?

proven shard
#

cus_Npv7BwwRwNwcPe

smoky cave
#

what's the request id where you set invoice_settings.default_payment_method to the paymentMethodId?

proven shard
#

Oh, how would I find that? I just set it as I'm creating the user

smoky cave
#

how are you creating the user?

proven shard
#

Using nodejs stripe package await this.stripe.customers.create({ IN HERE });

smoky cave
#

i don't see any invoice_settings.default_payment_method being passed in the request

bronze tapirBOT
proven shard
#

Pretty wild

dull kelp
#

Hi @proven shard I'm taking over

proven shard
#

I don't see payment_method being set either in that POST body

#

but it must be getting set, as I did make a purchase, right?

dull kelp
#

What's the implementation of paymentProvider.createCustomer() function?

proven shard
#

Oops, sorry, I didn't realized I shared the abstract

dull kelp
#

OK, can you run your code and send me the request ID?

proven shard
#

Yes

#

Hm, what is the request ID? This is the full response I just got ```{"id":"cus_NpvsE1pAztkh2M","object":"customer","address":null,"balance":0,"created":1683259973,"currency":null,"default_source":null,"delinquent":false,"description":"New Whag Customer 5","discount":null,"email":"b@b.com","invoice_prefix":"378B2C46","invoice_settings":{"custom_fields":null,"default_payment_method":null,"footer":null,"rendering_options":null},"livemode":false,"metadata":{},"name":"B","next_invoice_sequence":1,"phone":null,"preferred_locales":[],"shipping":null,"tax_exempt":"none","test_clock":null}

#

Btw, I just made another payment and logged the object I am passing to the stripe function, and it is {"name":"B","email":"b@a.com","payment_method":"pm_1N4G3uIxIeY6zCg7V0YGnkgV","invoice_settings":{"default_payment_method":"pm_1N4G3uIxIeY6zCg7V0YGnkgV"},"description":"New Whag Customer 5"}

dull kelp
proven shard
#

I'm totally passing it to the lib function :🤷:

dull kelp
#

Save the file and run again

proven shard
#

This is what I'll be running, so the logs will reflect

#

LOG [PaymentsService] Stripe customer created {"id":"cus_NpvzGUdj5OISEe","object":"customer","address":null,"balance":0,"created":1683260398,"currency":null,"default_source":null,"delinquent":false,"description":"New Whag Customer 5","discount":null,"email":"b@z.com","invoice_prefix":"BBB5CD3E","invoice_settings":{"custom_fields":null,"default_payment_method":null,"footer":null,"rendering_options":null},"livemode":false,"metadata":{},"name":"B","next_invoice_sequence":1,"phone":null,"preferred_locales":[],"shipping":null,"tax_exempt":"none","test_clock":null}

dull kelp
#

do console.log(customerData.paymentMethodId) and see what it prints

proven shard
#

Okay, our side deserves to be burned alive

#

Thanks! Sorry for the bother!

dull kelp
#

no problem, so did you find out the root cause?

proven shard
#

yes, the field is payment_method not paymentMethodId

#

One question though. How was I able to make a subscription if my paymentId was null?

dull kelp
#

If a payment is needed when creating a subscription, then the creation will fail and you'll see the error message tells you that a payment method is needed.

#

You can create a subscription with trial, where an immediate payment isn't required.

bronze tapirBOT
proven shard
uncut totem
#

👋 Taking over this thread

#

If you have collected payment method details, you may set the default_payment_method when creating a subscription with trial