#awxsam_api

1 messages Β· Page 1 of 1 (latest)

distant needleBOT
#

πŸ‘‹ 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/1428210191329132695

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

barren spade
near basalt
#

Hi
I'm creating / returning a customer_id
Then creating the paymentintent and returning the client_secret to the frontend
Then calling this stripe function

await stripe.confirmCardPayment(client_secret, {
        payment_method: {
          card: cardElement,
          billing_details: {
            name: cardholderName,
            email: user?.email || '',
            address: {
              line1: billingDetails.billingAddressLine1,
              line2: billingDetails.billingAddressLine2 || undefined,
              city: billingDetails.billingCity,
              state: billingDetails.billingState,
              postal_code: billingDetails.billingPostalCode,
              country: billingDetails.billingCountry,
            },
          },
        },
      })```

But yes I would like to know how to link the PaymentIntent to an Invoice
#

I know recurring payments have invoices by default right, but I couldn't find any solution for one_off payments

barren spade
#

how are you generating the client_secret - are you creating a PaymentIntent or are you creating a Checkout Session?

near basalt
#

I'm creating a PaymentIntent

barren spade
#

hmmm, gimme a few minutes to test something out

near basalt
#

No problem, thank you

#

The closest I got was using setupIntent and then paying the invoice automatically in the backend when the payment happens, but this wouldn't work for 3DS challenges, as it would need to open the hosted invoice url in another tab for example

barren spade
near basalt
#

I think this will work yes, let me try it out and get back to you

#

Thank you so much

#

Hmm

params := &stripeSDK.InvoiceFinalizeInvoiceParams{}
params.AddExpand("confirmation_secret")
res, err := invoice.FinalizeInvoice(inv.ID, params)
if err != nil {
    c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
    return
}
fmt.Println(res.ConfirmationSecret)```

Any idea why `res.ConfirmationSecret` would be `nil` (the expand not registering?)
barren spade
near basalt
#

req_gb9ZPZfDPYMtg5

#

Was just checking for it haha

barren spade
#

I'm going to share a link with you to write in so that I can get back to you after I look further into why the ConfirmationSecret is not being returned

distant needleBOT
#

Hello @near basalt, we have sent you a direct message, please check it at https://discord.com/channels/@me/1428220089441714329

  • πŸ”—The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
near basalt
#

Alright

#

I'll try that one out

#

Thanks for your help thus far

barren spade
#

let me know if you're still running into issues or have any other questions

near basalt
#

Will do

barren spade
#

got the support ticket!

near basalt
#
Thank you. Our team will respond to you as soon as possible.
The chat has ended. For further assistance, please close the window and start a new chat.```

I'm confused, do I open a new chat or just leave it as it is and I'll get an email or something?
barren spade
#

hmmm, I think you would have gotten an email informing you that a ticket is created?

#

Otherwise, no worries, I can just respond to that support ticket right now and you should see an email

near basalt
#

Oh right must be this, sorry my mistake

barren spade
#

yay! okay, good that you found the email πŸ™‚

near basalt
#

I found the issue, it was my mistake, somehow forgot to add the invoice ID on the new invoice item, making the actual invoice total 0.00 and it not giving a confirmation_secret. Can close this ticket and mark as resolved.
Thank you once again

barren spade
#

aaah, alright! πŸ₯³