#amfpaulo_api

1 messages ยท Page 1 of 1 (latest)

burnt prismBOT
uneven windBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

burnt prismBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1268930071012446384

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

sullen beacon
#

What's the invoice id where you see this

true pollen
#

This is my invoice code

#

My code failed so I did not get the invoice Id, but I can , I'll do right now, just a second

#

I just got another error now: Must provide customer or from_invoice.

#

I am creaing a FromInvoice empty

#

What is the way I should create a invoice that has no customer

#

I altered the code like that:
if (!string.IsNullOrEmpty(request.CustomerId) && !request.CustomerId.Equals("walk-in"))
options.Customer = request.CustomerId;
else
options.FromInvoice = new InvoiceFromInvoiceOptions
{

            };
#

What should I fill on the InvoiceFromInvoiceOptions object ?

#

Ya, this is not making sense, I do not want to clone a invoice, I just want to sell to with out having a Customer on the invoice ?

#

Am I going to need to create a generic customer in order to create a invoice for walk in sales ?

sullen beacon
#

Do you have the invoice id?

#

you said:
when the invoice has no client from my understanding I need to return the Invoice Intent to the front end to collect the payment however invoice.PaymentIntent.Id and invoice.PaymentIntent.ClientSecret are null
So I just want to look at that

#

Customer id isn't required to create an invoice afaik

true pollen
#

yes, informing a customer, this is my invoice id: in_1PjMAYDn6CAQGXZnFPtv0YY9

#

but this one I informed a customer

#

If I do not inform a customer I get the error: Must provide customer or from_invoice.

sullen beacon
#

Ah ok yeah I'm wrong

sullen beacon
true pollen
#

Cool, no problem , I have this down, now, knowing that I need to return the Intent secret to the front end to collect payment

#

however the invoic intent is null

#

are these the correct filed to retrieve a intent from a invoice ?

sullen beacon
#

Which invoice?

#

The one you shared above?

true pollen
#

yes

#

in this specific case, to help you debug

#

I am talking about API code here

sullen beacon
#

So you need to expand it to get id and client secret

true pollen
#

What do you mean about that

sullen beacon
#

In the doc

true pollen
#

I already read this doc, I could not figure it out

#

please could you help

sullen beacon
#

What didn't you understand?

true pollen
#

how to expand Intent

sullen beacon
#

You really read that doc?

#

it outlines exactly how to do it...

true pollen
#

the link you sent to me did no help at all

#

sorry, may be Iam missing something here

sullen beacon
#

You need to pass the expand param with payment_intent in the array

true pollen
#

ok, I waslooking wrong link

sullen beacon
#

Certain params don't come expanded in our api

#

payemnt_intent on the invoice is one of them

true pollen
#

Still not making sense to me

sullen beacon
#

That's why it has "expandable" next to it in the api ref

#

So you need to expand it when retrieving or creating the invoice if you want to access payment intent id

true pollen
#

How ?

#

I am not understanding

sullen beacon
#

Did you really read this doc...

true pollen
#

could you give me a example ?

#

please

sullen beacon
#

What don't you understand from that doc?

#

It has the examples

true pollen
#

Could you help me or not ? I already read the docs,

#

example

#

a example solf my problem and your problem

#

I got similar situation to expand another parameter to set defaul payument method to a client

#

the way of doing was not straight forward , even the suport person took a while to help me

#

I am stuck in the same situation again , but different

burnt prismBOT
sullen beacon
#

Expand = new List<string> { "payment_intent" }, goes in your invoice create options

#

Expansion works the same for all our endpoints

#

So if you've done it before, it's the same process

true pollen
#

that is what I am telling you, I did , I added this line to my invoice create options and the objct in my last screenshot still null

#

because for sure there are a deep opject somewhere

ruby rapids
#

Hi there ๐Ÿ‘‹ jumping in as my teammate needs to step away soon. Please bear with me a moment while I catch up on the context here.

true pollen
#

this is what I did

ruby rapids
#

I'm still catching up, but based on the last couple messages that is expected. The Payment Intent for an Invoice is not created at Invoice creation, it's created when you finalize the Invoice. So it's expected that payment_intent is null after Invoice creation and you won't be able to expand the field.

true pollen
#

I am finilizing the invoice

#

Look my first screenshot

ruby rapids
#

I just was

#

The problem is that you aren't using expand in your finalization request, when the Payment Intent is created. I think.

true pollen
#

Ok, lets start over

#

the previous guy guide me to the wrong direction for sure

#

he told me to expand the Intent during my invoice creation, which is wrong, correct ?

ruby rapids
true pollen
#

I am not using stripe elements, but I think I got it what I need to do

#

Just tell me if I am correct more over I'll test pretty quick

#

Intead expanding during invoice creation like the other guy tood me to do

#

should I expand using invoice finalize option correct ?

ruby rapids
#

Yup, but why do you need the client secret of the intent if you aren't using Elements?

#

I may be forgetting about a flow, but offhand that doesn't sound right.

true pollen
#

I am using stripe terminal M2

#

I need to collect the payment on my front end using the terminal

#

By the way, this works, when I finilized the invoice, which returns to me another instance of the same invoice that was created before, this instance has the Payment Intent

ruby rapids
#

Aahh, terminal! I was forgetting about a flow ๐Ÿ˜…

true pollen
#

terminal has litle to no docs, however the API is so good that I got sctuck just 3 times so far

#

One more question just to make sure what the other support person told is correct: Invoice has to have a client, no way to create a invoice with out client correct ?

#

If I want to create invoice for a walk-in* sale I need a generic customer to attach to the invoice, is this correct?

*not a recurrent customer and customer do not want have anything on file

ruby rapids
#

Not sure I'm grasping what you're asking, what is "client" referring to in this context?

#

Ah, client = customer, yup

true pollen
#

Sorry

ruby rapids
#

You have to have a Customer created for the Invoice

true pollen
#

Customer

ruby rapids
#

No worries, just wanted to make sure we were aligned before I answered wrong ๐Ÿ˜„

true pollen
#

Ok, Is having a generic customer a viable or may be only option if I want to have a invoice ?

ruby rapids
#

That's largely a business decision that is up to you. Technically I'm not thinking of any problems that would cause offhand, but I'm not sure if it would be confusing for your operational flows to have all of those grouped under one customer record or not.

true pollen
#

Got it. My system will anyways control invoices , etc, however my idea of always having invoice is to facilitate find problem or frauds if they arrised, so I can easily match my system invoice with stripe invoice and find out if it was a walkin sale or a customer sale, also I can keep track of discounts, etc

#

Anyways, I think I can take from here, I'll now try collect the payment, I believe this will not fails, if does, I'll contact you guys again. I appreciate your help and to other guy help. You guys are awesome, I never ever have a gatway integration work that was so easy and have good support, even Terminal not having great docs