#darverok

1 messages · Page 1 of 1 (latest)

crimson finchBOT
broken orbit
#

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

zinc grove
#

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:)

broken orbit
#

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

zinc grove
#

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

broken orbit
#

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?

zinc grove
#

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

broken orbit
#

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\

zinc grove
#

He does not know. I am going to try to get info from his dashboard and let you know what I find

zinc grove
#

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

broken orbit
#

So then they are creating Subscriptions in stripe

zinc grove
#

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

broken orbit
zinc grove
#

but do suscriptions create payment intents for each payment?

#

does that replicate the way the payment tab works in the dashboard?

broken orbit
#

Yes, subscriptioms create payment intents fro each payment

crimson finchBOT
broken orbit
#

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

zinc grove
#

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

broken orbit
#

The key difference will be that subscription payment intents will have invoice set and those Invoices will be tied to subscriptions

zinc grove
#

So 'single' payment intents that do not belong to a subscription dont have an invoice? Is it safe to asume that?

quasi stirrup
#

Hello! I'm taking over and catching up...

zinc grove
#

Hey! Dw take your time

quasi stirrup
#

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?

zinc grove
#

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

quasi stirrup
#

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.

zinc grove
#

But some payments(I have noticed especially one time ones) do not have an invoice attached

quasi stirrup
#

That's fine, for those you'll see the invoice property is null.

#

Those are payments that don't have an associated Invoice.

#

Let me know if that helps or not. 🙂

zinc grove
#

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

quasi stirrup
#

Correct.

zinc grove
#

And each payment of a subscription will create a separate payment intent

quasi stirrup
#

Yep.

zinc grove
#

So checking for a possible invoice->subscription in a oayment intent I can determine if the paymentintent is from a subscription

#

Right?

quasi stirrup
#

Correct.

zinc grove
#

Alright, so it looks clear to me:)

#

Thanks to both of you for taking the time to help!