Skip to content

Fix paypal commerce google pay using test environment#3167

Merged
Crabcyborg merged 1 commit into
masterfrom
fix_paypal_commerce_google_pay_using_test_environment
Jun 22, 2026
Merged

Fix paypal commerce google pay using test environment#3167
Crabcyborg merged 1 commit into
masterfrom
fix_paypal_commerce_google_pay_using_test_environment

Conversation

@Crabcyborg

@Crabcyborg Crabcyborg commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Related ticket https://secure.helpscout.net/conversation/3359590190/253804

Pre-release
formidable-6.32.2b.zip

Summary by CodeRabbit

  • Bug Fixes
    • Fixed Google Pay to use the correct payment environment (test or production) based on your PayPal plugin configuration, instead of always defaulting to test mode.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a5ff398b-b25c-4524-a54a-1563a30de547

📥 Commits

Reviewing files that changed from the base of the PR and between f90301f and d283713.

📒 Files selected for processing (2)
  • paypal/controllers/FrmPayPalLiteActionsController.php
  • paypal/js/frontend.js

📝 Walkthrough

Walkthrough

The PayPal plugin mode is now included in the localized frmPayPalVars JavaScript object (via FrmPayPalLiteAppHelper::active_mode()). The Google Pay PaymentsClient in frontend.js reads this value to set its environment to 'TEST' or 'PRODUCTION' instead of always using 'TEST'.

Changes

Google Pay Environment Mode Wiring

Layer / File(s) Summary
Mode passed to JS and consumed by Google Pay client
paypal/controllers/FrmPayPalLiteActionsController.php, paypal/js/frontend.js
load_scripts() adds a mode key from FrmPayPalLiteAppHelper::active_mode() to the frmPayPalVars localized array; getGooglePaymentsClient() reads frmPayPalVars.mode to conditionally set the Google Pay environment to 'TEST' or 'PRODUCTION'.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • Strategy11/formidable-forms#3156: Fixes test_mode preservation/submission on the PHP side, which is the same mode value now being surfaced through frmPayPalVars.mode to drive the Google Pay environment selection.

Poem

🐇 A mode was once hardcoded, always 'TEST' it would say,
A bunny noticed Google Pay might need a different way.
So PHP was asked to share the mode it holds so dear,
And now 'PRODUCTION' shines bright when the live site is near!
No more hardcoded strings — the right environment appears! 🎉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix_paypal_commerce_google_pay_using_test_environment

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.

@deepsource-io

deepsource-io Bot commented Jun 22, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in f90301f...d283713 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
PHP Jun 22, 2026 6:47p.m. Review ↗
JavaScript Jun 22, 2026 6:47p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@Crabcyborg
Crabcyborg merged commit 02832ff into master Jun 22, 2026
44 of 48 checks passed
@Crabcyborg
Crabcyborg deleted the fix_paypal_commerce_google_pay_using_test_environment branch June 22, 2026 18:51
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