#Bando-metadata
1 messages · Page 1 of 1 (latest)
Hi! The metadata you are passing is an array, but it should be an object.
So you need to do something like this:
metadata: {
'purpose': 'raffle',
'type': 'raffle'
}
Thank you! I pass payment_method on customers create but when i then create a subscription it returns error This customer has no attached payment source or default payment method.
what's the best way to use the payment_method passed to customer for subscription?
If you have an existing payment method, and want to use that for the subscription, then you need to set the payment method as the default one. For example update the customer using invoice_settings.default_payment_method https://stripe.com/docs/api/customers/update?lang=curl#update_customer-invoice_settings-default_payment_method
Oh damn, is there not a more convenient way to do it. I'm trying to do a little requests as possible
What exactly are you trying to do? What is your end goal here?
It's a nodejs script that will be pushed by a cron every 4 hours.
The script itself selects raffle winners to purchase a subscription using info from mysql db such as the payment_method
The issue is it may find 100 winners to create a subscription for at once
and i dont want it to cause any issues similarly to how it did when this was in PHP, however I understand PHP isnt a good language for tasks such as this (mass looping) so it may not even occur
The issues faced in PHP version was that it would hang etc due to long waits/timeouts
When creating the customer you can directly set invoice_settings.default_payment_method.
Awesome. that worked but im strangly getting this issue now
Weird as the card was saved as off_session
It's the test card, wasnt prompt to do 3dsecure on the stripe checkout for it
Is it normal for the test card to do something like this? It's using stripe checkout ($stripe->checkout->sessions->create)
$stripe->checkout->sessions->create(['success_url' => $successurl,'cancel_url' => $cancelurl,'payment_method_types' => ['card'],'mode' => 'setup','metadata' => ['purpose'=> 'setup', 'type'=> $setuppurpose]]);```
This is the code for the session creation
Can you share the PaymentIntent ID?
pi_3KwQypKhA5rJWycn1bwtbjKQ
Ok thanks. Looking
Ok can you also share the request id for creating the checkout session: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_58Yi1kin97dPNY
Ah ok so I believe this is happening because you created the payment method with a GB address, so we ask for authentication. Let me confirm that with a colleague though
You are just using the 4242 test card, correct?
The 4242 test card is US based?
Ah ok I see that on the testing page
I just tested it with card 4000058260000005 (UK debit) and it has the same issue
pi_3KwRWJKhA5rJWycn1x84Rti9 (paymentintent)
req_fnOjpPWOYWdFUH
So looks like it's because you have the “Request 3DS when supported” radar rule enabled
That will always require 3ds when it's supported
yeah but stripe checkout should prompt 3dsecure when a setup is being made shouldnt it?
No that's a separate setting for that actually
The setupintent is a bit redundant in your flow though. Setupintents only give 3ds exemptions for off session payments, but creating a subscription is inherently an on-session action
So what do you recommend?
Is there no way to do it?
What is your goal exactly?
Are you still here?