#damonstrr
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Default payment method for what exactly? Subscriptions?
I have this
$response = app('stripe')->checkout->sessions->create([
'payment_method_types' => ['card'],
'mode' => 'subscription',
// 'automatic_tax' => ['enabled' => true],
'line_items' => [
[
'price' => $plan->stripe_price_id,
'quantity' => 1,
],
],
'subscription_data' => [
'application_fee_percent' => $plan->applicationPercentage(),
'metadata' => [
'blog_id' => $blog->id,
'post_id' => $latestPost->id,
'user_id' => $blog->user->id,
'user_email' => $blog->user->email,
'name' => $plan->name,
'reader_id' => Auth::user()->id,
'price_id' => $plan->stripe_price_id,
'product_id' => $plan->stripe_product_id,
]
],
'client_reference_id' => Auth::user()->id,
'success_url' => route('blog.checkout.success', ['blog' => $blog->name, 'plan' => $plan->slug]),
'cancel_url' => route('blog.post.show', [$blog->name, 'post' => $latestPost->slug]),
'metadata' => [
'post_id' => $latestPost->id,
'user_id' => Auth::user()->id,
'name' => $plan->abbreviation
],
'customer_email' => Auth::user()->email,
], [
'stripe_account' => $stripeAccount,
]);
how do i set default payment method for the customer
also does invoice get sent in test mode after subscription??
yes please
Typically you'd use the update customer endpoint to update customer.invoice_settings.default_payment_method to set a default payment method on the customer
https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
also does invoice get sent in test mode after subscription??
We don't send emails in test mode
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so how will i include it in the code above??
One option would be to implement webhook endpoint and monitor events
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=checkout#monitoring-events
So another question is that if a customer subscribes, if no default method is set. Will the payment method they used on the checkout session be billed?
When you create a checkout session in subscription mode, the payment method the customer provides during the Checkout flow gets used for billing
oh make sense then
Can automatic tax be enabled for connected account
or does the connect account have to set it individually??
AFAIK It depends on the type of the connected account as well as charges you're creating
https://stripe.com/docs/tax/connect#tax-for-software-platforms
https://stripe.com/docs/tax/connect#tax-for-marketplaces
$updateUser = app('stripe')->accounts->create([
'type' => 'standard',
'email' => $request->user()->email,
'business_type' => 'individual',
'business_profile' => ['url' => $blogUrl]
]);
$blog->update(['stripe_account_id' => $updateUser->id]);
$response = app('stripe')->accountLinks->create([
'account' => $blog->stripe_account_id,
'type' => 'account_onboarding',
'refresh_url' => route('blog.stripe.connect', $blog),
'return_url' => route('blog.stripe.verify', $blog),
]);
i guess it is on connected account then right?
That code is just creating standard connected accounts
Yeah the link you sent does not say though
In addition to account type and charges, it also depends on what your platform does. If you look at the links I shared, depending on the industry you're involved in either platform or the connected account is liable for tax
Based on that, you can configure connected account as shown here
https://stripe.com/docs/tax/tax-for-platforms#set-up
OR your platform account as shown here
https://stripe.com/docs/tax/tax-for-marketplaces#set-up
๐ Stepping in for my teammate
Either account type could work for marketplaces. I recommend reviewing the differences in account types instead: https://stripe.com/docs/connect/accounts#choosing-approach
cheers
For a platform that allows author make money from readers on article subscription. What Preset product tax code is recommended??
I can't advise on which tax codes to use, and neither can our support team. I recommend discussing this with a tax professional