#jhonsalazer-subscription-elements

1 messages ยท Page 1 of 1 (latest)

trim bloomBOT
proper escarp
#

Hi ๐Ÿ‘‹ Card Element flows are typically built directly on Payment Intents, so you'll want to look into this flow that leverages our Tax Calculation API to incorporate tax calculations into your flow:
https://stripe.com/docs/tax/custom

Use Stripe Tax APIs to calculate sales tax, GST, and VAT with Stripe's payments APIs and non-Stripe payment processors

solid lodge
#

Ah ok

#

Thanks!

#

I have other questions

#

How can do to relation product catalog with my connected account (seller in my paltform) ?

proper escarp
#

Can you elaborate on what you mean by that? If you're referring to associating a Payment Intent to a Price/Product object, that isn't supported by default and you would need to build custom functionality to achieve that. You would need to use a higher level object to leverage prebuilt associations with Price/Product objects (such as Subscriptions, Invoices, Checkout Sessions, Payment Links)

solid lodge
#

No, I have a lot seller with connected account, so When I create a product I woud like to associate product with connected account

proper escarp
#

You probably want to leverage metadata on the Payment Intent to add your own tracking information then:
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-metadata
metadata is a field on most of our objects, and allows you to store information on Stripe objects that is important to your flows:
https://stripe.com/docs/api/metadata

solid lodge
#

No, uhmmm

#

no, payment intent

#

Im talking about the products

proper escarp
#

Yes, but you're using a Card Element integration, right? Those use Payment Intents.

solid lodge
#

No no, I use checkout session for now

#

but this flow is independent of the checkout session, the product catalog is just crud, right?

#

so what i would like know how many product my seller has wiith id 1 , id 2, id 3, etc

#

no, payment, no checkout, no subscriptions

proper escarp
#

Sorry, still trying to grasp what you're saying. You want to count how many Products your Connected Account have?

solid lodge
#

I would like to know the inventory of the products through the connected account.

proper escarp
#

Oh, then you list the Products for your Connected Accounts. Using this endpoint:
https://stripe.com/docs/api/products/list
and this approach to make the request for your Connected Account:
https://stripe.com/docs/api/connected-accounts

solid lodge
#

ok, but my problem is in the time the create product how can I associate product with my connected account (seller ) ?

proper escarp
#

I need more details. Are you trying to create these Products on your Connected Accounts, or are you trying to create them on your Platform account with some way for you to know they are associated with a Connected Account?

solid lodge
#

I'm trying to create product on my Platform account, but I need to associate with a Connected Account (sellers)

proper escarp
#

Gotcha, that isn't a prebuilt concept. If a Product exists on your Platform, then in Stripe that Product is associated with your Platform. Since it sounds like you want to store custom data on an object for your own tracking purposes, it's a good time to look at metadata, but this time on the Product object.

solid lodge
#

ok, Thanks a lot! ๐Ÿ‘

proper escarp
#

Any time!

trim bloomBOT
solid lodge
#

I have other questions

#

I have connected acount "Fantasia y Amigos"

#

I see that I have availability to create a product in a connected account in the user interface.

#

How can I do the same with productcs API?

vagrant sinew
#

๐Ÿ‘‹ stepping in here as toby needs to step away

solid lodge
#

amazing!!

#

Thanks a lot!

vagrant sinew
#

Sure thing

solid lodge
#

other question

#

I need to add shipping price in my subscription with payment intent with stripe element

#

how can I add shipping price, add 2 subscription with differents price same recurring ?

vagrant sinew
#

Yeah you would handle shipping as its own line item

solid lodge
#

In addition to that, I have to add the tax value

#

tax value is calculate in real time

#

how can I add de price when subsctipions has been created ?

#

๐Ÿ˜ข

vagrant sinew
#

Not sure what you mean by all that, really. You can apply tax rates to a Subscription if you are calculating taxes yourself

solid lodge
#

I use stripe element

vagrant sinew
#

Yeah you do this all from the backend

solid lodge
#

but to retrieve payment intent, fist I have to create subscription

#

because tax rate is calcuate in user interface when subscriptions has been credated in default_incomplete status

