PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.0
4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 All 256 releases
← All changes | src/Framework/PaymentGateways/Webhooks/EventHandlers/Actions/UpdateSubscriptionStatus.php +11 -0 4.15.1 → 4.17.0 View file →
@@ -4,8 +4,9 @@
4 4
5 5 use Exception;
6 6 use Give\Framework\PaymentGateways\Log\PaymentGatewayLog;
7 7 use Give\Subscriptions\Models\Subscription;
8 +use Give\Subscriptions\Models\SubscriptionNote;
8 9 use Give\Subscriptions\ValueObjects\SubscriptionStatus;
9 10
10 11 /**
11 12 * @since 3.6.0
@@ -12,8 +13,9 @@
12 13 */
13 14 class UpdateSubscriptionStatus
14 15 {
15 16 /**
17 + * @since 4.16.0 Add note to subscription
16 18 * @since 3.6.0
17 19 *
18 20 * @throws Exception
19 21 */
@@ -27,8 +29,17 @@
27 29
28 30 if (empty($message)) {
29 31 $message = $this->getMessageFromStatus($status);
30 32 }
33 +
34 + SubscriptionNote::create([
35 + 'subscriptionId' => $subscription->id,
36 + 'content' => $message . ' ' . sprintf(
37 + __('%s subscription ID: %s', 'give'),
38 + $subscription->initialDonation()->gateway()->getName(),
39 + $subscription->gatewaySubscriptionId
40 + ),
41 + ]);
31 42
32 43 PaymentGatewayLog::info(
33 44 $message . ' ' . sprintf('Subscription ID: %s.', $subscription->id),
34 45 [