PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
← All changes | app/Modules/PaymentMethods/Cod/CodHandler.php +7 -7 1.5.0 → 1.6.5 View file →
@@ -8,9 +8,8 @@
8 8 use FluentCart\App\Helpers\StatusHelper;
9 9 use FluentCart\App\Models\Cart;
10 10 use FluentCart\App\Modules\Subscriptions\Services\SubscriptionService;
11 11 use FluentCart\App\Services\DateTime\DateTime;
12 -use FluentCart\App\Services\Payments\PaymentHelper;
13 12 use FluentCart\App\Models\Subscription;
14 13
15 14 class CodHandler {
16 15
@@ -53,13 +52,15 @@
53 52 'customer' => $paymentInstance->order->customer ?? [],
54 53 'transaction' => $paymentInstance->transaction ?? []
55 54 ];
56 55
57 - do_action('fluent_cart/order_placed_offline', $data);
56 + // Renewal invoices are not new orders — skip placement emails.
57 + // SubscriptionRenewed fires separately once the invoice is paid.
58 + if ($paymentInstance->order->type !== Status::ORDER_TYPE_RENEWAL) {
59 + do_action('fluent_cart/order_placed_offline', $data);
60 + }
58 61 }
59 62
60 - $paymentHelper = new PaymentHelper('offline_payment');
61 -
62 63 $relatedCart = Cart::query()->where('order_id', $order->id)
63 64 ->where('stage', '!=', 'completed')
64 65 ->first();
65 66
@@ -68,9 +69,9 @@
68 69 $relatedCart->completed_at = DateTime::now()->format('Y-m-d H:i:s');
69 70 $relatedCart->save();
70 71 }
71 72
72 - return $paymentHelper->successUrl($paymentInstance->transaction->uuid);
73 + return $paymentInstance->transaction->getSuccessUrl();
73 74 }
74 75
75 76 public function handleZeroTotalPayment($paymentInstance)
76 77 {
@@ -100,8 +101,7 @@
100 101 }
101 102 }
102 103 }
103 104
104 - $paymentHelper = new PaymentHelper('offline_payment');
105 - return $paymentHelper->successUrl($transaction->uuid);
105 + return $transaction->getSuccessUrl();
106 106 }
107 107 }