vagrant sinew
solid lodge
#

ok, thanks

#

but I don't know how can I add the tax value ?

#

do need I create other price and add a new item line ?

vagrant sinew
#

You can either add a new line item or you can add the tax rate to an already-created line item

#

Up to you

solid lodge
#

do you have documentacion about this add the tax rate to an already-created line item ?

vagrant sinew
#

Also, is there a reason you aren't using Stripe Tax?

#

Seems like that would solve a lot of headache here

solid lodge
#

Yes, I use Stripe tax rate api

#

When I call to tax rate api, the api return tax value, so the idea is send the value to backend and add new item line , is correct ?

vagrant sinew
#

Create a Tax Rate object and add that object to the line item, yes.

solid lodge
#

I was using Calculation api to calculate tax value

vagrant sinew
#

You mean you use a third party API?

solid lodge
#

no no, Stripe Calculation

#

so, I should to call calculation api and after call Create a tax rate with this value and attach a Line item ?

vagrant sinew
#

Oh you are already using Stripe Tax, but you don't need to do that separately at all when creating a Subscription

#

We handle that all for you

#

All you need to do is set automatic_tax.enabled: true

solid lodge
#

here. ?

#

.setAutomaticTax( SubscriptionCreateParams.AutomaticTax.builder().setEnabled(true).build() )

#

but I would like yo show the tax value to my customer before to do checkout button (before create subscription, payment intent, etc)

vagrant sinew
solid lodge
#

No

#

My use case is: When customer selected a product y choice a price motnhly (example) and client enter his address, the user interface should show him the tax value before the client acept the final price

#

so the client agree then will do click en checkout button and then I should create subscription wiht product price, shipping price and tax value price preview

#

it's similary to checkout session, checkout session to show you the tax value before you subscribe to product, right?

#

The idea is similary

vagrant sinew
#

Yes the above endpoint is exactly how you do that

#

Did you read the description there?

#

It literally creates a preview so you can show the customer the amount that they will be charged once you actually create the Subscription

solid lodge
#

uhmm

#

So, how ca I create invoice upcoming before create subscription?

vagrant sinew
#

If you use subscription_items and don't pass subscription with that endpoint then it simulates as if a new Subscription was created

solid lodge
#

I don't understand

#

๐Ÿ˜ข

#

I need create 2 subscription ?

#

one to show and other to process real payment ?

#

it;s a bit durty this process

vagrant sinew
#

Using the upcoming Invoice API endpoint doesn't actually create a Subscription

#

It simulates as if one was created based on the details you input

#

Then it returns you a response with data as if an Invoice was created even though it wasn't actually created

#

That allows you to show a UI to your customer of what they will pay if they actually start a Subscription

#

Then, when they actually hit your "pay" button, you do actually create the Subscription

solid lodge
#

uhmm ah ok

#

but you shared me Retrieve an upcoming invoice

#

That seems to recover, not to create.

vagrant sinew
#

No, as I explained above, it will give you the response for a new Subscription if you don't input the subscription parameter when you use that endpoint

#

I'd recommend pausing and testing it out

#

That is really the best way to understand how this stuff works

solid lodge
#

I understand the idea but your explanation of HOW I don't understand it with this example

InvoiceUpcomingParams params = InvoiceUpcomingParams.builder().setCustomer("cus_NeZwdNtLEOXuvB").build(); Invoice invoice = Invoice.upcoming(params);

#

its imposible simulate all input calling this endpoint ...

#

it seems strange to me

vagrant sinew
#

its imposible simulate all input calling this endpoint ...
What does that mean?

#

What input does it not contain?

solid lodge
#

you said:
It simulates as if one was created based on the details you input

vagrant sinew
#

Yes. So you put your line_items in subscription_items for instance

solid lodge
#

my customer enter, debit card , address, product price, etc

vagrant sinew
#

Yep and there are parameters like customer_details for that

solid lodge
#

do you have example code to understand you ?

#

with this line:
InvoiceUpcomingParams params = InvoiceUpcomingParams.builder().setCustomer("cus_NeZwdNtLEOXuvB").build(); Invoice invoice = Invoice.upcoming(params);
I don't understand

