-
Notifications
You must be signed in to change notification settings - Fork 42
Upgrade guides
Below are guides to each new version of the framework, detailing any extra steps needed or backwards incompatibilities to be aware of when upgrading a plugin. If no steps are listed, you can check the release's changelog entries for any changes you'll want to test after upgrading.
-
Update the
build_token()
method in subclasses ofSV_WC_Payment_Gateway_Payment_Tokens_Handler
to accept an instance of\WC_Payment_Token
or anarray
as the second parameter ($data
) -
Update the constructor in subclasses of
SV_WC_Payment_Gateway_Payment_Token
to accept an instance of\WC_Payment_Token
or anarray
as the second parameter ($data
) -
Make sure that API response classes that implement
SV_WC_Payment_Gateway_API_Create_Payment_Token_Response
orSV_WC_Payment_Gateway_API_Get_Tokenized_Payment_Methods_Response
include a value for each of the following keys in the token data:- Credit Card tokens
last_four
-
exp_year
(four characters) -
exp_month
(two characters) cart_type
- eCheck tokens
last_four
If the API response doesn't include enough information, we may need to update
SV_WC_Payment_Gateway_Payment_Tokens_Handler::merge_token_data()
or otherwise ensure those values are available before callingsave()
on the core token. - Credit Card tokens
We removed the framework's table in favor of WooCommerce's table of payment methods. As a result, the following hooks were deprecated:
wc_{$plugin_id}_my_payment_methods_table_html
wc_{$plugin_id}_my_payment_methods_table_head_html
-
wc_{$plugin_id}_my_payment_methods_table_title
(listed in Intuit Payments as a replacement for another hook) wc_{$plugin_id}_my_payment_methods_table_title_html
wc_{$plugin_id}_my_payment_methods_table_row_html
wc_{$plugin_id}_my_payment_methods_table_body_html
-
wc_{$plugin_id}_my_payment_methods_table_body_row_data
(used by Chase Paymentech) wc_{$plugin_id}_my_payment_methods_table_method_expiry_html
wc_{$plugin_id}_my_payment_methods_table_actions_html
Make sure to remove usage of those hooks to avoid triggering deprecated notices.
Moving forward, the following core hooks could be used to customize some of the information displayed in the table:
- Use filter
woocommerce_payment_methods_list_item
to define custom actions for individual tokens - Use filter
woocommerce_account_payment_methods_columns
to define additional columns for the table - Use action
woocommerce_account_payment_methods_column_{custom_column_id}
to render the content of a coulumn for an individual token
A new SkyVerge\WooCommerce\PluginFramework\vX_Y_Z\Frontend\Script_Handler
abstract class was added. See JavaScript Handling for usage instructions and a description of the internal changes.
Plugins that extend one of the PHP Handler or JavaScript Handler classes may need to update their implementations as follows:
- Update JavaScript classes that extend:
-
SV_WC_Payment_Form_Handler
to extendSV_WC_Payment_Form_Handler_vX_Y_Z
-
SV_WC_Apple_Pay_Handler
to extendSV_WC_Apple_Pay_Handler_vX_Y_Z
-
SV_WC_Payment_Methods_Handler
to extendSV_WC_Payment_Methods_Handler_vX_Y_Z
-
- Subclasses of
SV_WC_Payment_Gateway_Payment_Form
that overwriterender_js()
should consider overwritingget_js_handler_args()
instead or make sure that the sub-class version renders the new snippet (See description of the enqueued JavaScript code). - Subclasses of
SV_WC_Payment_Gateway_Payment_Form
andSV_WC_Payment_Gateway_My_Payment_Methods
that use a different class name for the JavaScript handler should overwriteget_js_handler_class_name()
to return the appropriate name. - Subclasses of
SV_WC_Payment_Gateway_Apple_Pay_Frontend
that overwriteget_js_handler_params()
should overwriteget_js_handler_args()
instead (no deprecation needed) - Subclasses of
SV_WC_Payment_Gateway_Apple_Pay_Frontend
that overwriteget_js_handler_name()
should overwriteget_js_handler_class_name()
instead (no deprecation needed) - Subclasses of
SV_WC_Payment_Gateway
that overwriteget_payment_form_instance()
should overwriteinit_payment_form_instance()
instead to avoid creating two instances of the Payment Form class.
N/A
N/A
N/A
- For plugins extending
SV_WC_API_Base
- If overriding
::require_tls_1_2()
, move the method to the plugin's base class
- If overriding
N/A
See the list of deprecated methods that will throw a notice if used.
More legacy versions coming soon...
- Home
- General Usage
- Payment Gateways
- WooCommerce Blocks
- Updating
- Testing
- Workflow