#Sudarshanan G
1 messages ยท Page 1 of 1 (latest)
I'm trying to create a payment intent with some amount. And I need to add tax for that intent.
but couldn't able to add one
also tried to create a invoice and capture the payment intent. But payment intent is always null.
Do you want to add a custom tax amount you calculated yourself?
Asking because Stripe has StripeTax which offers you auto tax calculation
no I created tax in stripe and need to add that tax id to particular payment intent
Hmm can you provide which Doc you are following? Do you refer to this Tax Id? https://stripe.com/docs/invoicing/taxes/account-tax-ids
yes
This is the document I used for creating invoice with tax
https://stripe.com/docs/api/invoices/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
That's just an API Reference. Which part you followed for the Tax?
here is my code
$invoiceItem = InvoiceItem::create([
'amount' => $request->amount * 100,
'currency' => $request->currency,
'customer' => $request->customer_id,
'description' => $request->description,
'tax_rates' => ['txr_1NVaMLDrfiUMVUSSJsSTuhzn'] // Associate the tax rate with the Invoice Item
]);
\Log::info($invoiceItem);
// Create the Invoice
$invoice = Invoice::create([
'customer' => $request->customer_id,
'collection_method' => 'charge_automatically', // Automatically charge the customer
// 'due_date' => $invoiceItem->date + (60 * 60 * 24 * 30),
'auto_advance' => true // Automatically mark the invoice as paid after successful payment
]);
Where are you getting payment intent null ?
I tried to get payment intent from invoice response after creating invoice
this is the response I get. you can see payment intent is null
Oh!! thanks I missed this out.๐