#arielbo-subs

1 messages · Page 1 of 1 (latest)

proven widget
scenic pewter
#

hi karbi

proven widget
#

Can you clarify? Are you just trying to find out the date/time a subscription has been created?

scenic pewter
#

really the renew time

proven widget
scenic pewter
#

yes I know about convert this, but please in which parameter or place I see the timestamp of one subscription created

#

sub_1JkGDkHHulAmiNnDp8sp9jp7 this is my id subs

#

maybe you can help me please

proven widget
#

You said you wanted subscription renewal right?

scenic pewter
#

yes

proven widget
#

You can find when the subscirption will next renew at current_period_end

scenic pewter
#

what happens is that I want to test the invoice.payment_succeeded event when the second payment occurs

proven widget
#

Is this a new question, or is this still related to finding out the renewal time of the subscription?

scenic pewter
#

related

#

this is the reason by which I need to know the datetime exactly of the 2nd payment

#

how can I see this parameter current_period_end ?

#

I see this event "id": "evt_1JkGEdHHulAmiNnDDu2OEuCp",
"object": "event", and not have current_period_end

proven widget
#

That's because that's an Invoice event - current_period_end is only on the Subscription

scenic pewter
#

them I will need to recovery subscription right?

#

$stripe->subscriptions->retrieve(
'sub_1JkGDkHHulAmiNnDp8sp9jp7',
[] ?

#

with some like this and I see this parameter current_period_end ? right?

proven widget
#

Yes, you would have to retrieve the Subscription if you want to know it's next renewal date

scenic pewter
#

please let me see a few minutes

#

or exist some place in your dashboard to see this data?

proven widget
#

Yes, this information is also in the dashboard on the subscription but if this is something you need from your webhook handler you really should just be retrieving it through the API and checking from there

scenic pewter
#

please in which place of dasborad I can see current_period_end please

proven widget
#

You just view the subscription in the dashboard and it would show you the dates/times for the current period

#

Really I would suggest you take a step back and take some time to look through the API reference for Subscriptions and Invoices and also explore the dashboard

scenic pewter
#

maybe is this?

proven widget
#

No, it's at the top of the page right next to Current period

scenic pewter
#

could you send me a screanshott and link please?

proven widget
#

All you have to do is view the Subscription on the Dashboard - the screenshot you're looking at is from the "Upcoming Invoice" view

scenic pewter
#

ok

#

good I see please

#

maybe you can help with another ask ?

proven widget
#

What is the question?

scenic pewter
#

I need to know how can I program in php stripe api set default payment

#

this option

proven widget
#

You set the default by updating the Customer and setting invoice_settings.default_payment_method to the Payment Method you want

scenic pewter
#

thanks

#

I have subscriptions and single payment services, now I am implementing a cart, and I have the scenario of a client who could buy 1 subscriptions and 3 single payment courses, so I wonder if it would be correct and it is possible to charge the total to pay for the 3 services with payment intent?
and then using metadata with information from these three services, using the payment_intent.succeeded webook to create the subscription and enable the services?

proven widget
scenic pewter
#

That is to say, would you advise me to manage the cart with subscriptions for both single payment items and items with recurring payments?

proven widget
#

It really is up to you - there are numerous ways of implementing the same thing in billing and I've already given a recommendation (add the one-off courses to the subscription). If you want to go down a different route that's also fine (you know your business requirements best)

scenic pewter
#

I understand but I more confused, maybe you can give one guide more clear please, maybe if you can tell me the methods more frecuent to do a cart

#

thank you in advance

cosmic heath
#

What aspect of that are you confused about?

#

Like karbi said, adding invoice items will accomplish what you want. Do you have a specific question or concern as to how that would work with your integration?

scenic pewter
#

yes please, can I use only payment intent to do a cart ? even to do subscriptions? o always I will need to use subscription object?

cosmic heath
#

A PaymentIntent makes sense for a cart of one-off items

#

For a cart including a subscription, adding the one-off items to the subscription's invoice would likely be simpler

scenic pewter
#

yo understand me pompey

#

thank you, but with so many objects, events, parameters, etc. and on top of documents one really gets confused and sometimes a simple answer like the one you give me gives me more security to venture to program something in one sense or another

sinful kindle
#

@scenic pewter that's totally fair but there are hundreds of questions a week in this channel. While we are doing our best to help everyone, it is important that you take the time to design your own application/architecture, think through potential limitations, test things with our API yourself and debug as a developer. Asking us questions is totally fine, we're here to help, but the clearer/concise the question is, the easier it is for everyone

scenic pewter
#

I think I really would like to make the cart with the subscriptions object using this that you tell me about one-off items, please tell me how difficult this will be and if you can guide me in the attempt, I can do it now. (I already create subscriptions with one item but I don't know with many items, I don't know if it is more difficult, for example, I would need each item to have metadata)

sinful kindle
#

We don't really understand what you are asking unfortunately. Your questions are often vague and mixing Stripe's API/vocabulary and your own so it's really hard to grasp right now. Subscriptions support having more than one price, subscriptions also support being created with one off extra items on the first invoice (see add_invoice_items). But your ask is unclear

#

Try to always clarify what you mean, it might take a few minutes for you to try and summarize but it also helps you organize your thoughts and maybe give a clear example at the same time. Something like "I sell a monthly box of chocolate you can order for $15.99 but you can also order extra chocolate on the first order and I want to show how to order 2 extra chocolate on top of the monthly box" or whatever you're building. But you do have to do that leg work on your end

scenic pewter
#

Thanks for the advice, I'm going to really take into account a lot of what I learned so far, it was for your help.

sinful kindle
#

Thanks a lot for listening to the feedback! Now with that in mind, did my example above match what you were trying to do?
You should see the Subscription as the "attempt to pay" so it isn't really a "cart" that you modify over time as the user shops. That logic is something you build yourself in your system and when the customer is ready to pay you create their Subscription so that we create their first invoice and charge them (or they pay client-side).

simple fernBOT
#

This thread has been archived. If you need help with anything else please ask in #dev-help or contact Stripe Support: https://support.stripe.com/contact

scenic pewter
#

well

#

hello, are you still here?

reef falcon
#

Hello!

scenic pewter
#

hello

#

Rubeus

reef falcon
#

Hi! What's your question?

scenic pewter
#

I have about 40,000 products, most of them one-time payment and others are monthly or annual subscriptions, and I don't want to create these products in stripe. For this reason I don't want to use subscription object or stripe checkout but rather payment intent api.

Now I would like to know if I can use payment intent object api to sell these two types of products in a cart, do you understand me?

#

or maybe need more context, please feel free to ask me more details to help me more

reef falcon
#

Does that solve the issue of not wanting to create the Products and Prices up-front in Stripe?

scenic pewter
#

I imagine creating the cart with the products selected by the customer with a single payment intent that contains the total amount paid for all the services, both single payment and subscriptions, but I wonder if with paymentintent I could charge recurringly.

reef falcon
#

Payment Intents alone do not support recurring payments. You can use them for recurring payments based on a recurring payment system you build on your end, but that is not recommended.

scenic pewter
#

I can think of an alternative, pay attention please, could I create a subscription from a successful payment.intent?

reef falcon
#

Several reasons: recurring payments need to be properly identified as such when processing to avoid declines, which our Subscription system handles for you. Our Subscriptions system also has a huge amount of work put into it to handle things like prorations, cancelation, reliable recurring payments, Invoices, and a lot more.

#

could I create a subscription from a successful payment.intent

No, that's not how Payment Intents or Subscriptions work.

#

Subscriptions generate Invoices, and Invoices generate Payment Intents. Payment Intents are a low-level object designed to capture a single payment. You can use them directly to capture a single payment, but that's all they do.

reef falcon
#

To put it another way, you can think of these objects like this:

Subscriptions handle the mechanics/scheduling of recurring payments
Invoices handle several line items, record keeping, and other details for a specific payment (like a monthly payment for a Subscription)
Payment Intents handle collecting a single amount of money from a method of payment

#

Payment Intents alone have no concept of multiple line items, taxes, recurring billing, etc. All they do is collect one specific amount (the total) from a method of payment.

#

If you want to use your own recurring billing system instead of Stripe Subscriptions you can, but it's going to be a lot harder, take a lot more time, and you'll probably run into several unforeseen problems along the way.

scenic pewter
reef falcon
#

On the other hand, if you use Stripe Subscriptions, we take care of a ton of things for you so you can focus more on your own business rather than building a recurring billing system.

#

assuming that I already have the payment through payment intent, can I create a subscription and its invoice that have the first month paid?

That's not how Stripe works. You can create a Customer object in Stripe, attach a Payment Method to that Customer, and then you can reuse that Customer/Payment Method combination for future payments. Those future payments can be one-off Payment Intents or Subscription payments.

#

Does that make sense?

scenic pewter
#

At this moment I use and have develop stripe subscriptions without a cart for recurrente services and in separate payment.intent api to one time services, and I know is subscription is better have many advantages, my problem is when I try develop a cart with a mix of products and in with stage enable subscriptions

reef falcon
#

What specific problems are you having?

scenic pewter
#

In your experience, the creation of the Customer / Payment Method for future payments combination and of course the creation of the subscription, could I do it when I listen to an event in the webhook?

scenic pewter
# reef falcon What specific problems are you having?

At this moment I have a cart for example with this products:

  1. service A. ebook 1 0 USD one time payment
  2. service B. course 20 USD one time payment
  3. service C. subscripcion a month to software x 50 USD recurring payment

Total price: 80 USD


Button PAY: 80 USD

#

got this far, now I have these ideas in mind:

#

give a few secs to write good please

reef falcon
#

So you would create a Subscription for the $50 recurring payment, then add the $10 and $20 as one-time payments that would show up on the first Invoice.

scenic pewter
#

ok now I have the ideas,

#

got this far, now I have these ideas in mind:

  1. create a payment intent and collect the 80 USD, and in metadata save a json with the order data, that is, of each product sold, and then enable the services by listening to the payment.intent.success event but here I am concerned about how it could create subscription for service C.

  2. create a super subscription that has all these products but I don't want to create the 40,000+ products and their prices, nor do I want them to be saved in stripe, because they are dynamic and increase every time.

Do you understand how confused I am? and i got stuck so i want to move in the right direction to program

scenic pewter
reef falcon
#

Actually, you would need to create the Product ahead of time, but not the Price.

scenic pewter
#

In other words, who would have to create generic products without price: 1. ebooks and 2. courses? and then inline put the price?

reef falcon
#

So you would create Products ahead of time in Stripe for "Software A", "Ebook B", and "Course C". Then, when creating the Subscription, you can specify dynamic prices and reference the Product IDs. The Products only need to be created once and can be reused many times with dynamic Prices.

scenic pewter
#

this make sense for me

#

thanks for your patience Rubeus

scenic pewter
reef falcon
#

That's correct, yep.

#

⭐ arielbo-subs

scenic pewter
#

thank you rubeus you are the best, let me know how can I check this chat again? or maybe you can send me to my email

reef falcon
#

We can't send this chat to your email, but this thread will stay here. If it's archived you can still access it using the thread interface in Discord. You can also copy and paste the info you want to save or take screenshots.

scenic pewter
#

ok. why your are put a start in this thread?

reef falcon
#

I wanted to indicate to my teammates that this thread should remain open for a while in case you have followup questions.

sinful kindle
#

arielbo-subs

#

(removed, we're fine!)

scenic pewter
#

thank you, now I program this solution please remain open maybe I need some help to do this project

#

you have a lot of patience and you know how to listen and that is wise, just like your colleagues who guided me on how to present a problem and ask more structured questions

sinful kindle
#

We won't keep the thread overnight, but at least we'll try to keep threads ongoing throughout the day.
Let us know when you have resolved an issue too and in that case we can archive (we won't keep it for weeks)

#

You're welcome to ask more questions, I'm here for a while and I'll archive at the end of my day. There are way too many threads a day to keep them all open unfortunately, but we can try to not archive too quickly when you're still talking to us

scenic pewter
#

thank you in advance to all team

scenic pewter
# reef falcon That's correct, yep.

like this:
$subscription = $stripe->subscriptions->create([
'customer' => 'cus_123',
'items' => [[
'price_data' => [
'unit_amount' => 5000,
'currency' => 'usd',
'product' => 'prod_456',
'recurring' => [
'interval' => 'month',
],
],
]],
]);

is correct ?

sinful kindle
#

@scenic pewter have you tried? Like did you run that code, check the subscription in the Dashboard, confirmed it's what you want, etc.?

scenic pewter
#

not yet

sinful kindle
#

Please, try your code first before asking us! We can help you debug if you're stuck but you can't share every line of code for our review, it's just faster to run the code
But really you should be creating your product/prices upfront in the Dashboard and use those prices instead of price_data