#DeepCuts
1 messages · Page 1 of 1 (latest)
Hi there
hello sir or maam
its php based
anyway
Stripe::setApiKey(config('services.stripe.secret'));
$product_id = $request->input('product');
$product = ModelsProduct::where('stripe_product_id' == $product_id);
$stripeProduct = Product::retrieve($product);
$price = $stripeProduct->default_price;
$domain = env('NGROK_URL');
$localDomain = 'https://localhost:8000';
$crsfToken = csrf_token();
$stripe = new StripeClient(config('services.stripe.secret'));
$paymentMethods = $stripe->paymentMethods;
$checkoutSession = \Stripe\Checkout\Session::create([
'payment_method_type'=>[$paymentMethods],
'line_items' => [[
# Provide the exact Price ID (e.g. pr_1234) of the product you want to sell
'price_id' => $price
]],
'mode' => 'payment',
'success_url' => $localDomain . route('painting.checkout.success'),
'cancel_url' => $localDomain . route('painting.checkout.cancel'),
'automatic_tax'=>[
'enabled'=>false
]
]);
event(OrderInitiated::class);
return response()->json(['checkoutSession'=>$checkoutSession]);
}```
the error is coming when i go to retrieve the product
i actually dont understand this error, havent seen it before
Have you logged out $product
yea
To see what you get before you try to retrieve
well i have in the front end
it wouldnt be anything other than a string
which is why im confused
actually
wait
i think i just see what i did
i got my product model
which isnt the same
and im trying to send the whole object instead of just the id
yep! thanks youve been very helpful
Happy to help
honestly sometimes just someone asking what the problem is is enough to help me get past whatevers blocking me from seeing my mistake. thanks have a good day!
is that what its called ? i read alot , never heard that, but definitely gonna make a mental note lol.
cool im always looking for little pointers to fine tune my process, i finished school less than a year ago and if I have any criticism , its that they dont balance the need to get grades with understanding enough
Yeah hard to balance pragmatism with philosophy
I never went to school for software dev though 😅
yeah, i happen to be pretty interested in both topics .. yeah i went back at 34 after my 3 years of call center experience couldnt get me shit