#codingwisely

1 messages Β· Page 1 of 1 (latest)

rich bronzeBOT
slim tartan
#

Hello @exotic beacon ! How are you this wonderful evening? πŸ™‚

#

i need help to understand

exotic beacon
#

So far so good! Thanks for asking.

Can you link to the methods you're using in the documentation?

slim tartan
#
                $charge = $user->charge($plan['amount'], $paymentMethod);```
exotic beacon
#

In other words, have you read what they actually do yet?

#

Or are you having trouble finding them?

slim tartan
#

let me re read

#

i cant find it now

#

i read that subscription automatically creates invoices

#

so i have 3 plans, 2 of them are subscription plans, and one is one time charge (Life membership)
user can start with trial on subscription and perhaps pay a monthly subscription and then suddenly decide to moce to one time paymentm and to pay one time off so no subcritions.
What i am trying to achieve is to list all his payment history.
To do that, i simply go thru $user->invoices() and i sort it in pretty table

#

Now, i discovered, that when i create one time payment(life time membership) there is no invoice for ir

exotic beacon
#

When you run your code in test mode, what happens?

slim tartan
#

so it does not shows in user->invoices()

#

when i run code in test, i get to records in Customet page oon Stripe

exotic beacon
#

You get 2 Invoices for the Customer you mean?

slim tartan
#

no

#

like this

#

Payments:
first record is $349 = description: Payment for Invoice
second record $349 = description: Lifetime Membership

#

so i dont know if InvoicePrice method actually charge user

exotic beacon
#

I still don't fully understand. If you're seeing these things in the Stripe Dashboard it should be pretty obvious if a payment was made, no?

slim tartan
#

ok, let me try again πŸ™‚

#

Can you help me to find invoicePrice Api method to understand what it does? I cant find it in stripe api

#

I wish to know how to i create an Invoice for single charge

exotic beacon
#

I'm not recognizing a lot of these objects and variables. Where did you get this code? Can you provide more context?

slim tartan
#

i am using laravle cashier. let me see what they use under the hood

#

ok regardless, i will use PHP stripe lib

#

please advise how can i get invoice for a charge, one time payment?

#

when using $stripe->charges->create() how i can issue an invoice?

exotic beacon
#

That will l create a charge and is generally considered a legacy approach. If you want to issue an INvoice, here are the docs on that: https://stripe.com/docs/invoicing

Create and manage invoices for one-time payments with Stripe Invoicing.

slim tartan
#

thank you

#

and if i do charge() - how do i get receipt?

exotic beacon
slim tartan
#

Last question sir : how do i collect all the payments made by Customer? Including boths subscrition payments and one time charges? All payments customer did?

#

So my customer paid 2 subscriptions on my website and purchases lifetimememberhsip too.
I wish to list all payments he did on my website

exotic beacon
slim tartan
#

Can you then help me out and point me to part in docs where i can find all the payments MaΔ‘e by customr, regardles if its a one time payment or subscrition payment?

#

I AM afraid i am not explaining proper what i need?

#

When open a customer page in my stripe account I have a section with all the payments

exotic beacon
#

Yep. Are the payments not showing there?

slim tartan
#

They do

#

How I get all the payments via api?

#

So I want to get the same data as they are in customer page in stripe, via api, so I can parse them on my side

#

I really am not sure how better to explain a challenge. In stripe portal, on customer page I have a section All Payments, right above section with All Cards and I want to fetch this section via API

exotic beacon
#

I would recommend familiarizing yourself with our API reference. These are very simple easy to answer questions if you do the reading: https://stripe.com/docs/api

slim tartan
#

This is not helpful. I am familiar with api docs. But can’t find anything related to@my question.

#

There is nothing related all payments

#

Can you please bring In chat someone else who is willing really to help?

exotic beacon
#

It's definitely there under either Payment Intents or Charges. Unfortunately my team doesn't always have the bandwidth to answer these types of questions.

I would recommend using ctrl+f to find what you're looking for

rich bronzeBOT
slim tartan
#

yes i tried all and cant find it

#

same kind of help getting on paddle. useless poiting to docs, without really trying to hear the problem. Sad.

#

exact help i can provide- go look at stripe api.

#

huh

#

you just guessing its there, well, i really cant find it 😦

rotund elm
#

Have you tried listing payment intents with the customer parameter?

slim tartan
#

thank you sir

slim tartan
#

i seen this one

#

but in response i see that always is amount_recieved 0

#

please give me 3 minutes to show you what i need

#

ok i am here

#

So what i am looking for is to get this data via API

#

Thank you for your patience

#

i had to reproduce payments there so i can show you what i am looking for

#

in my mind this shall be something fairly simple as $customer->payments->all(['limit'=>10]);

#

alas i cant find the way

#

@rotund elm ^^

#

i hope that explains what i am hoping for

#

In the paymentIntent is no link to receipt which i need

rotund elm
slim tartan
#

List Api?

#

you mean List all Paymeng intentions?

#

hm maybe i can get receipt via payment method id?

#

sorry, paymentIntent id?

#

i dont see the way to get receipt

#

yeah actually i need a receipt for user to download after he pay either subscription or one time payment.

slim tartan
rotund elm
#

Now, what's this about the receipt?

slim tartan
#

one second kind sir

#

this my UI on my app. I wish user click on button and download receipt for payment he made

rotund elm
slim tartan
#

i will read this, but look very promissing

#

thank you so much

#

you are a way friendlier and supportive then guy before you

#

thank you sir

#

much much appreciated

#

wish you all the best

#

i am going to read this now, thank you so much

#

woud this be correct> i am not getting latest_charge: ``` $pi = $stripe->paymentIntents->all(['limit' => 3, ['customer' => $user->stripe_id,
'expand' => ['data.latest_charge']]]);

#

sorry i am blind

#

you saved my day sir

#

❀️

#

how did you know that!? πŸ˜„

#

thank you thank you

#

wish you wonderful day/night

rotund elm
#

YOu have a great day too, glad that helped!

rotund elm
slim tartan
#

you have no idea man

#

thank you

#

i just dont know how to thanka you enough lol

#

see ya next time mate πŸ™‚