#codingwisely
1 messages Β· Page 1 of 1 (latest)
Hello @exotic beacon ! How are you this wonderful evening? π
i need help to understand
So far so good! Thanks for asking.
Can you link to the methods you're using in the documentation?
$charge = $user->charge($plan['amount'], $paymentMethod);```
In other words, have you read what they actually do yet?
Or are you having trouble finding them?
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
When you run your code in test mode, what happens?
so it does not shows in user->invoices()
when i run code in test, i get to records in Customet page oon Stripe
You get 2 Invoices for the Customer you mean?
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
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?
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
I'm not recognizing a lot of these objects and variables. Where did you get this code? Can you provide more context?
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?
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
You just include receipt_email as a parameter when you create the Charge: https://stripe.com/docs/api/charges/create?lang=php#create_charge-receipt_email
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
I would recommend building out a simple Subscription integration to get an understaind of the product, as a lot of your questions are easily answered and addressed in our docs: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=checkout
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
Yep. Are the payments not showing there?
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
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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?
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
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 π¦
Have you tried listing payment intents with the customer parameter?
thank you sir
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
And how do that compare to the list results using the List api?
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.
you are right, screen i show you is what i get listed with paymentintent customer list
Great! So that's getting you the right set of data now π
Now, what's this about the receipt?
one second kind sir
this my UI on my app. I wish user click on button and download receipt for payment he made
The receipt_url can be found on the Charge object: https://stripe.com/docs/api/charges/object#charge_object-receipt_url
If you're working with Payment Intents, you need to expand the latest_charge and look there. With the list endpoint, you'd need to expand data.latest_charge to get this for each result.
https://stripe.com/docs/api/expanding_objects
https://stripe.com/docs/expand
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
YOu have a great day too, glad that helped!
I work with our API a lot π