#billymeetssloth - Subscriptions
1 messages · Page 1 of 1 (latest)
Hello! I think the issue is you're trying to use a mix of legacy APIs and newer APIs in a way that won't work. stripe.customers.createSource is legacy, and default_payment_method is not. Have a look here for more information: https://stripe.com/docs/payments/older-apis
Happy to answer any questions you have after reading through that!
Awesome, Thanks @knotty egret . I am not set on using any method, just whatever is best, in this case it might be the newer APIs. What would be the best route to taking a stripeCardToken and connecting to an existing customer and then creating a subscription from the stripeCardToken.?
Tokens are also legacy, so ideally you would switch to their replacement: Payment Methods.
Can you tell me more about what you're building and where the Token you have now is coming from?
Not a problem. This is really good information.
Right now we have people setting up subscriptions in app using a stripe session
and that works perfectly
the improvement we are trying to make, is to add setting up a subscription during the sign up process for our app
Id rather not direct customers to stripes checkout during sign up, as that hop adds a lot of friction to the sign up process
so i would like to just ask for the card number right there
Is this an iOS/Android app? If so are you using our SDKs?
That's a third-party library, so we can't give you a ton of help with that specifically (although the community there will hopefully be able to help if you have questions specific to that library). That said, it looks like that's a wrapper around Stripe.js, so you likely want to investigate the stripe.createPaymentMethod and/or stripe.confirmCardPayment methods:
stripe.createPaymentMethod: https://stripe.com/docs/js/payment_methods/create_payment_method
stripe.confirmCardPayment: https://stripe.com/docs/js/payment_intents/confirm_card_payment
Or, if you have free trials, probably stripe.confirmCardSetup: https://stripe.com/docs/js/setup_intents/confirm_card_setup
perfect
ok, so my misunderstanding was this VueStripe library is using the old method of doing it
we dont need to use it, just normally like to stick to well vetted libraries when possible
Parts of it might be, but if it's wrapping Stripe.js you should be able to use anything in Stripe.js.
but it shouldnt be an issue to just use the stripe javascript SDK to call createPaymentMethod
well, to be frank too
Vue/React hate when you include script tags
since they want you to make it part of the webpack build
which is why i was leaning towards this library
but all good, we can find a way around that problem
🙂
Sounds good! Let us know if you need anything else!