Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
191 commits
Select commit Hold shift + click to select a range
1eb7584
First square commit (copied from Stripe files)
Crabcyborg Jan 23, 2025
2fbf9b6
Merge branch 'master' into square
Crabcyborg Jan 28, 2025
7357138
Merge branch 'master' into square
Crabcyborg Jan 28, 2025
0cf0543
Start loading scripts
Crabcyborg Jan 28, 2025
ca7b462
Adding some basic square JS
Crabcyborg Jan 28, 2025
69f1b9b
Send the token/verification tokens as form inputs and submit form
Crabcyborg Jan 28, 2025
72bd0e8
Pass the event, remove test code
Crabcyborg Jan 28, 2025
1df1ab4
Clean up
Crabcyborg Jan 28, 2025
0be809c
Update comments
Crabcyborg Jan 28, 2025
94e1d58
Merge branch 'master' into square
Crabcyborg Feb 3, 2025
ecf7cf0
Merge branch 'master' into square
Crabcyborg Feb 13, 2025
34f183a
Add gateways filter and radio button options for selecting gateway
Crabcyborg Feb 27, 2025
233125b
Conditionally show/hide the capture setting when Square is toggled
Crabcyborg Feb 27, 2025
28aeca1
New squareCardElementIsComplete var
Crabcyborg Feb 27, 2025
9e4a5a4
Enable / disable the submit button based on the square element state
Crabcyborg Feb 27, 2025
f3778e3
Run lint fix
Crabcyborg Feb 27, 2025
b55c669
Merge branch 'master' into square
Crabcyborg Mar 17, 2025
58cf8a1
Prevent form from submitting, clean up
Crabcyborg Mar 17, 2025
b325999
Drop the other square test button
Crabcyborg Mar 17, 2025
010d58f
Clean up more
Crabcyborg Mar 17, 2025
93fd9a6
Clean up
Crabcyborg Mar 18, 2025
679d421
Add some comments
Crabcyborg Mar 18, 2025
8077453
Stop using the example square IDs. Use formidable card elements like …
Crabcyborg Mar 21, 2025
579025e
Remove old code
Crabcyborg Mar 21, 2025
b459353
Start working on oauth
Crabcyborg Mar 21, 2025
a68307c
Start working on oauth
Crabcyborg Mar 21, 2025
1a9bb7d
Set up the oauth/api flow
Crabcyborg Apr 3, 2025
4256121
Rename option
Crabcyborg Apr 3, 2025
8f36fb0
Hard code live mode in a few places for now. Show connected when ther…
Crabcyborg Apr 3, 2025
6db04b4
Set up some code for creating payments
Crabcyborg Apr 3, 2025
ed17f17
Show error
Crabcyborg Apr 3, 2025
23092d1
Merge branch 'master' into square
Crabcyborg Apr 3, 2025
55ae36a
Merge branch 'master' into square
Crabcyborg Apr 9, 2025
e6c94a2
Merge branch 'master' into square
Crabcyborg Apr 9, 2025
8afc2a0
Add square test mode checkbox, add cards for mode square modes (incom…
Crabcyborg Apr 10, 2025
5f540aa
Show the test mode in a table like in Stripe, give connect button a c…
Crabcyborg Apr 10, 2025
de15644
Fix mode check
Crabcyborg Apr 10, 2025
0fb0f72
Get payment routing mostly working
Crabcyborg Apr 10, 2025
c25dda4
Add the payment record into the DB with the charge ID and status
Crabcyborg Apr 11, 2025
9a46206
Define the location ID and app ID in global vars based on the active …
Crabcyborg Apr 11, 2025
a250533
Pull the verification details into a PHP fetch request
Crabcyborg Apr 11, 2025
6d6ccf5
Properly route the settings for addreses and emails
Crabcyborg Apr 11, 2025
4599bd3
Merge branch 'master' into square
Crabcyborg Apr 24, 2025
3c464ed
Capitalize the Square gateway
Crabcyborg Apr 24, 2025
bd8cdbe
Get refunds working
Crabcyborg Apr 24, 2025
e3774db
Add todo comment
Crabcyborg Apr 24, 2025
e0bdd6b
Working on subscriptions (wip)
Crabcyborg Apr 24, 2025
6ff87d3
More work on subscriptions (wip)
Crabcyborg Apr 25, 2025
ab4692d
Merge branch 'master' into square
Crabcyborg Apr 25, 2025
6c53895
Add new square.scss
Crabcyborg Apr 25, 2025
ff89fb3
Merge branch 'master' into square
Crabcyborg Apr 28, 2025
c554e89
Start trying to match the field styles
Crabcyborg Apr 28, 2025
778893e
Merge branch 'master' into square
Crabcyborg Apr 28, 2025
f5b7ae2
Also add border radius and focus border color, and a filter
Crabcyborg Apr 28, 2025
48c984a
Also add font family
Crabcyborg Apr 28, 2025
86ea471
Merge branch 'master' into square
Crabcyborg Apr 30, 2025
9d23915
Merge branch 'master' into square
Crabcyborg May 1, 2025
e7358e3
Continue to work on subscriptions
Crabcyborg May 1, 2025
f9a9211
Check the subscription request response and return true
Crabcyborg May 1, 2025
0075b2d
Do not load square scripts if Square is not the selected gateway
Crabcyborg May 2, 2025
309f899
New maybe show card function to fix an issue with loading Stripe cards
Crabcyborg May 2, 2025
df48e34
Add backward compatibility check
Crabcyborg May 2, 2025
447786e
Merge branch 'master' into square
Crabcyborg May 5, 2025
0c20311
Merge master
Crabcyborg May 5, 2025
7db4d82
Merge branch 'master' into square
Crabcyborg May 7, 2025
a97723c
Merge branch 'antispam-improvements' into square
Crabcyborg May 7, 2025
206bf03
Merge branch 'antispam-improvements' into square
Crabcyborg May 7, 2025
2547d88
Run the show card hook for square after Stripe, add a field ID match …
Crabcyborg May 7, 2025
b477146
Move before save action settings to the trans actions controller and …
Crabcyborg May 7, 2025
b183de4
Merge branch 'master' into square
Crabcyborg May 12, 2025
908c9c0
Fix issue with repeat setting
Crabcyborg May 12, 2025
f701ac1
Small improvements to settings
Crabcyborg May 12, 2025
2433c5d
Merge branch 'master' into square
Crabcyborg May 21, 2025
6a8f240
Add subscriptions into the database
Crabcyborg May 21, 2025
2597200
Working on event handling
Crabcyborg May 21, 2025
bf8a442
Start getting the subscription ID for a given payment
Crabcyborg May 21, 2025
813978c
Working on webhooks (wip)
Crabcyborg May 22, 2025
5a779a4
Merge branch 'master' into square
Crabcyborg May 22, 2025
cb3a631
Get cancelling a subscription working
Crabcyborg May 22, 2025
a75efc8
Work on adding the subscription payment to the db when handling an event
Crabcyborg May 22, 2025
4456377
Making progress with webhooks
Crabcyborg May 22, 2025
8607e09
Add comments, start working on handling a deactivated subscription event
Crabcyborg May 22, 2025
8679e2c
Make disconnecting functional
Crabcyborg May 23, 2025
8365960
Remove old comment
Crabcyborg May 23, 2025
bd6969e
Add typos exception
Crabcyborg May 23, 2025
64d21e1
Add default case to avoid undefined $canceled case
Crabcyborg May 23, 2025
e4360bb
Add default case to avoid undefined $refunded case
Crabcyborg May 23, 2025
927dcf2
Move some code
Crabcyborg May 23, 2025
99fac02
Fix typo exception
Crabcyborg May 23, 2025
ef1faa8
Specify square as a psalm dir
Crabcyborg May 23, 2025
eb4ee12
Add some psalm exceptions for square
Crabcyborg May 23, 2025
988a41a
Fix exception for typo in wrong place
Crabcyborg May 23, 2025
34079b4
Add a missing stub
Crabcyborg May 23, 2025
cd44bbf
Drop extra function
Crabcyborg May 23, 2025
a7a18c2
Fix broken stubs file
Crabcyborg May 23, 2025
919be3a
Match types better
Crabcyborg May 23, 2025
776dd00
Add missing var
Crabcyborg May 23, 2025
1c70dd1
Update Psalm exceptions, add array check
Crabcyborg May 23, 2025
be6fa26
Fix psalm exception for wrong class
Crabcyborg May 23, 2025
bd522f9
Update comments
Crabcyborg May 23, 2025
bef4204
Deprecate unused Stripe function
Crabcyborg May 23, 2025
99a78ee
Fix wrong textdomain
Crabcyborg May 23, 2025
587c455
Code styling fixes
Crabcyborg May 23, 2025
9b46190
Code styling fixes
Crabcyborg May 23, 2025
a193637
Drop extra semi colon
Crabcyborg May 23, 2025
d1216de
Code styling fixes
Crabcyborg May 23, 2025
ac86e09
Specify the live URL
Crabcyborg May 23, 2025
ad3b0f7
Update comments
Crabcyborg May 23, 2025
c30c982
Code styling fixes
Crabcyborg May 23, 2025
b004bad
Clean up
Crabcyborg May 23, 2025
9870984
Ignore nonce when making square payments
Crabcyborg May 23, 2025
5d8a39c
Drop type comments to prevent full stop issue
Crabcyborg May 23, 2025
a53cd87
Add full stop
Crabcyborg May 23, 2025
87af321
Break up long line
Crabcyborg May 23, 2025
65d7f67
Break up another long line
Crabcyborg May 23, 2025
121ac5e
Add param comments
Crabcyborg May 23, 2025
f9a853a
Change Stripe mention to Square
Crabcyborg May 23, 2025
6d9cf4c
Ignore long line
Crabcyborg May 23, 2025
a27c559
Use trialDays for more consistent case
Crabcyborg May 26, 2025
8070375
Fix hook not working when saving actions, sync merchant currency when…
Crabcyborg May 26, 2025
6d578e6
Add square fee education and update the warning when using a payment …
Crabcyborg May 26, 2025
564f4ba
Add location ID and currency as options to avoid too many requests to…
Crabcyborg May 26, 2025
2d8c272
Remove old todo comment
Crabcyborg May 26, 2025
e468935
Update some in-plugin warnings when Stripe is not set up but Square i…
Crabcyborg May 26, 2025
d3c2917
Show the error message from Square
Crabcyborg May 26, 2025
282c4ee
Remove mention of live context when showing ssl warning for Square
Crabcyborg May 26, 2025
7b07b9d
Prevent default when clicking connect button
Crabcyborg May 27, 2025
2ad9bee
Fix bug with disconnecting Square
Crabcyborg May 27, 2025
b94b25c
Trigger actions that send on payment success
Crabcyborg May 27, 2025
a269ed7
Add todo comment
Crabcyborg May 27, 2025
bc74360
Add JPY check
Crabcyborg May 27, 2025
6918524
Stop using dev site, use QA
Crabcyborg May 27, 2025
5a47619
Always include the processor column
Crabcyborg May 27, 2025
e440125
Stop redirecting to /wp-admin/false on error
Crabcyborg May 28, 2025
6d52c94
Pass description when creating a one time payment
Crabcyborg May 28, 2025
7a77fa8
Merge branch 'master' into square
Crabcyborg May 30, 2025
d4d3b0f
Work on improving compatibility with the Stripe add-on
Crabcyborg May 30, 2025
090ca45
Merge branch 'master' into square
Crabcyborg May 30, 2025
c248e03
Merge branch 'master' into square
Crabcyborg Jun 5, 2025
831b6f1
Add the functions for verifying a Lite site
Crabcyborg Jun 5, 2025
e887a03
Conditionally toggle the fee education based on the selected gateway
Crabcyborg Jun 5, 2025
63af5e6
Add more checks before loading Stripe Lite scripts, load the Square s…
Crabcyborg Jun 5, 2025
ebfb591
Fix square script loading issue
Crabcyborg Jun 5, 2025
3a7cda8
Improve compatibility with a multi-page form
Crabcyborg Jun 5, 2025
8597bee
Init square on AJAX page change as well
Crabcyborg Jun 5, 2025
dbdee47
Update comment
Crabcyborg Jun 5, 2025
74a606b
Fix equals alignment
Crabcyborg Jun 5, 2025
eb2de31
Fix long line issue
Crabcyborg Jun 5, 2025
476a587
Merge branch 'master' into square
Crabcyborg Jun 6, 2025
661da95
Remove some of the bottom margin from the Square payment field
Crabcyborg Jun 6, 2025
258833f
Add a get subscription endpoint and use it to determine the payment b…
Crabcyborg Jun 6, 2025
90f8955
Replace shortcodes in subscription description
Crabcyborg Jun 9, 2025
8ecc439
Add a pop-up with instructions when connecting to Sandbox to help peo…
Crabcyborg Jun 9, 2025
c4a0a77
Fix spaces to tabs
Crabcyborg Jun 9, 2025
d9b04b6
Cancel subscription on deactivated status
Crabcyborg Jun 9, 2025
1886fa7
Trigger events that trigger on successful payment in events controller
Crabcyborg Jun 9, 2025
7953771
Update next billing date in webhooks
Crabcyborg Jun 9, 2025
62fda82
Show the latest error on subscription create fail
Crabcyborg Jun 9, 2025
689d6a8
Merge branch 'master' into square
Crabcyborg Jun 9, 2025
89a78ca
Fix issue with getting subscription, update how the payment is updated
Crabcyborg Jun 9, 2025
7d64610
Continue cron loop if there is no payment for sub
Crabcyborg Jun 9, 2025
a9520fc
Add gateway check before loading Square scripts
Crabcyborg Jun 10, 2025
ca54c60
Use API site
Crabcyborg Jun 10, 2025
2aed36f
Psalm tweaks
Crabcyborg Jun 10, 2025
5049fc0
Make a line less long
Crabcyborg Jun 10, 2025
8597c1a
Use fewer PHP open/close tags
Crabcyborg Jun 10, 2025
cb8ca32
Fix a long line issue
Crabcyborg Jun 10, 2025
d0958ab
Fix invalid psalm xml
Crabcyborg Jun 10, 2025
9596b98
Remove old todo comment
Crabcyborg Jun 10, 2025
d2a2f64
Use safe redirect
Crabcyborg Jun 10, 2025
05de015
Use safe redirect for Stripe too
Crabcyborg Jun 10, 2025
c57f5b4
Use number format
Crabcyborg Jun 10, 2025
58c78f0
Merge branch 'master' into square
Crabcyborg Jun 10, 2025
9479689
Merge branch 'master' into square
Crabcyborg Jun 10, 2025
df5ad15
Merge branch 'master' into square
Crabcyborg Jun 11, 2025
90f78eb
Clean up front end JS
Crabcyborg Jun 11, 2025
771dd44
Stop using unique ID for square front end JS plugin version
Crabcyborg Jun 11, 2025
9037711
Update comment reference to Stripe
Crabcyborg Jun 11, 2025
1c2aeed
Use console.error instead of throwing an error when Square is not ava…
Crabcyborg Jun 11, 2025
fdff244
Fix bug with required credit card validation
Crabcyborg Jun 11, 2025
96d3a0b
Add repeat cadence dynamically with JS
Crabcyborg Jun 11, 2025
79ba166
Fix bug when changing gateways
Crabcyborg Jun 11, 2025
83f7032
Only show the capture option for a Stripe payment, fix issues with re…
Crabcyborg Jun 11, 2025
6881913
Fix issues with both repeat options appearing after toggling type
Crabcyborg Jun 11, 2025
091dfde
Default to USD instead of AUD when enabling again
Crabcyborg Jun 11, 2025
074b4b4
Add a check for type before removing display style
Crabcyborg Jun 11, 2025
4b43253
Add nullable check
Crabcyborg Jun 11, 2025
3275eb9
Add nullable check for repeat cadence
Crabcyborg Jun 11, 2025
8cec3d7
Use the correct interval count/interval type when creating a square s…
Crabcyborg Jun 11, 2025
0d0cfa8
phpcs fixes
Crabcyborg Jun 11, 2025
ff1c030
Remove some whitespace
Crabcyborg Jun 11, 2025
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
4 changes: 4 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,9 @@ atributes = "atributes"
# fo is used for the Faroese locale. It is not a typo.
# fo is also used for a table alias in SQL queries.
fo = "fo"
# `Ags` should be `Ages`, `Tags` in sandbox token
Ags = "Ags"

[default.extend-identifiers]
66afe9 = "66afe9"

2 changes: 2 additions & 0 deletions classes/controllers/FrmHooksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@

FrmTransLiteHooksController::load_hooks();
FrmStrpLiteHooksController::load_hooks();
FrmSquareLiteHooksController::load_hooks();

Check warning on line 117 in classes/controllers/FrmHooksController.php

View check run for this annotation

Codecov / codecov/patch

classes/controllers/FrmHooksController.php#L117

Added line #L117 was not covered by tests
Comment thread
Crabcyborg marked this conversation as resolved.

// GDPR
add_filter( 'frm_is_field_required', 'FrmFieldGdpr::force_required_field', 10, 2 );
Expand Down Expand Up @@ -206,6 +207,7 @@
FrmDashboardController::load_admin_hooks();
FrmTransLiteHooksController::load_admin_hooks();
FrmStrpLiteHooksController::load_admin_hooks();
FrmSquareLiteHooksController::load_admin_hooks();
FrmSMTPController::load_hooks();
FrmOnboardingWizardController::load_admin_hooks();
FrmAddonsController::load_admin_hooks();
Expand Down
3 changes: 1 addition & 2 deletions classes/views/frm-fields/back-end/field-credit-card.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
if ( ! defined( 'ABSPATH' ) ) {
die( 'You are not allowed to call this page directly.' );
}

if ( ! FrmStrpLiteConnectHelper::at_least_one_mode_is_setup() || ! FrmTransLiteActionsController::get_actions_for_form( $field['form_id'] ) ) {
if ( ( ! FrmStrpLiteConnectHelper::at_least_one_mode_is_setup() && ! FrmSquareLiteConnectHelper::at_least_one_mode_is_setup() ) || ! FrmTransLiteActionsController::get_actions_for_form( $field['form_id'] ) ) {
?>
<span class="frm-with-icon frm-not-set frm_note_style">
<?php FrmAppHelper::icon_by_class( 'frm_icon_font frm_report_problem_solid_icon' ); ?>
Expand Down
2 changes: 1 addition & 1 deletion classes/views/frm-fields/back-end/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<?php
}
if ( $field['type'] === 'credit_card' && ! FrmAppHelper::pro_is_installed() ) {
if ( ! FrmStrpLiteConnectHelper::at_least_one_mode_is_setup() ) {
if ( ! FrmStrpLiteConnectHelper::at_least_one_mode_is_setup() && ! FrmSquareLiteConnectHelper::at_least_one_mode_is_setup() ) {
FrmStrpLiteAppHelper::not_connected_warning();
} elseif ( ! FrmTransLiteActionsController::get_actions_for_form( $field['form_id'] ) ) {
?>
Expand Down
7 changes: 7 additions & 0 deletions css/custom_theme.css.php
Original file line number Diff line number Diff line change
Expand Up @@ -1638,6 +1638,13 @@
width:100%;
}
}

.frm-card-element .sq-card-wrapper .sq-card-message {
margin-bottom: 0;
}
.frm-card-errors:empty {
margin: 0;
}
<?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.

44 changes: 30 additions & 14 deletions formidable.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,25 +107,41 @@
return;
}

if ( ! preg_match( '/^FrmStrpLite.+$/', $class_name ) && ! preg_match( '/^FrmTransLite.+$/', $class_name ) ) {
// Exit early if the class does not match the Stripe Lite prefix.
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/';

Check warning on line 114 in formidable.php

View check run for this annotation

Codecov / codecov/patch

formidable.php#L114

Added line #L114 was not covered by tests
} elseif ( preg_match( '/^.+Controller$/', $class_name ) ) {
$filepath .= 'controllers/';
} else {
$filepath .= 'models/';

Check warning on line 118 in formidable.php

View check run for this annotation

Codecov / codecov/patch

formidable.php#L118

Added line #L118 was not covered by tests
}

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

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

return;
}

// 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/';
}
if ( preg_match( '/^FrmSquareLite.+$/', $class_name ) ) {
$filepath = $original_filepath . '/square/';
if ( preg_match( '/^.+Helper$/', $class_name ) ) {
$filepath .= 'helpers/';
} elseif ( preg_match( '/^.+Controller$/', $class_name ) ) {
$filepath .= 'controllers/';

Check warning on line 135 in formidable.php

View check run for this annotation

Codecov / codecov/patch

formidable.php#L131-L135

Added lines #L131 - L135 were not covered by tests
} else {
$filepath .= 'models/';

Check warning on line 137 in formidable.php

View check run for this annotation

Codecov / codecov/patch

formidable.php#L137

Added line #L137 was not covered by tests
}

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

Check warning on line 140 in formidable.php

View check run for this annotation

Codecov / codecov/patch

formidable.php#L140

Added line #L140 was not covered by tests

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

Check warning on line 143 in formidable.php

View check run for this annotation

Codecov / codecov/patch

formidable.php#L142-L143

Added lines #L142 - L143 were not covered by tests
}
}
}

Expand Down
1 change: 1 addition & 0 deletions images/icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading