wontone18 / Bagisto-Stripe-Payment-Gateway

Laravel bagisto stripe payment gateway from wontonee
https://www.wontonee.com
7 stars 7 forks source link

Success method does not work #4

Closed krestt closed 4 months ago

krestt commented 4 months ago

Call to undefined method Webkul\Checkout\Cart::prepareDataForOrder()

Tasted on latest version of Bagisto

krestt commented 4 months ago

This Method does not exist enymore in latest Bagisto in "packages\Webkul\Checkout\src\Cart.php"

` /**

krestt commented 4 months ago

Ok, I found the solution.... I will post it here: I took the success function from Paypal payment Method, so all I had to do is:

  1. Open : vendor\wontonee\stripe\src\Http\Controllers\StripeController.php
  2. Add use Webkul\Sales\Transformers\OrderResource;
  3. Replace the existing success method with: public function success() { $cart = Cart::getCart(); $data = (new OrderResource($cart))->jsonSerialize(); $order = $this->orderRepository->create($data); Cart::deActivateCart(); session()->flash('order_id', $order->id); return redirect()->route('shop.checkout.onepage.success'); }
wontone18 commented 4 months ago

Hi

you should use their github version not the one which they are giving from installation.