Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
320 commits
Select commit Hold shift + click to select a range
06435d5
Merge branch 'master' into paypal
Crabcyborg Jan 14, 2026
e7b5b12
Add more logging and switch back to testing one time payments
Crabcyborg Jan 14, 2026
70704f0
Merge branch 'master' into paypal
Crabcyborg Jan 19, 2026
3153ad7
Merge branch 'master' into paypal
Crabcyborg Jan 20, 2026
f579d3b
Apply new sniffs
Crabcyborg Jan 20, 2026
5394868
Merge branch 'master' into paypal
Crabcyborg Jan 23, 2026
3e91499
Run sniffs (update comment case)
Crabcyborg Jan 23, 2026
784f1e0
Merge branch 'master' into paypal
Crabcyborg Jan 23, 2026
2733caa
Work on getting seller status details
Crabcyborg Jan 23, 2026
0e80ec3
Show errors if PayPal status is not good
Crabcyborg Jan 23, 2026
b753964
Update comment
Crabcyborg Jan 23, 2026
cf72b54
Merge branch 'master' into paypal
Crabcyborg Jan 26, 2026
778fcc0
Working on rendering seller info
Crabcyborg Jan 26, 2026
112aa11
Merge branch 'master' into paypal
Crabcyborg Jan 26, 2026
ce81be9
Merge branch 'master' into paypal
Crabcyborg Jan 26, 2026
b2a9545
Merge branch 'master' into paypal
Crabcyborg Jan 26, 2026
3f2f56f
Move seller status to the connection box
Crabcyborg Jan 26, 2026
e0a7188
Merge branch 'master' into paypal
Crabcyborg Jan 27, 2026
4dd58ed
Always show the connect email in the seller status elements
Crabcyborg Jan 27, 2026
2d9da1f
Store a valid seller status as an option to avoid too many calls to P…
Crabcyborg Jan 27, 2026
6909c44
Merge branch 'master' into paypal
Crabcyborg Jan 27, 2026
e8ea08e
Apply some phpcbf fixes
Crabcyborg Jan 27, 2026
b901299
Only save the option if we also have the email
Crabcyborg Jan 27, 2026
8db1368
Merge branch 'master' into paypal
Crabcyborg Jan 27, 2026
729fbaf
Remove inline HTML into view files
Crabcyborg Jan 27, 2026
279c8ed
Small code cleanup changes
Crabcyborg Jan 28, 2026
8563d06
Merge branch 'master' into paypal
Crabcyborg Jan 28, 2026
8bc3a13
Fix mago issue
Crabcyborg Jan 28, 2026
5fbe6ff
Only call the PayPal API for seller status when visiting the paypal tab
Crabcyborg Jan 28, 2026
3df87f2
Merge branch 'master' into paypal
Crabcyborg Jan 29, 2026
526a504
Playing with pay later
Crabcyborg Jan 29, 2026
0394d2a
Merge branch 'master' into paypal
Crabcyborg Jan 29, 2026
2279650
Merge branch 'master' into paypal
Crabcyborg Jan 30, 2026
5dd6163
Merge branch 'master' into paypal
Crabcyborg Jan 30, 2026
b52cb81
Change the gateway setting to the tabs we use on the global settings
Crabcyborg Jan 30, 2026
b61fff7
Check that checkout is available if ppcp_custom is not
Crabcyborg Jan 30, 2026
e7bcc42
Merge branch 'master' into paypal
Crabcyborg Feb 2, 2026
95f1a88
Show the merchant ID as well
Crabcyborg Feb 2, 2026
c87ed11
Merge branch 'master' into paypal
Crabcyborg Feb 2, 2026
597c5bc
Fix typo, spacing isuse
Crabcyborg Feb 2, 2026
f1d1fcc
Merge branch 'master' into paypal
Crabcyborg Feb 2, 2026
3e6aba7
Modify the default paypal action so it does not appear disabled and i…
Crabcyborg Feb 2, 2026
b0ac5ec
Fix indentation
Crabcyborg Feb 2, 2026
584fbdb
Add action icons for Square and Stripe too
Crabcyborg Feb 2, 2026
7297ef7
Make the icons look nicer
Crabcyborg Feb 2, 2026
0d0be74
Merge branch 'master' into paypal
Crabcyborg Feb 3, 2026
5a3f6b2
Merge branch 'master' into paypal
Crabcyborg Feb 3, 2026
53b3d36
Merge branch 'master' into paypal
Crabcyborg Feb 3, 2026
4e4fd04
Add comment
Crabcyborg Feb 3, 2026
b5216cc
Merge branch 'master' into paypal
Crabcyborg Feb 3, 2026
f09c65e
Test data
Crabcyborg Feb 3, 2026
7519c16
Merge branch 'master' into paypal
Crabcyborg Feb 3, 2026
9dc10fe
Merge branch 'master' into paypal
Crabcyborg Feb 3, 2026
5f29189
Pull the client id from global vars and populate the currency and int…
Crabcyborg Feb 3, 2026
4c6474e
Remove irrelevant client ids
Crabcyborg Feb 3, 2026
dfd8f00
Use array for gateway to improve compatibility with payments submodul…
Crabcyborg Feb 3, 2026
c288ce2
Merge branch 'master' into paypal
Crabcyborg Feb 3, 2026
23f2960
Merge branch 'master' into paypal
Crabcyborg Feb 4, 2026
4f1d094
Check for onCancel and remove the spinner from button
Crabcyborg Feb 4, 2026
b4b0ee2
Work on adding additional action settings
Crabcyborg Feb 4, 2026
0887269
Merge branch 'master' into paypal
Crabcyborg Feb 4, 2026
541f0ef
Merge branch 'master' into paypal
Crabcyborg Feb 4, 2026
0f4a0c8
Merge branch 'master' into paypal
Crabcyborg Feb 4, 2026
d7dacb3
Merge branch 'master' into paypal
Crabcyborg Feb 4, 2026
4de0da4
Move product name to a new view, add a helper function to echo frm_hi…
Crabcyborg Feb 4, 2026
82a74d8
Add setting to disable Pay Later
Crabcyborg Feb 4, 2026
5c50f1a
Re-use logic for removing credit card field errors
Crabcyborg Feb 4, 2026
f4ff77f
Working on pay later messaging
Crabcyborg Feb 4, 2026
0040dd6
Merge branch 'master' into paypal
Crabcyborg Feb 5, 2026
d8596c3
Add new button settings
Crabcyborg Feb 5, 2026
be35b9b
Remove extra open div breaking html
Crabcyborg Feb 5, 2026
40fc871
Fix wrong value for no messaging option causing it to show automatic,…
Crabcyborg Feb 5, 2026
332b616
Add the other payment gateway buttons
Crabcyborg Feb 5, 2026
61f9239
Clean up
Crabcyborg Feb 5, 2026
4a37737
Move render messages to a function
Crabcyborg Feb 6, 2026
696373a
Merge branch 'master' into paypal
Crabcyborg Feb 6, 2026
881d61b
Stop trying to change the message based on selected country, pull tes…
Crabcyborg Feb 6, 2026
ac2bbe9
Clear out more old code
Crabcyborg Feb 6, 2026
bd94c9a
Pull out the debug query arg (can be added now with filter), add sati…
Crabcyborg Feb 6, 2026
dc44012
Add comments
Crabcyborg Feb 6, 2026
22cc98e
Add back mybank;
Crabcyborg Feb 6, 2026
a52c8dd
Merge branch 'master' into paypal
Crabcyborg Feb 6, 2026
dde6a1a
Work on vetting status for ACDC, use onCancel and button styling for …
Crabcyborg Feb 6, 2026
78f27ea
Merge branch 'master' into paypal
Crabcyborg Feb 16, 2026
cac80b2
Show the vetting status properly
Crabcyborg Feb 16, 2026
b1e1f92
Separate out the acdc vetting status
Crabcyborg Feb 16, 2026
3e9853f
Add locale to the JS SDK
Crabcyborg Feb 16, 2026
9aa1fd2
Pass the payment source data and send brand name with filter to API f…
Crabcyborg Feb 16, 2026
d4ab544
Drop button layout for now and use a filter instead, update client id…
Crabcyborg Feb 17, 2026
7035d9c
Be explicit when rendering pay later button
Crabcyborg Feb 17, 2026
74a58f6
Drop the button layout filter (will not work anymore)
Crabcyborg Feb 17, 2026
d8a5a79
Work on refunding, work on building the card field HTML conditionally
Crabcyborg Feb 17, 2026
c3b843c
Merge branch 'master' into paypal
Crabcyborg Feb 18, 2026
20a2529
Wrap refund message so it looks like updated message or error, use sh…
Crabcyborg Feb 18, 2026
5247e9b
Send payer data when creating order
Crabcyborg Feb 18, 2026
beeee8f
Use the proper amount value for pay later messaging and sync it
Crabcyborg Feb 18, 2026
f24748f
Show buyer details in thank you message
Crabcyborg Feb 19, 2026
fbbe8d4
Stop showing error if cards are not eligible, only show vetting statu…
Crabcyborg Feb 19, 2026
72fd1ac
Add 3D secure checks
Crabcyborg Feb 19, 2026
f676851
Add server side liability checks as well
Crabcyborg Feb 19, 2026
6c4b6a5
Hide the paypal button and OR text when a credit card field has a value
Crabcyborg Feb 19, 2026
e121a31
Try adding a layout setting to control checkout vs card
Crabcyborg Feb 19, 2026
c322ddb
Get gateway icons to toggle in sync with one another
Crabcyborg Feb 20, 2026
196d620
Merge branch 'master' into paypal
Crabcyborg Feb 24, 2026
0af2f88
Ignore some psalm errors in paypal views
Crabcyborg Feb 24, 2026
2365857
Remove psalm as new dependency
Crabcyborg Feb 24, 2026
086541a
Run php cs fixer
Crabcyborg Feb 24, 2026
f7761de
Run sniffs
Crabcyborg Feb 24, 2026
b9e5197
Fix some workflow issues
Crabcyborg Feb 24, 2026
87a6773
Fix some phpcs issues
Crabcyborg Feb 24, 2026
ac7b02a
Add some typo rule exceptions and run eslint fixer
Crabcyborg Feb 24, 2026
c6bdde5
Merge branch 'master' into paypal
Crabcyborg Feb 25, 2026
7f68479
Apply eslint fixer
Crabcyborg Feb 25, 2026
aba8e82
Working on subscriptions (JS)
Crabcyborg Feb 25, 2026
bfa4fb7
Use the payment source from the onApprove data (the order object does…
Crabcyborg Feb 25, 2026
7e0e860
Remove submit loading when there is a paypal error
Crabcyborg Feb 25, 2026
4ed0695
Fix issue with running var not getting updated for buttons
Crabcyborg Feb 25, 2026
7fb37a5
Use card if there is no payment source set
Crabcyborg Feb 25, 2026
1afae70
Support venmo
Crabcyborg Feb 25, 2026
6d14ec8
Working on Google Pay
Crabcyborg Feb 25, 2026
c847b04
Improve the google pay button styling
Crabcyborg Feb 25, 2026
952051b
Include the other payment method buttons in the paypal button contain…
Crabcyborg Feb 26, 2026
be52e5b
Add some styles to the google pay button to make it more consistent w…
Crabcyborg Feb 26, 2026
88313c2
Update text for layout setting name
Crabcyborg Feb 26, 2026
3a319d8
Update Collect a Payment action text
Crabcyborg Feb 26, 2026
21e890b
Update card field messaging to check for paypal and to mention the ne…
Crabcyborg Feb 26, 2026
f4d7390
Fix the pay later text in the thank you message
Crabcyborg Feb 26, 2026
63d25c7
Merge branch 'master' into paypal
Crabcyborg Feb 27, 2026
a2be037
Apply phpcbf changes
Crabcyborg Feb 27, 2026
0db8cfd
Add filter for liability error for better flexibility
Crabcyborg Feb 27, 2026
a693eae
Move liability check into a separate function
Crabcyborg Feb 27, 2026
1697110
Work on entry syncing after order capture
Crabcyborg Feb 27, 2026
8c82179
Add more validation for order amount and order status
Crabcyborg Feb 27, 2026
8297ee4
Fix issues with creating order failing when address is blank
Crabcyborg Feb 27, 2026
9e6a4aa
Remove some old code for supporting PayPal that is no longer required
Crabcyborg Feb 27, 2026
464cc18
Work on compatibility with paypal add-on
Crabcyborg Feb 27, 2026
3379590
Merge branch 'master' into paypal
Crabcyborg Mar 2, 2026
94eeb0c
Merge branch 'master' into paypal
Crabcyborg Mar 2, 2026
a00036e
Run php cs fixer
Crabcyborg Mar 2, 2026
cc2112d
Run eslint fix
Crabcyborg Mar 2, 2026
3cfe19c
Merge branch 'master' into paypal
Crabcyborg Mar 2, 2026
4b304f0
Add setting to insert new paypal fields
Crabcyborg Mar 2, 2026
b92d79a
Add todo comment
Crabcyborg Mar 2, 2026
a6d87d3
Flag and hide the paypal order fields
Crabcyborg Mar 2, 2026
ba573ee
Working on recurring payments
Crabcyborg Mar 3, 2026
1c8269a
Merge branch 'master' into paypal
Crabcyborg Mar 3, 2026
fa5fb6d
Working on adding a shipping preference setting
Crabcyborg Mar 4, 2026
adb0ae1
Merge branch 'master' into paypal
Crabcyborg Mar 4, 2026
bb6e02b
Pass the shipping_preference when creating an order
Crabcyborg Mar 4, 2026
74e137c
Pass brand name to create subscription
Crabcyborg Mar 4, 2026
fcf6c09
Stop including paypal legacy in payment actions when the add-on is no…
Crabcyborg Mar 4, 2026
5b208c0
Pass shipping preference when creating subscription, hook in to show …
Crabcyborg Mar 4, 2026
d618f1f
Improvements to how paypal legacy icon is added
Crabcyborg Mar 4, 2026
4c6d10e
Stop using the def class names for the lite payment actions, use the …
Crabcyborg Mar 4, 2026
d9d08e4
Clean up
Crabcyborg Mar 4, 2026
6c8429f
Put address field shipping preference option behind a pro check
Crabcyborg Mar 4, 2026
1a8a28f
Merge branch 'master' into paypal
Crabcyborg Mar 5, 2026
60f8a03
Fix eslint issues
Crabcyborg Mar 5, 2026
36c0572
Remove unused param (deepscan issue)
Crabcyborg Mar 5, 2026
fe82572
Apply rector fix
Crabcyborg Mar 5, 2026
7839e98
Remove param comment for removed param
Crabcyborg Mar 5, 2026
5449e31
Merge branch 'master' into paypal
Crabcyborg Mar 5, 2026
b099fde
Pass payer data when creating a subscription
Crabcyborg Mar 5, 2026
050c32e
Sync entry based on subscription response
Crabcyborg Mar 5, 2026
3bbb42a
Merge branch 'master' into paypal
Crabcyborg Mar 12, 2026
d08cbeb
Run php cs fixer
Crabcyborg Mar 12, 2026
e2c8b1c
Run phpcbf and clean up code
Crabcyborg Mar 12, 2026
dbcd198
Remove some testing code
Crabcyborg Mar 12, 2026
2b8e22c
Fix more workflow errors
Crabcyborg Mar 12, 2026
62a070f
Add missing param comment
Crabcyborg Mar 12, 2026
2186e99
Add more type comments
Crabcyborg Mar 12, 2026
c8dacb8
Remove unused function
Crabcyborg Mar 12, 2026
c7454a2
Load the paypal scripts asynchronously when there are page breaks in …
Crabcyborg Mar 12, 2026
f649d80
Merge branch 'master' into paypal
Crabcyborg Mar 12, 2026
743a39e
Conditionally include components based on layout setting and only loa…
Crabcyborg Mar 12, 2026
6b6d44e
Stop using a loop
Crabcyborg Mar 12, 2026
c9291c2
Use QA site
Crabcyborg Mar 12, 2026
be11130
Stop excluding the paypal folder
Crabcyborg Mar 12, 2026
67d1c72
Add new button style filter, make buttons smaller by default
Crabcyborg Mar 13, 2026
7578a91
Add more iframe height validation
Crabcyborg Mar 13, 2026
544a2d1
Extract out google pay height logic to a new function, adjust styling…
Crabcyborg Mar 13, 2026
822587d
Add 1px to height of iframe wrappers to avoid border cut off issue
Crabcyborg Mar 13, 2026
93e30f9
Merged master
Crabcyborg Mar 13, 2026
d6d0280
Merge branch 'master' into paypal
Crabcyborg Mar 13, 2026
f8a73b9
Include the paypal order field note
Crabcyborg Mar 13, 2026
dd6ad7f
Add new fields controller to move some functions over
Crabcyborg Mar 13, 2026
b3b5083
Merge branch 'master' into paypal
Crabcyborg Mar 13, 2026
1205022
Merge branch 'master' into paypal
Crabcyborg Mar 16, 2026
c620a8f
Prevent error when using gold with Venmo
Crabcyborg Mar 16, 2026
88cbfb7
Stop trying to use colors for funding source buttons if the source do…
Crabcyborg Mar 16, 2026
e992294
Merge branch 'master' into paypal
Crabcyborg Mar 18, 2026
e026af1
PayPal radio buttons implementation
Crabcyborg Mar 20, 2026
f442016
Merge branch 'master' into paypal
Crabcyborg Mar 20, 2026
0806e09
Remove the method descriptions object
Crabcyborg Mar 20, 2026
e9feedb
Use google pay icon locally
Crabcyborg Mar 20, 2026
9852bbe
Move CSS to a CSS file
Crabcyborg Mar 20, 2026
7b58e78
Apply eslint fix
Crabcyborg Mar 20, 2026
7a01741
Merge branch 'master' into paypal_radio_buttons
Crabcyborg Mar 20, 2026
fd032da
Apply eslint fixes
Crabcyborg Mar 20, 2026
5f76897
Merge pull request #3032 from Strategy11/paypal_radio_buttons
Crabcyborg Mar 20, 2026
258a0e4
Merge branch 'master' into paypal
Crabcyborg Mar 23, 2026
202ef7e
Stop using .call
Crabcyborg Mar 23, 2026
66372a3
Remove unused function
Crabcyborg Mar 23, 2026
2a00116
Run php cs fixer
Crabcyborg Mar 23, 2026
64601f7
Move logic out into a new get source display type function, fix some …
Crabcyborg Mar 23, 2026
2151f10
Move format address logic into a new function
Crabcyborg Mar 23, 2026
fa551cb
Get refunding working when the payments submodule is active
Crabcyborg Mar 23, 2026
3a3f70d
Make gateway buttons easier to render from other add-ons
Crabcyborg Mar 23, 2026
094dad9
Use Stripe, Square, PayPal as gateway button order
Crabcyborg Mar 24, 2026
6e1b724
Merge branch 'master' into paypal
Crabcyborg Mar 24, 2026
0d8dbcc
Support subscriptions for card fields
Crabcyborg Mar 24, 2026
bc7ff90
Conditionally show and hide the paypal button settings based on card/…
Crabcyborg Mar 24, 2026
3bc9b83
Try to add in links to PayPal for onboarding errors
Crabcyborg Mar 25, 2026
304ca19
Merge branch 'master' into paypal
Crabcyborg Mar 26, 2026
c10c5ea
Apply some workflow fixes
Crabcyborg Mar 26, 2026
6c38a61
Apply some eslint fixes
Crabcyborg Mar 26, 2026
9a6a893
Add return description
Crabcyborg Mar 26, 2026
c1b60ed
Fix issues with layout setting
Crabcyborg Mar 26, 2026
069da46
Working on Apple Pay (wip)
Crabcyborg Mar 30, 2026
30e279c
Get apple pay button appearing
Crabcyborg Mar 30, 2026
3039bcc
Remove some logging
Crabcyborg Mar 30, 2026
36b9640
Drop unused var
Crabcyborg Mar 30, 2026
bf25dc1
Merge pull request #3050 from Strategy11/apple_pay
Crabcyborg Mar 30, 2026
0d344cb
Merge branch 'master' into paypal
Crabcyborg Mar 30, 2026
1267097
Drop inject styles function
Crabcyborg Mar 30, 2026
827f360
Include pricing data when creating order
Crabcyborg Mar 31, 2026
294d286
Merge branch 'master' into paypal
Crabcyborg Mar 31, 2026
5fbd6ed
Improve Apple Pay button styling
Crabcyborg Mar 31, 2026
c59663d
Merge branch 'master' into paypal
Crabcyborg Mar 31, 2026
0fd4b9e
Add event handling (not tested yet)
Crabcyborg Mar 31, 2026
9128c09
Use .append
Crabcyborg Mar 31, 2026
c228a7e
Run php cs fixer
Crabcyborg Mar 31, 2026
c8c9f99
Working on webhooks (refunds working)
Crabcyborg Apr 1, 2026
270de89
Remove some logging
Crabcyborg Apr 1, 2026
e375a1c
Actually use product name setting for product name when creating subs…
Crabcyborg Apr 1, 2026
ac17153
Working on handling cancelled subscription events
Crabcyborg Apr 2, 2026
35d3548
Work on adding the first payment row for subscriptions
Crabcyborg Apr 2, 2026
20ad8ec
Process shortcodes for product name
Crabcyborg Apr 2, 2026
e6ac1f8
Merge branch 'master' into paypal
Crabcyborg Apr 2, 2026
b238afa
Add PayPal to gateway checks for pricing fields
Crabcyborg Apr 2, 2026
a17c064
Remove old todo comment
Crabcyborg Apr 2, 2026
a5b01db
Run eslint fix
Crabcyborg Apr 2, 2026
deedbad
Run rector process and php cs fixer
Crabcyborg Apr 2, 2026
cd41741
Run phpcbf, only include Apple Pay SDK as a dependency when buttons i…
Crabcyborg Apr 2, 2026
9aee2ad
Fix indentation
Crabcyborg Apr 2, 2026
e1ba1c7
Merge branch 'master' into paypal
Crabcyborg Apr 2, 2026
06cecba
Run php cs fixer, add check for type when filtering brand name
Crabcyborg Apr 2, 2026
5735f5e
Update how the product name setting is added so it works consistently…
Crabcyborg Apr 2, 2026
7cd9a12
Remove references to location id (carried from Square logic)
Crabcyborg Apr 2, 2026
d4970c8
Use $action_control instead of $this, add nullable check for product …
Crabcyborg Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ Ags = "Ags"
unmergable = "unmergable"
# This is detected in our Stripe publishable key.
iz = "iz"
# `BA` is the ISO country code for Bosnia and Herzegovina in PayPal country lists.
BA = "BA"
# `PN` is the ISO country code for Pitcairn Islands in PayPal country lists.
PN = "PN"
# `Ot` is a substring in a PayPal sandbox token.
Ot = "Ot"
# This is used in a Sniff to reference a PHP function that does exist.
writeable = "writeable"

Expand Down
3 changes: 1 addition & 2 deletions bin/zip-plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ zip -r $zipname $destination \
-x "*/eslint-rules/*" \
-x "*/phpcs-sniffs/*" \
-x "$source/venv/*" \
-x "formidable/resources/*" \
-x "formidable/paypal/*"
-x "formidable/resources/*"

if [ ! -z "$3" ]; then
rm -rf $destination
Expand Down
29 changes: 22 additions & 7 deletions classes/controllers/FrmFormActionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ public static function register_actions() {
'email' => 'FrmEmailAction',
'wppost' => 'FrmDefPostAction',
'register' => 'FrmDefRegAction',
'paypal' => 'FrmDefPayPalAction',
'stripe' => 'FrmStripeLiteAction',
'square' => 'FrmSquareAction',
'paypal' => 'FrmPayPalLiteAction',
'paypal-legacy' => 'FrmDefPayPalLegacyAction',
'payment' => 'FrmTransLiteAction',
'quiz' => 'FrmDefQuizAction',
'quiz_outcome' => 'FrmDefQuizOutcomeAction',
Expand All @@ -83,6 +86,11 @@ public static function register_actions() {
include_once FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/email_action.php';
include_once FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/default_actions.php';

// This needs to be called after we include default_actions.php or FrmDefPayPalLegacyAction will never exist.
if ( 'FrmPayPalLiteAction' === $action_classes['paypal'] || ! class_exists( 'FrmPaymentAction' ) || ! class_exists( 'FrmDefPayPalLegacyAction' ) ) {
unset( $action_classes['paypal-legacy'] );
}

foreach ( $action_classes as $action_class ) {
self::$registered_actions->register( $action_class );
}
Expand Down Expand Up @@ -165,6 +173,18 @@ private static function maybe_add_action_to_group( $action_controls, &$groups )
* @return array
*/
public static function form_action_groups() {
$payment_actions = array(
'paypal',
'paypal-legacy',
'stripe',
'square',
'payment',
);

if ( ! class_exists( 'FrmPaymentsController' ) ) {
$payment_actions = array_diff( $payment_actions, array( 'paypal-legacy' ) );
}

$groups = array(
'misc' => array(
'name' => '',
Expand All @@ -181,10 +201,7 @@ public static function form_action_groups() {
'payment' => array(
'name' => __( 'eCommerce', 'formidable' ),
'icon' => 'frmfont frm_credit_card_alt_icon',
'actions' => array(
'paypal',
'payment',
),
'actions' => $payment_actions,
),
'marketing' => array(
'name' => __( 'Email Marketing', 'formidable' ),
Expand Down Expand Up @@ -448,8 +465,6 @@ public static function add_form_action() {
FrmAppHelper::permission_check( 'frm_edit_forms' );
check_ajax_referer( 'frm_ajax', 'nonce' );

global $frm_vars;

$action_key = FrmAppHelper::get_param( 'list_id', '', 'post', 'absint' );
$action_type = FrmAppHelper::get_param( 'type', '', 'post', 'sanitize_text_field' );

Expand Down
2 changes: 2 additions & 0 deletions classes/controllers/FrmHooksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public static function load_hooks() {
FrmTransLiteHooksController::load_hooks();
FrmStrpLiteHooksController::load_hooks();
FrmSquareLiteHooksController::load_hooks();
FrmPayPalLiteHooksController::load_hooks();

// GDPR
add_filter( 'frm_is_field_required', 'FrmFieldGdpr::force_required_field', 10, 2 );
Expand Down Expand Up @@ -219,6 +220,7 @@ public static function load_admin_hooks() {
FrmTransLiteHooksController::load_admin_hooks();
FrmStrpLiteHooksController::load_admin_hooks();
FrmSquareLiteHooksController::load_admin_hooks();
FrmPayPalLiteHooksController::load_admin_hooks();
FrmSMTPController::load_hooks();
FrmOnboardingWizardController::load_admin_hooks();
FrmAddonsController::load_admin_hooks();
Expand Down
3 changes: 2 additions & 1 deletion classes/helpers/FrmAppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3975,7 +3975,8 @@ private static function add_form_builder_modal_data( &$admin_script_strings ) {

$stripe_connected = FrmStrpLiteConnectHelper::at_least_one_mode_is_setup();
$square_connected = FrmSquareLiteConnectHelper::at_least_one_mode_is_setup();
$gateway_connected = $stripe_connected || $square_connected;
$paypal_connected = FrmPayPalLiteConnectHelper::at_least_one_mode_is_setup();
$gateway_connected = $stripe_connected || $square_connected || $paypal_connected;
$payments_settings_url = FrmStrpLiteAppController::get_payments_settings_url();

if ( ! $gateway_connected ) {
Expand Down
16 changes: 0 additions & 16 deletions classes/helpers/FrmTipsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,22 +238,6 @@ public static function get_form_action_tip() {
'tip' => __( 'Send leads to Mailchimp for instant email follow-up.', 'formidable' ),
'call' => self::cta_label(),
),
array(
'link' => array(
'content' => 'paypal-revenue',
'page' => 'paypal-increase-revenue-tip',
),
'tip' => __( 'Accept PayPal payments and grow your sales.', 'formidable' ),
'call' => self::cta_label(),
),
array(
'link' => array(
'content' => 'paypal-fast',
'page' => 'paypal-save-time-tip',
),
'tip' => __( 'Accept payments now with PayPal integration.', 'formidable' ),
'call' => self::cta_label(),
),
array(
'link' => array(
'content' => 'registration',
Expand Down
10 changes: 9 additions & 1 deletion classes/models/FrmFormAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,15 @@ public function __construct( $id_base, $name, $action_options = array(), $contro
die( 'You are not allowed to call this page directly.' );
}

$this->id_base = strtolower( $id_base );
$this->id_base = strtolower( $id_base );

/**
* @since x.x
*
* @param string $name
*/
$name = apply_filters( 'frm_' . $id_base . '_action_name', $name );

$this->name = $name;
$this->option_name = 'frm_' . $this->id_base . '_action';

Expand Down
9 changes: 8 additions & 1 deletion classes/models/fields/FrmFieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,14 @@ public function get_options( $values ) {
* @return void
*/
public function show_field( $args ) {
if ( apply_filters( 'frm_show_normal_field_type', $this->normal_field, $this->type ) ) {
/**
* @since x.x Added $field parameter.
*
* @param bool $show_normal_field_type
* @param string $type
* @param array $field
*/
if ( apply_filters( 'frm_show_normal_field_type', $this->normal_field, $this->type, $this->field ) ) {
echo $this->prepare_field_html( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
do_action( 'frm_show_other_field_type', $this->field, $args['form'], array( 'action' => $args['form_action'] ) );
Expand Down
4 changes: 2 additions & 2 deletions classes/views/frm-fields/back-end/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}

if ( $field['type'] === 'credit_card' && ! FrmAppHelper::pro_is_installed() ) {
if ( ! FrmStrpLiteConnectHelper::at_least_one_mode_is_setup() && ! FrmSquareLiteConnectHelper::at_least_one_mode_is_setup() ) {
if ( ! FrmStrpLiteConnectHelper::at_least_one_mode_is_setup() && ! FrmSquareLiteConnectHelper::at_least_one_mode_is_setup() && ! FrmPayPalLiteConnectHelper::at_least_one_mode_is_setup() ) {
FrmStrpLiteAppHelper::not_connected_warning();
} elseif ( ! FrmTransLiteActionsController::get_actions_for_form( $field['form_id'] ) ) {
?>
Expand All @@ -44,7 +44,7 @@
<span>
<?php
/* translators: %1$s: Link HTML, %2$s: End link */
printf( esc_html__( 'Credit Cards will not work without %1$sadding a Collect Payment action%2$s.', 'formidable' ), '<a href="?page=formidable&frm_action=settings&id=' . absint( $field['form_id'] ) . '&t=email_settings" target="_blank">', '</a>' );
printf( esc_html__( 'Credit Cards will not work without %1$sadding a Stripe, Square, or PayPal action%2$s.', 'formidable' ), '<a href="?page=formidable&frm_action=settings&id=' . absint( $field['form_id'] ) . '&t=email_settings" target="_blank">', '</a>' );
?>
</span>
</div>
Expand Down
9 changes: 8 additions & 1 deletion classes/views/frm-form-actions/_action_icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
if ( ! defined( 'ABSPATH' ) ) {
die( 'You are not allowed to call this page directly.' );
}

$limit = $action_control->action_options['limit'];

if ( 'paypal' === $action_control->id_base ) {
// The PayPal add-on may overwrite this so change it back.
$limit = 1;
}
?>
<li class="frm-action <?php echo esc_attr( $group_class . ( isset( $data['data-upgrade'] ) ? ' frm-not-installed' : '' ) ); ?>">
<a href="javascript:void(0)" class="<?php echo esc_attr( $classes ); ?>"
data-limit="<?php echo esc_attr( $action_control->action_options['limit'] ); ?>"
data-limit="<?php echo esc_attr( $limit ); ?>"
data-actiontype="<?php echo esc_attr( $action_control->id_base ); ?>"
<?php FrmAppHelper::array_to_html_params( $data, true ); ?>
>
Expand Down
44 changes: 41 additions & 3 deletions classes/views/frm-form-actions/default_actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,53 @@
/**
* Add paypal action.
*/
class FrmDefPayPalAction extends FrmFormAction {
class FrmPayPalLiteAction extends FrmFormAction {
public function __construct() {
$action_ops = FrmFormAction::default_action_opts( 'frm_paypal_icon frm-inverse frm_show_upgrade' );
$action_ops['color'] = 'var(--primary-700)';
$action_ops = array(
'classes' => 'frmfont frm_paypal_icon frm-inverse',
'color' => 'var(--primary-700)',
);

parent::__construct( 'paypal', 'PayPal', $action_ops );
}
}

/**
* Add paypal legacy action.
*/
if ( class_exists( 'FrmPaymentAction' ) ) {
class FrmDefPayPalLegacyAction extends FrmPaymentAction {
public function __construct() {
parent::__construct();

Check failure on line 50 in classes/views/frm-form-actions/default_actions.php

View workflow job for this annotation

GitHub Actions / PHPStan

FrmDefPayPalLegacyAction::__construct() calls parent::__construct() but FrmDefPayPalLegacyAction does not extend any class.

$this->id_base = 'paypal-legacy';
$this->name = 'PayPal (Legacy)';
}
}
}

class FrmStripeLiteAction extends FrmFormAction {
public function __construct() {
$action_ops = array(
'classes' => 'frmfont frm_stripe_icon frm-inverse',
'color' => '#635bff',
);

parent::__construct( 'stripe', 'Stripe', $action_ops );
}
}

class FrmSquareAction extends FrmFormAction {
public function __construct() {
$action_ops = array(
'classes' => 'frmfont frm_square_icon frm-inverse',
'color' => '#000',
);

parent::__construct( 'square', 'Square', $action_ops );
}
}

/**
* Add quiz action.
*/
Expand Down
2 changes: 1 addition & 1 deletion css/custom_theme.css.php
Original file line number Diff line number Diff line change
Expand Up @@ -1669,6 +1669,6 @@
.frm-card-errors:empty {
margin: 0;
}
<?php

<?php
echo strip_tags( FrmStylesController::get_custom_css() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2 changes: 1 addition & 1 deletion css/frm_admin.css

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ export default [
expect: 'readonly',
assert: 'readonly',
chai: 'readonly',
// Used for Google Pay payments in PayPal Commerce frontend JS.
google: 'readonly'
},
},
plugins: {
Expand Down
30 changes: 8 additions & 22 deletions formidable.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,33 +108,19 @@ function frm_class_autoloader( $class_name, $filepath ) {
return;
}

$filepath = $original_filepath;

if ( preg_match( '/^FrmStrpLite.+$/', $class_name ) || preg_match( '/^FrmTransLite.+$/', $class_name ) ) {
// Autoload for /stripe/ folder.
$filepath = $original_filepath . '/stripe/';

if ( preg_match( '/^.+Helper$/', $class_name ) ) {
$filepath .= 'helpers/';
} elseif ( preg_match( '/^.+Controller$/', $class_name ) ) {
$filepath .= 'controllers/';
} else {
$filepath .= 'models/';
}

$filepath .= $class_name . '.php';

if ( file_exists( $filepath ) ) {
require $filepath;
}

return;
}

if ( ! preg_match( '/^FrmSquareLite.+$/', $class_name ) ) {
$filepath .= '/stripe/';
} elseif ( preg_match( '/^FrmSquareLite.+$/', $class_name ) ) {
$filepath .= '/square/';
} elseif ( preg_match( '/^FrmPayPalLite.+$/', $class_name ) ) {
$filepath .= '/paypal/';
} else {
return;
}

$filepath = $original_filepath . '/square/';

if ( preg_match( '/^.+Helper$/', $class_name ) ) {
$filepath .= 'helpers/';
} elseif ( preg_match( '/^.+Controller$/', $class_name ) ) {
Expand Down
2 changes: 1 addition & 1 deletion js/formidable_admin.js

Large diffs are not rendered by default.

Loading
Loading