Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,7 @@ composer.phar
composer.lock

# Build
build.sh
build.sh

# Claude Code
.claude
32 changes: 32 additions & 0 deletions assets/js/payment-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,38 @@ jQuery(function ($) {
}
});

// Authorize.net ACH/Card payment type toggle.
this.form.on('change', '.getpaid-authorizenet-payment-type-selector input[type="radio"]', function () {
var paymentType = $(this).val();
var container = $(this).closest('.getpaid-gateway-description');

if (paymentType === 'ach') {
container.find('.getpaid-authorizenet-cc-section').hide();
container.find('.getpaid-authorizenet-ach-section').show();
} else {
container.find('.getpaid-authorizenet-cc-section').show();
container.find('.getpaid-authorizenet-ach-section').hide();
}
});

// Format ACH routing number on input (9 digits only).
this.form.on('input', '.getpaid-ach-routing-number', function () {
var input = $(this);
var value = input.val().replace(/\D/g, '').substring(0, 9);
if (input.val() !== value) {
input.val(value);
}
});

// Format ACH account number on input (17 digits max).
this.form.on('input', '.getpaid-ach-account-number', function () {
var input = $(this);
var value = input.val().replace(/\D/g, '').substring(0, 17);
if (input.val() !== value) {
input.val(value);
}
});

// Discounts.
if (this.form.find('.getpaid-discount-field').length) {

Expand Down
2 changes: 1 addition & 1 deletion assets/js/payment-forms.min.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions includes/admin/class-getpaid-anonymization-logs.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public function display_logs() {
<?php
$months = $this->get_log_months();
foreach ( $months as $month ) {
$selected = ( isset( $_GET['m'] ) && $_GET['m'] == $month->month ) ? ' selected="selected"' : '';
echo '<option value="' . esc_attr( $month->month ) . '"' . $selected . '>' . esc_html( $month->month_name . ' ' . $month->year ) . '</option>';
$selected = ( isset( $_GET['m'] ) && $_GET['m'] == $month->year_month ) ? ' selected="selected"' : '';
echo '<option value="' . esc_attr( $month->year_month ) . '"' . $selected . '>' . esc_html( $month->month_name . ' ' . $month->year ) . '</option>';
}
?>
</select>
Expand Down Expand Up @@ -193,14 +193,14 @@ private function get_log_months() {
global $wpdb;
$table_name = $wpdb->prefix . 'getpaid_anonymization_logs';

$months = $wpdb->get_results(
"SELECT DISTINCT YEAR(timestamp) AS year, MONTH(timestamp) AS month,
DATE_FORMAT(timestamp, '%M') AS month_name,
DATE_FORMAT(timestamp, '%Y%m') AS month
return $wpdb->get_results(
"SELECT DISTINCT
YEAR(timestamp) AS year,
MONTH(timestamp) AS month_num,
DATE_FORMAT(timestamp, '%M') AS month_name,
DATE_FORMAT(timestamp, '%Y%m') AS year_month
FROM $table_name
ORDER BY year DESC, month DESC"
ORDER BY year DESC, month_num DESC"
);

return $months;
}
}
Loading