#akii-PI vs orders
1 messages Β· Page 1 of 1 (latest)
π happy to help
Payment Intents (PI) are not meant to hold information about the prices/products etc... it's just a way of asking an amount of money of your user
So what can i use ?
if you want to keep track of the prices/products I would recommend you taking look at our orders API
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I basically want this flow ==> Save CC of user ==> Assign him the subscription and take payment from them
How should i go about doing this?
BTW im using Java, so i can't use Orders api right?
if you're talking about subscriptions then you should look at the subscriptions API
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and in there you have items and you can pass the prices
will that give me a client secret that i can pass to Client in the same way?
yes you'll have to expand on latest_invoice.payment_intent when creating the subscription
and use the client_secret of that object to pass to the front-end for payment
Okay, but should i first save the Credit Card for user???
you can or instead you can use this param https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_settings-save_default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and set it to on_subscription
which will save the payment method to the subscription object and will use it as the default_payment_method for that subscription
hmm, okay this means i must have a Payment Method already saved for the user..
no not at all
the parameter I've just sent you allows you to save the payment method that you are collecting using the client_secret and the Stripe Elements on the front-end directly on the subscription for future usage
yes you'll have to expand on latest_invoice.payment_intent when creating the subscription
okay
Also, when im using this clientsecret on front -end, which stripe method should i call? Should i call stripe.confirmPayment ??
yes
okay thanks for all the help βΊοΈ Would u mind not closing this thread for a while as im coding this ??
yes sure
Hi, I was adding this payment_settings.save_default_payment_method to my api request. How do i do this with Java??
Im doing this now..
.setPaymentSettings(
SubscriptionCreateParams.PaymentSettings.builder().build()
)
Are u familiar with this?
SubscriptionCreateParams.PaymentSettings.builder(),setSaveDefaultPaymetnMethod(
SaveDefaultPaymentMethod.ON_SUBSCRIPTION
).build()
)```
I think this might work, could you please try it and get back to me?
what version of the SDK are you using?
com.stripe:stripe-java:20.113.0
would you mind updating to version 20.129.0 the latest version
Okay doing that
Okay yes i found the method after updating
Now trying to run everything.
π
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!
Im getting this error : This customer has no attached payment source or default payment method. Please consider adding a default payment method. For more information, visit https://stripe.com/docs/billing/subscriptions/payment-methods-setting#payment-method-priority.
@cold ether Could u please look into this issue?
Can you share the req_xxx?
req_I6T3CwA7jtalVv
Ok, the error seems accurate to me:
cus_M0qrXNseB4cuKYhas no default PM.- You haven't passed the
payment_methodparameter.
Hey if you will look up in this thread , i was told by @zinc shadow that i don't need to have a Payment Method already saved for the user.
here..
Yes, but because you're using the default behaviour (allow_incomplete) it's expected a PM to be immediately available to charge. You should pass payment_behaviour: 'default_incomplete' on creation if you're capturing payment details after creating: https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
sure
It still gives the same error.
req_MqEBPYQt92csUL
Oh no wait
i think i made a mistake
Everything working?
Omg yes it Worked!!!! Thanks for the immense help here !! π π
sure, np!