Skip to content

Deepscan fixes#2907

Closed
Crabcyborg wants to merge 102 commits into
masterfrom
deepscan_fixes
Closed

Deepscan fixes#2907
Crabcyborg wants to merge 102 commits into
masterfrom
deepscan_fixes

Conversation

@Crabcyborg
Copy link
Copy Markdown
Contributor

@Crabcyborg Crabcyborg commented Jan 29, 2026

Summary by CodeRabbit

  • New Features

    • Added PayPal Lite as a payment gateway option alongside Stripe and Square, including Card Fields integration and subscription support.
    • Implemented PayPal account connection via OAuth flow with test and live mode support.
    • Added PayPal event processing and webhook handling for secure payment verification.
    • Introduced PayPal-specific form settings and configuration management.
  • Bug Fixes

    • Improved error messages for payment gateway configuration checks.
    • Fixed CSS output handling in theme customization.
  • Chores

    • Updated payment gateway autoloading logic.
    • Refactored JavaScript payment handling and admin utilities.

✏️ Tip: You can customize this high-level summary in your review settings.

@Crabcyborg Crabcyborg added this to the 6.28 milestone Jan 29, 2026
@Crabcyborg Crabcyborg closed this Jan 29, 2026
@Crabcyborg Crabcyborg deleted the deepscan_fixes branch January 29, 2026 19:10
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 29, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This pull request introduces a complete PayPal Lite payment gateway integration for Formidable Forms. It adds PayPal controllers, helpers, models, and views for settings management; JavaScript modules for frontend card fields and admin connectivity; hook registration in the core framework; and integration points with existing Stripe/Square payment systems. The autoloader is refactored to support PayPal classes alongside existing payment gateways.

Changes

Cohort / File(s) Summary
PayPal Lite Controllers
paypal/controllers/FrmPayPalLiteActionsController.php, paypal/controllers/FrmPayPalLiteAppController.php, paypal/controllers/FrmPayPalLiteEventsController.php, paypal/controllers/FrmPayPalLiteHooksController.php, paypal/controllers/FrmPayPalLiteSettingsController.php
Adds PayPal gateway integration with form action handling, AJAX endpoints for OAuth/order/subscription creation, event processing, hook registration, and admin settings routing. 1,562 lines of new payment processing logic.
PayPal Lite Helpers & Models
paypal/helpers/FrmPayPalLiteAppHelper.php, paypal/helpers/FrmPayPalLiteConnectHelper.php, paypal/models/FrmPayPalLiteSettings.php
Introduces PayPal API connectivity, settings management, OAuth handling, server communication, seller status rendering, and event retrieval. 995 lines total.
PayPal Lite Views
paypal/views/settings/...
Four new settings view templates for PayPal connection box, container, seller placeholder, and form rendering. Renders UI for test/live mode toggles, connection status, and OAuth flow.
PayPal Lite JavaScript
paypal/js/action.js, paypal/js/frontend.js, paypal/js/settings.js
Adds 619 lines of client-side code: frontend module for PayPal Card Fields initialization and submission handling; settings module for OAuth and disconnect flows with polling; action module placeholder.
Hook Integration
classes/controllers/FrmHooksController.php
Registers PayPal Lite hooks in both frontend (load_hooks) and admin (load_admin_hooks) initialization paths, enabling the payment gateway throughout plugin lifecycle.
Tip Removal
classes/helpers/FrmTipsHelper.php
Removes two legacy PayPal tip entries from form action tips, eliminating outdated educational content.
CSS Rendering
css/custom_theme.css.php
Adds dynamic CSS output by invoking FrmStylesController::get_custom_css() and sanitizing via strip_tags().
Autoloader Refactoring
formidable.php
Restructures Stripe/Square/PayPal class autoloading to use centralized subdirectory resolution (helpers/controllers/models), reducing duplication and adding PayPal support.
Admin JavaScript Refactoring
js/admin/style.js, js/admin/admin.js, js/src/admin/addon-state.js, js/admin/settings.js
Removes unused helper functions (getTemplateCard, maybeCollapseSettings, scrollToField); simplifies addon installation logic; adds new credential-based addon installation flow; removes event parameter from showSendTestEmailModal.
Frontend JavaScript Updates
js/formidable.js, js/src/components/class-overlay.js
Simplifies guard condition in fieldValueChanged; consolidates falsy URL checks in overlay button rendering.
Payment Gateway Integration
stripe/controllers/FrmTransLitePaymentsController.php, stripe/controllers/FrmTransLiteSubscriptionsController.php, stripe/controllers/FrmStrpLiteActionsController.php, stripe/js/frmtrans_admin.js, stripe/views/action-settings/payments-options.php, square/controllers/FrmSquareLiteActionsController.php, square/helpers/FrmSquareLiteConnectHelper.php
Adds PayPal refund and subscription cancellation support; updates error messages for Stripe/Square; extends gateway toggle logic to include PayPal; adds PayPal education tips and product_name field in action settings.
Static Analysis & Build Configuration
psalm.xml, rector.php
Adds paypal directory to Psalm error levels and Rector transformation paths for static analysis coverage.

Sequence Diagram(s)

sequenceDiagram
    actor User as User
    participant Form as Form DOM
    participant PayPalJS as PayPal JS Module
    participant WPServer as WordPress Server
    participant PayPalAPI as PayPal API

    User->>Form: Views form with PayPal action
    Form->>PayPalJS: frmPageChanged / load trigger
    PayPalJS->>PayPalJS: Initialize Card Fields
    PayPalJS->>Form: Render card input fields
    
    User->>Form: Enters payment details & submits
    Form->>PayPalJS: handleCardSubmission listener fires
    PayPalJS->>PayPalJS: Validate form, collect cardholder name
    PayPalJS->>PayPalJS: Submit card fields to PayPal
    
    PayPalJS->>WPServer: AJAX POST create_order (form_id, amount)
    WPServer->>WPServer: FrmPayPalLiteAppController::create_order()
    WPServer->>PayPalAPI: Create order request
    PayPalAPI-->>WPServer: Return orderID
    WPServer-->>PayPalJS: Return orderID
    
    PayPalJS->>PayPalAPI: Approve order with card details
    PayPalAPI-->>PayPalJS: Return capture confirmation
    PayPalJS->>PayPalJS: onApprove callback
    PayPalJS->>Form: Inject order_id, dispatch submit event
    
    Form->>WPServer: Form submission with order_id
    WPServer->>WPServer: FrmPayPalLiteActionsController::trigger_gateway()
    WPServer->>WPServer: Create payment record locally
    WPServer-->>Form: Success response
    Form->>User: Show confirmation
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

action: needs qa

Suggested reviewers

  • lauramekaj1

Poem

🐰 A rabbit hops through payment flows,
Where PayPal's magic brightly glows!
Card fields dance, orders take flight,
Gateway gateways—all set right! ✨
From Lite to Pro, the forms now sing,
A whole new payment gathering! 💳

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Crabcyborg
Copy link
Copy Markdown
Contributor Author

Accidentally branched off of PayPal.

@Crabcyborg Crabcyborg removed this from the 6.28 milestone Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant