#tarachand_369
1 messages · Page 1 of 1 (latest)
Hello tarachand_369, we'll be with you shortly! 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.
• https://discord.com/channels/841573134531821608/1164149952650412053, 0 days ago, 3 messages
• https://discord.com/channels/841573134531821608/1164135580607713280, 0 days ago, 9 messages
• https://discord.com/channels/841573134531821608/1164116374164086874, 0 days ago, 8 messages
• https://discord.com/channels/841573134531821608/1164111397718872135, 0 days ago, 3 messages
• https://discord.com/channels/841573134531821608/1163343782692003970, 2 days ago, 8 messages
$domain = Domain::where('user_id', auth()->id())->where('id', decrypt($request->domain_id))->where('status', '1')->first();
\Stripe\Stripe::setApiKey(env('STRIPE_SECRET_KEY'));
$stripe = new \Stripe\StripeClient(env('STRIPE_SECRET_KEY'));
$customer = \Stripe\Customer::create([
'email' => $domain->email,
]);
$data = $stripe->billingPortal->sessions->create([
'customer' => $customer->id,
'return_url' => 'https://localhost/protect-web/public/dashboard',
]);
$portal_link = $data->url;
dd($portal_link);
I am using this code , please help me
How can you see a current Subscription of a Customer that you just created?
\Stripe\Customer::create(
First i get subscription then after I want see customer portal
try{
$session = \Stripe\Checkout\Session::create([
'success_url' => url('billing/success?session_id={CHECKOUT_SESSION_ID}&domain_data='. $domain_data). '&expiry_date='. encrypt($expiry_date),
'cancel_url' => route('addDomain', $domain_decode_data->monthly_price_id),
'mode' => 'subscription',
'payment_method_types' => ['card', 'paypal', 'sepa_debit'],
'line_items' => [
[
'price' => $price_id,
'quantity' => 1
],
[
'price' => $package->one_time_price_id,
'quantity' => 1
],
],
'metadata' => [
'expiry_date' => $expiry_date
],
'customer_email' => $domain_decode_data->email
]);
header('Location: ' . $session->url);
exit();
like this
You create a new Customer object here so they don't have any Subscriptions attached.
I want see customer portal like this
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
You need to find the existing Customer instead of creating a new one: https://stripe.com/docs/api/customers/list#list_customers-email
$domain = Domain::where('user_id', auth()->id())->where('id', decrypt($request->domain_id))->where('status', '1')->first();
\Stripe\Stripe::setApiKey(env('STRIPE_SECRET_KEY'));
$stripe = new \Stripe\StripeClient(env('STRIPE_SECRET_KEY'));
$customer = \Stripe\Customer::create([
'email' => $domain->email,
]);
$data = $stripe->billingPortal->sessions->create([
'customer' => $customer->id,
'return_url' => 'https://localhost/protect-web/public/dashboard',
]);
$portal_link = $data->url;
dd($portal_link);
I am using this code for customer portal
Do you read the messages that I send you?
Sorry I did't understand