vagrant sinew
#

No I don't think we have a full example code snippet of this. You as the developer need to be able to work with our API and try things out. The API reference can guide you on the necessary parameters and you can also look at our Java Class definitions via https://stripe.dev/stripe-java/allclasses-index.html if you need further specifics on those classes.

solid lodge
#

should I just completed to cuustomer detail ?

trim bloomBOT
vagrant sinew
#

You should input things like the address you are collecting from the Customer into customer_details, yes.

solid lodge
#

ok, with this I could recovery de final tax value to show the UI to my customer

vagrant sinew
#

Yep

solid lodge
#

Ok, Thanks so much!

vagrant sinew
#

Sure thing

solid lodge
#

I use the api

#

It was very useful

#

I have other questions

#

Y need add diferentes method payment to my customer

#

I have a payment method list in my UI

neon flume
#

Hi ๐Ÿ‘‹

I'm stepping in as my colleague had to go.

solid lodge
#

How do I create a payment method for my client and after recovery automatically configure it when creating the subscription?

neon flume
#

Okay so you have the UI that allows your customer to create a new payment method, correct?

solid lodge
#

Yes, to my shipping address also.

neon flume
#

Are you using Setup Intents?

solid lodge
#

Yes, first I create a subscription with default incomplete status and recovery secret to send to my UI and checkout the subscription with stripe element

neon flume
#

Sorry, does this subscription have a setup intent or a payment intent? Does it start with a free trial?

solid lodge
#

payment intent

#

Does it start with a free trial? --> No

#

it's to sell product no services

neon flume
#

Okay so you are using a payment intent and collect the payment method when your customer pays the first invoice, correct?

solid lodge
#

Im using this link

neon flume
#

Okay so in that case you have the Payment Method before you create the Subscription

#

That means you can either set it as the default payment method when creating the Subscription, or you can set is as the default on the Customer

solid lodge
#

Ok

#

but if my customer wants create other payment method in my UI (in other time), how can I create this ?

neon flume
solid lodge
#

this documentation is to ubscription mode ?

#

becasue my flow is all subscription model

neon flume
#

if my customer wants create other payment method in my UI (in other time)
To me, you were asking about customers creating new payment methods outside of the Subscription

solid lodge
#

in addition, I use stripe element to checkout flow

neon flume
#

You can do that just fine.

solid lodge
#

.setMode(SessionCreateParams.Mode.SETUP)

neon flume
#

You asked how to let customers save a new Payment Method, this is one way you can do that without charging them.

solid lodge
#

I used to use checkout session to create subscription flow

#

I'm confused

#

ohhh I saw

neon flume
#

Yup! Using this the customer can save the card to their record

#

If you want to make it the new default card you would listen to the setup_intent.succeeded webhook event. That would have the ID of the Customer and the Payment Method so you could make the latest payment method the new default

solid lodge
#

If the customer wants delete... ?

neon flume
#

You would need to implement something to do that, but it is possible

solid lodge
#

Ohhh thanks a lot!

#

I have other question

#

In my marketplace the customer can choice a diferentes product with diferente recurring price
For example

Product 1 $10 weekly
product 2 $20 Monthly

so, in my UI (resume screen) How can I do create multiple subscriptions for one element card to diferentes recurring ?

#

following example
I should create subscription 1 $ 10 weekly and subscription 2 $20 monthly

neon flume
#

You could not use the UI to automatically create multiple subscriptons. You would need to create the second subscription on your server, using the same Customer and Payment Method details from the first one

solid lodge
#

So the first subscription shoud create incomplete status, right? ...until the customer confirm payment

#

the second subscription I should create with other status? I should charge it directly

neon flume
#

You would wait until the first subscription is active, then create the second one. That way you know you have a valid payment method

solid lodge
#

subscription is active and invoice paid event arrive, right ?

neon flume
#

Sure you can use those

solid lodge
#

Ok, thanks a lote

#

have a nice day!

neon flume
#

Sure thing, you too! ๐Ÿ‘‹