PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.1
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.1
1.7.1 1.7.0 1.6.6 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 All 51 releases
← All changes | app/Modules/PaymentMethods/PayPalGateway/SubscriptionManager.php +6 -3 1.5.3 → 1.7.1 View file →
@@ -133,8 +133,12 @@
133 133 wp_send_json([
134 134 'status' => 'success',
135 135 'message' => __('Plan created successfully', 'fluent-cart'),
136 136 'plan' => $plan,
137 + 'brand_name' => (new PayPalSettingsBase())->getBrandName([
138 + 'order' => $order,
139 + 'subscription' => $subscriptionModel,
140 + ]),
137 141 ], 200);
138 142 }
139 143
140 144 public function confirmSubscriptionSwitch($data, $subscriptionId)
@@ -185,10 +189,8 @@
185 189 if (!empty($nextBillingDate)) {
186 190 $nextBillingDate = gmdate('Y-m-d H:i:s', strtotime($nextBillingDate));
187 191 }
188 192
189 - $config = $subscription->config ?: [];
190 -
191 193 // update subscription in table
192 194 $data = array_filter([
193 195 'vendor_subscription_id' => $vendorSubscriptionId,
194 196 'vendor_plan_id' => $vendorPlanId,
@@ -195,12 +197,13 @@
195 197 'current_payment_method' => 'paypal',
196 198 'vendor_customer_id' => $vendorCustomerId,
197 199 'next_billing_date' => $nextBillingDate,
198 200 'status' => $this->getCorrectSubscriptionStatus(Arr::get($paypalSubscription, 'status')),
199 - 'config' => array_merge($config, ['is_trial_days_simulated' => 'yes'])
200 201 ]);
201 202
202 203 Subscription::query()->where('id', $subscriptionId)->update($data);
204 +
205 + $subscription->mergeConfig(['is_trial_days_simulated' => 'yes']);
203 206
204 207 $billingInfo = PaymentHelper::parsePaymentMethodDetails('paypal', [
205 208 'email' => Arr::get($paypalSubscription, 'subscriber.email_address'),
206 209 'payer_id' => Arr::get($paypalSubscription, 'subscriber.payer_id'),