Skip to content
Willington Vega edited this page Apr 6, 2020 · 31 revisions

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.

WIP v5.7.0

Payment Tokens

  • Update the build_token() method in subclasses of SV_WC_Payment_Gateway_Payment_Tokens_Handler to accept an instance of \WC_Payment_Token or an array 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 an array as the second parameter ($data)

  • Make sure that API response classes that implement SV_WC_Payment_Gateway_API_Create_Payment_Token_Response or SV_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 calling save() on the core token.

My Payment Methods table

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

JS handling in registered scripts

  • Update JavaScript classes that extend:
    • SV_WC_Payment_Form_Handler to extend SV_WC_Payment_Form_Handler_vX_Y_Z
    • SV_WC_Apple_Pay_Handler to extend SV_WC_Apple_Pay_Handler_vX_Y_Z
    • SV_WC_Payment_Methods_Handler to extend SV_WC_Payment_Methods_Handler_vX_Y_Z
  • Subclasses of SV_WC_Payment_Gateway_Payment_Form that overwrite render_js() should consider overwriting get_js_handler_params() instead or make sure that the sub-class version renders the new snippet.
  • Subclasses of SV_WC_Payment_Gateway_Payment_Form , SV_WC_Payment_Gateway_Payment_Form , and SV_WC_Payment_Gateway_Apple_Pay_Frontend that use a different class name for the JavaScript handler should overwrite get_js_handler_class_name() to return the appropriate name.
  • Subclasses of SV_WC_Payment_Gateway that overwrite get_payment_form_instance() should overwrite init_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

N/A

See the list of deprecated methods that will throw a notice if used.

More legacy versions coming soon...