#DeepCuts

1 messages · Page 1 of 1 (latest)

bright mirageBOT
vagrant marsh
#

Hi there

whole pulsar
#

hello sir or maam

vagrant marsh
#

Not intimately familiar with Laravel

#

But happy to help

whole pulsar
#

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

vagrant marsh
#

Have you logged out $product

whole pulsar
#

yea

vagrant marsh
#

To see what you get before you try to retrieve

whole pulsar
#

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

vagrant marsh
#

Yep

#

That would be the issue then

whole pulsar
#

yep! thanks youve been very helpful

vagrant marsh
#

Happy to help

whole pulsar
#

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!

vagrant marsh
#

Rubberducking is one of the best troubleshooting methods!

#

You too!

whole pulsar
#

is that what its called ? i read alot , never heard that, but definitely gonna make a mental note lol.

vagrant marsh
#

This wasn't exactly rubberducking... but same idea overall

whole pulsar
#

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

vagrant marsh
#

Yeah hard to balance pragmatism with philosophy

#

I never went to school for software dev though 😅

whole pulsar
#

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