Skip to content
Draft
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
20 changes: 4 additions & 16 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
MIT License
Satispay for WooCommerce is licensed under the GNU General Public License v2.0 or later.

Copyright (c) 2018-present Satispay <business@satispay.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1 change: 1 addition & 0 deletions assets/js/blocks/satispay-badge/index.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '6da0e404000f0a37c335');
1 change: 1 addition & 0 deletions assets/js/blocks/satispay-badge/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/frontend/blocks.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'), 'version' => 'd5aae4311c3954d25225');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-html-entities', 'wp-i18n'), 'version' => '0b893e738227415030c3');
2 changes: 1 addition & 1 deletion assets/js/frontend/blocks.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions blocks/satispay-badge/block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "woo-satispay/payment-badge",
"title": "Satispay Payment Methods",
"category": "woocommerce",
"description": "Display Satispay as an accepted payment method, with logo and optional label.",
"keywords": [ "satispay", "payment", "badge", "logo", "accepted" ],
"textdomain": "woo-satispay",
"editorScript": "woo-satispay-payment-badge-editor",
"render": "file:./render.php",
"example": {
"attributes": {
"label": "We accept Satispay",
"showLabel": true,
"inlineContent": false,
"textAlign": "left",
"logoWidth": 60
}
},
"attributes": {
"label": {
"type": "string",
"default": "We accept Satispay"
},
"showLabel": {
"type": "boolean",
"default": true
},
"inlineContent": {
"type": "boolean",
"default": false
},
"textAlign": {
"type": "string",
"default": "left"
},
"logoWidth": {
"type": "number",
"default": 60
}
},
"supports": {
"html": false,
"color": {
"background": true,
"text": true
},
"spacing": {
"margin": true,
"padding": true
},
"typography": {
"fontSize": true
}
}
}

48 changes: 48 additions & 0 deletions blocks/satispay-badge/render.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/**
* Render template for the "Satispay Payment Methods" block.
*
* @var array $attributes Block attributes.
* @var string $content Inner content (unused – no innerBlocks).
* @var WP_Block $block Block instance.
*/

$label = isset( $attributes['label'] ) ? $attributes['label'] : __( 'We accept Satispay', 'woo-satispay' );
$show_label = isset( $attributes['showLabel'] ) ? (bool) $attributes['showLabel'] : true;
$inline_content = isset( $attributes['inlineContent'] ) ? (bool) $attributes['inlineContent'] : false;
$text_align = isset( $attributes['textAlign'] ) ? $attributes['textAlign'] : 'left';
$text_align = in_array( $text_align, array( 'left', 'center', 'right' ), true ) ? $text_align : 'left';
$logo_width = isset( $attributes['logoWidth'] ) ? absint( $attributes['logoWidth'] ) : 60;
$logo_width = min( max( $logo_width, 40 ), 400 );

$main_plugin_file = defined( 'WC_SATISPAY_MAIN_FILE' ) ? WC_SATISPAY_MAIN_FILE : dirname( __DIR__, 2 ) . '/woo-satispay.php';
$logo_url = plugins_url( 'logo.svg', $main_plugin_file );

$inline_style = 'text-align:' . esc_attr( $text_align ) . ';';
$content_style = $inline_content
? 'display:inline-flex;align-items:center;gap:8px;text-align:left;'
: 'display:inline-block;';

$wrapper_attributes = get_block_wrapper_attributes( [
'class' => 'woo-satispay-payment-badge',
'style' => $inline_style,
] );
?>
<div <?php echo $wrapper_attributes; ?>>
<div class="woo-satispay-payment-badge__content" style="<?php echo esc_attr( $content_style ); ?>">
<img
src="<?php echo esc_url( $logo_url ); ?>"
alt="<?php esc_attr_e( 'Satispay', 'woo-satispay' ); ?>"
class="woo-satispay-payment-badge__logo"
loading="lazy"
decoding="async"
style="width: <?php echo esc_attr( $logo_width ); ?>px; height: auto; display: <?php echo esc_attr( $inline_content ? 'inline-block' : 'block' ); ?>;"
/>
<?php if ( $show_label && '' !== $label ) : ?>
<p class="woo-satispay-payment-badge__label" style="margin: <?php echo esc_attr( $inline_content ? '0' : '8px 0 0' ); ?>;"><?php echo esc_html( $label ); ?></p>
<?php endif; ?>
</div>
</div>



43 changes: 43 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
*** Satispay for WooCommerce Changelog ***

2026-04-21 - version 3.0.0
* Added compatibility with WooCommerce 10.6.1
* Updated deprecated functions and properties (WC_Order, WC_Cart, etc.)
* Fixed hook registration for available payment gateways
* Improved security with wp_safe_redirect
* Defined WC_SATISPAY_VERSION constant for better version management
* Updated license to GPLv2 or later for Marketplace compliance
* Implemented Store API security hardening for guest checkout
* Added visible EUR-only warnings in checkout and Blocks, plus authoritative server-side validation, without hiding Satispay
* Added input sanitization for all S2S callback parameters
* Removed direct usage of $_GET for improved security and WordPress compliance
* Added a dedicated late capture gateway setting
* Added clickable Satispay transaction links in WooCommerce order details
* Added staging/live dashboard transaction URL support for new Satispay orders
* Persisted the Satispay order environment to keep transaction links stable across configuration changes
* Fixed the sandbox account URL in gateway settings
* Detected and stored Satispay BNPL payments from payment API callbacks
* Detected and stored Satispay fringe benefits payments, including the fringe amount used
* Displayed Satispay BNPL and fringe benefits details in WooCommerce order pages and admin orders
* Added "Satispay Payment Methods" Gutenberg block for displaying Satispay logo and label in block-based areas (footers, pages)
* Restored cart contents when customer cancels payment on Satispay redirect (classic and block checkout)
* Cleared cart snapshot session data after successful payment
* Fixed admin error notices using WC_Admin_Settings::add_error() instead of raw echo
* Prevented invalid activation code from being saved on authentication failure
* Fixed PHP warning on missing checkbox POST data in process_admin_options
* Skipped unnecessary API call in admin_options when no credentials are configured
* Separated admin method_description from customer-facing checkout description
* Declared cart_checkout_blocks feature compatibility
* Added "Check Satispay payment status" order action for manual payment sync from admin

