#darverok
1 messages · Page 1 of 1 (latest)
Hello! If you're creating a Stripe Customer tied to the customer's email address and use that Customer object to create subscrpitions/payment intents then you should be able to retrieve all their payments and display them
whats the recommended method to do it? charges?
I cannot rely on customerIds, but emails. So basically I want to list payments, and then select myself the ones that have emails I am interested in.
What is the difference between listing charges, payment intents and invoices? Thanks for your time:)
Why can't you use customers?
If you're creating Subscriptions in Stripe then using Customers is requried, so I assumed you were already using them
The app is independent from stripe, the payments are handled by the client separately
It's only function should be retrieving payments made and checking wether that payment's customer email is from a certain list
When you say the payments are handled by the client separately - does that mean payments aren't being made in Stripe at all? Do you know what APIs they're using for payments?
He handles them himself, through stripe. Payments are not handled by my app
Just asked him. On his website, he has a link with different options, for example, to purchase Course 1 or Course 2. He also has, separately, in a similar way, a link to a monthly subscription
That doesn't really tell me much about what specific APIs they're using
Are they using Checkout/Payment Links? Do they create Payment Intents or Invoices?
Generally, you could accomplish what you want by adding metadata on the relevant objects and then filtering based on that, but it's hard to give you any more specific recommendations when it's not clear what they're using\
He does not know. I am going to try to get info from his dashboard and let you know what I find
So after going to his dashboard he has some products created. Some with a fixed one time price and one with a recurring fee @broken orbit
Then he uses a payment link so users can pay on his website
So then they are creating Subscriptions in stripe
yeah, but only for that item. The rest are one time purchases
What I'd want to retrieve is something similar to the payments tab in stripe dashboard
which shows a list of payments, the user email, and amount
You can use the Search API to find any payment intents using a specific email (https://stripe.com/docs/api/payment_intents/search)
Alternatively, you could try listing all Checkout Sessions using a specific Customer email (https://stripe.com/docs/api/checkout/sessions/list#list_checkout_sessions-customer_details-email) since Payment Links creation Checkout Sessions under the hood
but do suscriptions create payment intents for each payment?
does that replicate the way the payment tab works in the dashboard?
Yes, subscriptioms create payment intents fro each payment
hmmm... looks like the search API for payment intents doesn't support email
If I were you, I'd take a step back and look at a specific payment intent example from a one-time payment and one from a recurring payment and see what's set on each
I have been tinkering and paymentIntents seems to be fine
What I need to know is if different payments from a monthly subscription will generate different payment intents
The key difference will be that subscription payment intents will have invoice set and those Invoices will be tied to subscriptions
So 'single' payment intents that do not belong to a subscription dont have an invoice? Is it safe to asume that?
Hello! I'm taking over and catching up...
Hey! Dw take your time
Going back to this in your original message:
One of the requirements for the app is to display payments made to him, as well as the customer's email and wether the payment is from a suscription or not.
Would this be a list of every payment? Like a recent/all payments list? Or would it be specific to a particular customer or something like that?
I thought of listing every payment
In a similar way the payments tab in the dashboard works
Then I'd run my own code to determine the data I want
Ah, okay, so here's what I would recommend...
You can list Payment Intents: https://stripe.com/docs/api/payment_intents/list
When listing you should use auto-pagination: https://stripe.com/docs/api/pagination/auto
You can also use expansion when listing in order to get more information in the response. On Payment Intents, for your use case, I recommend expanding the invoice property on Payment Intents: https://stripe.com/docs/api/payment_intents/object#payment_intent_object-invoice
That will give you the full Invoice object in the response instead of just the ID.
You can also, if you want, expand the subscription on those Invoices by expanding invoice.subscription: https://stripe.com/docs/api/invoices/object#invoice_object-subscription
More information about expansion: https://stripe.com/docs/api/expanding_objects
That approach should give you all of the information you need.
But some payments(I have noticed especially one time ones) do not have an invoice attached
That's fine, for those you'll see the invoice property is null.
Those are payments that don't have an associated Invoice.
I think this short video will help clarify things: https://stripe.com/docs/payments/tour#payment-objects
Let me know if that helps or not. 🙂
Gonna take a look and will get back when I do, thanks😀
@quasi stirrup so I took a look and according to what I understood, each payment will have a payment intent
Correct.
And each payment of a subscription will create a separate payment intent
Yep.
So checking for a possible invoice->subscription in a oayment intent I can determine if the paymentintent is from a subscription
Right?
Correct.