#arnis_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1445397832533278782
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
๐ Hi there! Let me take a look
Basically i need an invoice.paid event to be sent when paying with wallets like google pay and apple pay. Right now it seems impossible to process one time payment with creating invoices. It works only with creating payment intent. But in my case i need an invoice
I have attempted to set default payment method types to null
It looks like you're explicitly setting the payment method types when creating the invoice here: https://dashboard.stripe.com/acct_1NkVdERvd0kOjiXV/test/logs/req_Nrk5TmjZGF1t3d
I tried not setting it, but still the same issue. It seems like when i create the invoice, then when finalizing it, the payement intent payment method will be set by default. Why it isnt considered even in this case automatic. Cause im not doing explicitely
But yeah, in this case i did for testing purposes, but in other cases by defauult it takes card and paypal. In the log i send you, i actually did set it to test it
Cause im out of options right now
For paypal its fine cause even though im creating a payment intent by adding PaymentMethodTypes = new List<string> { "paypal" }, the invoice is being created. But when using AutomaticPaymentMethods = new PaymentIntentAutomaticPaymentMethodsOptions
{
Enabled = true
}, // invoice is not being created
๐ Hey, taking over here, just taking a look
Just checking my understanding of the issue. You're creating an invoice for a one-time payment - If it is paid with a Google Pay, it is not triggering an invoice.paid event?
Yeah, but first when trying to confirm the payment intent client secret created by this invoice, the reponse is Payment details were collected through Stripe Elements using automatic payment methods and cannot be confirmed through the API configured with payment_method_types.
Basically even when not setting payment_method_types in invoice creation, its still respoding like this
Do you have an example where payment_method_types wasn't set?
I will try to recreated it, then send the request
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
@young plover
var createInvoice = new InvoiceCreateOptions
{
Customer = customer.Id,
AutoAdvance = true,
CollectionMethod = "charge_automatically",
Metadata = createStripePaymentRequest.Metadata,
Expand = new List<string>
{
"payment_intent"
},
Currency = price?.Currency
};
can you share the code you use to init Elements and the ECE?
it looks like you're initialising without the client secret (e.g. deferred mode), yet you obviously have the intent's client secret from the invoice. you should use that, and it'll resolve the error
e.g.
clientSecret: 'pi_abc_secret_xyz'
})
stripe
.confirmSetup({
elements: this.expressCheckoutElements,
clientSecret,
confirmParams: {
return_url: returnUrl
}
})
is this React? what does the <Elements /> component look like?
const expressCheckoutOptions = {
buttonHeight: 50,
buttonTheme: { applePay: 'white-outline' },
applePay: {
recurringPaymentRequest: {
paymentDescription: planDescription || '',
regularBilling: {
amount,
label: planName || 'Subscription',
recurringPaymentStartDate: new Date(),
recurringPaymentIntervalUnit: this.mapDurationIdToIntervalUnit(durationId),
recurringPaymentIntervalCount: durationValue
},
billingAgreement: 'billing agreement',
managementURL: 'https://stripe.com'
}
},
googlePay: {
paymentRequest: {
total: {
label: planName || 'Subscription',
amount: (amount / 100).toFixed(2),
currency: currency.toUpperCase()
}
}
}
};
console.log(' this.isOneTimePayment', this.isOneTimePayment);
this.expressCheckoutElements = stripe.elements({
mode: this.isOneTimePayment ? 'payment' : 'subscription',
amount: amount || 0,
currency,
appearance
}); // this is basically how i set the options of checkout before creating it
no, the <Elements /> provider component, not <ExpressCheckoutElement />
I suspect this is the issue
So u are saying we need to have client secret even when creating the element
Im not having issue for the subscription flow
I mean I'm still waiting for you to share the details I asked for
Ok I will send it