2026-03-31 - version 2.2.9
* Updated compatibility to WP-6.9

2026-03-25 - version 2.2.8
* Guidelines improvement

2026-03-15 - version 2.2.7
* Updated compatibility to WP-6.8.1

2026-02-28 - version 2.2.6
* Updated compatibility to WP-6.6.0
21 changes: 15 additions & 6 deletions includes/blocks/wc-satispay-blocks.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php
use Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType;
use Automattic\WooCommerce\Blocks\Payments\PaymentResult;
use Automattic\WooCommerce\Blocks\Payments\PaymentContext;

defined( 'ABSPATH' ) || exit;

Expand Down Expand Up @@ -50,7 +48,7 @@ public function get_payment_method_script_handles() {
? require( $script_asset_path )
: array(
'dependencies' => array(),
'version' => '1.2.0'
'version' => WC_SATISPAY_VERSION
);
$script_url = WC_Satispay::plugin_url() . $script_path;

Expand All @@ -63,7 +61,7 @@ public function get_payment_method_script_handles() {
);

if ( function_exists( 'wp_set_script_translations' ) ) {
wp_set_script_translations( 'wc-satispay-payments-blocks', 'woo-satispay', WC_Satispay::plugin_abspath());
wp_set_script_translations( 'wc-satispay-payments-blocks', 'woo-satispay', WC_Satispay::plugin_abspath() . 'languages');
}

return [ 'wc-satispay-payments-blocks' ];
Expand All @@ -75,11 +73,22 @@ public function get_payment_method_script_handles() {
* @return array
*/
public function get_payment_method_data() {
$currency = strtoupper( (string) get_woocommerce_currency() );
$is_supported_currency = WC_Satispay::SUPPORTED_CURRENCY === $currency;

return [
'title' => __('Satispay', 'woo-satispay'),
'description' => __('Do it smart. Choose Satispay and pay with a tap!', 'woo-satispay'),
'description' => __('After clicking "Pay now", you will be redirected to Satispay to complete your purchase securely', 'woo-satispay'),
'icon' => WC_Satispay::plugin_url() . '/logo.svg',
'supports' => WC_Satispay::SUPPORTS
'supports' => WC_Satispay::SUPPORTS,
'currency' => $currency,
'supportedCurrency' => WC_Satispay::SUPPORTED_CURRENCY,
'isSupportedCurrency' => $is_supported_currency,
'unsupportedCurrencyMessage' => sprintf(
__('Satispay is available only for orders in %1$s. Your current order currency is %2$s. Please choose a different payment method to complete your purchase.', 'woo-satispay'),
WC_Satispay::SUPPORTED_CURRENCY,
$currency
),
];
}
}
36 changes: 33 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Contributors: Satispay
Tags: woocommerce, satispay, payment method
Requires at least: 5.0
Tested up to: 6.9
Stable tag: 2.2.9
License: MIT
License URI: https://opensource.org/licenses/MIT
Stable tag: 3.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Save time and money by accepting payments from your customers with Satispay. Free, simple, secure! #doitsmart

Expand Down Expand Up @@ -45,6 +45,36 @@ You can view Satispay's terms of service and privacy policy here:
* Privacy Policy: https://www.satispay.com/en-it/legal-hub/privacy-policy/

== Changelog ==
= 3.0.0 =
* Added compatibility with WooCommerce 10.6.1
* Updated deprecated functions and properties (WC_Order, WC_Cart, etc.)
* Fixed hook registration for available payment gateways
* Improved security with wp_safe_redirect
* Defined WC_SATISPAY_VERSION constant for better version management
* Updated license to GPLv2 or later for Marketplace compliance
* Implemented Store API security hardening for guest checkout
* Added visible EUR-only warnings in checkout and Blocks, plus authoritative server-side validation, without hiding Satispay
* Added input sanitization for all S2S callback parameters
* Removed direct usage of $_GET for improved security and WordPress compliance
* Added a dedicated late capture gateway setting
* Added clickable Satispay transaction links in WooCommerce orders
* Added staging/live dashboard transaction URL support for new Satispay orders
* Persisted the Satispay order environment to keep transaction links stable across configuration changes
* Fixed the sandbox account URL in gateway settings
* Detected and stored Satispay BNPL payments from payment API callbacks
* Detected and stored Satispay fringe benefits payments, including the fringe amount used
* Displayed Satispay BNPL and fringe benefits details in WooCommerce order pages and admin orders
* Added "Satispay Payment Methods" Gutenberg block for displaying Satispay logo and label in block-based areas (footers, pages)
* Restored cart contents when customer cancels payment on Satispay redirect (classic and block checkout)
* Cleared cart snapshot session data after successful payment
* Fixed admin error notices using WC_Admin_Settings::add_error() instead of raw echo
* Prevented invalid activation code from being saved on authentication failure
* Fixed PHP warning on missing checkbox POST data in process_admin_options
* Skipped unnecessary API call in admin_options when no credentials are configured
* Separated admin method_description from customer-facing checkout description
* Declared cart_checkout_blocks feature compatibility
* Added "Check Satispay payment status" order action for manual payment sync from admin

= 2.2.9 =
* Updated compatibility to WP-6.9

Expand Down
Loading