-
-
Notifications
You must be signed in to change notification settings - Fork 75
quality-debt: inc/gateways/class-paypal-rest-gateway.php — PR #751 review feedback (high) #761
Description
Unactioned Review Feedback
Source PR: #751
File: inc/gateways/class-paypal-rest-gateway.php
Reviewers: coderabbit
Findings: 1
Max severity: high
HIGH: coderabbit (coderabbitai[bot])
File: inc/gateways/class-paypal-rest-gateway.php:1305
Use true in the subscription path.
Line 1281 sets auto-renew on, but reactivate(false) / renew(false) immediately clear it again. That leaves a confirmed PayPal subscription stored as manual renewal.
Suggested fix
- if (in_array($membership->get_status(), $inactive_statuses, true)) {
- $membership->reactivate(false);
- } else {
- $membership->renew(false);
- }
+ if (in_array($membership->get_status(), $inactive_statuses, true)) {
+ $membership->reactivate(true);
+ } else {
+ $membership->renew(true);
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
$inactive_statuses = [Membership_Status::CANCELLED, Membership_Status::EXPIRED];
if (in_array($membership->get_status(), $inactive_statuses, true)) {
$membership->reactivate(true);
} else {
$membership->renew(true);
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@inc/gateways/class-paypal-rest-gateway.php` around lines 1300 - 1305, The
code re-enables auto-renew earlier but then calls $membership->reactivate(false)
and $membership->renew(false), which clears auto-renew again; change those calls
to $membership->reactivate(true) and $membership->renew(true) so the
subscription path preserves auto-renew when confirming the PayPal subscription
(referencing the $membership object and its reactivate and renew methods).
View comment
Auto-generated by quality-feedback-helper.sh scan-merged. Review each finding and either fix the code or dismiss with a reason.
To approve or decline, use one of:
sudo aidevops approve issue <number>-- cryptographically signs approval for automated dispatch- Comment
declined: <reason>-- closes this issue (include your reason after the colon)
aidevops.sh v3.6.166 automated scan.