-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removes Sofort from settings and checkout #9820
base: develop
Are you sure you want to change the base?
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.36 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The effect of the changes added within this PR are dependent on the migration action being triggered on plugin update. add_action( 'woocommerce_woocommerce_payments_updated', [ new \WCPay\Migrations\Payment_Method_Deprecation_Settings_Update( self::get_gateway(), self::get_payment_gateway_map(), Sofort_Payment_Method::PAYMENT_METHOD_STRIPE_ID, '8.9.0' ), 'maybe_migrate' ] ); See includes/class-wc-payments.php#L685 We trigger the public static function init() {
...
add_action( 'init', [ __CLASS__, 'install_actions' ] );
...
}
/**
* Handles upgrade routines.
*/
public static function install_actions() {
if ( version_compare( WCPAY_VERSION_NUMBER, get_option( 'woocommerce_woocommerce_payments_version' ), '>' ) ) {
do_action( 'woocommerce_woocommerce_payments_updated' );
self::update_plugin_version();
}
}
/**
* Updates the plugin version in db.
*/
public static function update_plugin_version() {
update_option( 'woocommerce_woocommerce_payments_version', WCPAY_VERSION_NUMBER );
} See includes/class-wc-payments.php#L1477 Note that the action is fired before we update the plugin version in the options database. Consequently, when we compare the plugin version that will trigger the migration to the current plugin version here, /**
* Checks whether we should trigger the event.
*/
public function maybe_migrate() {
$previous_version = get_option( 'woocommerce_woocommerce_payments_version' );
if ( version_compare( $this->migration_version, $previous_version, '>' ) ) {
$this->migrate();
}
} In order to ensure that this action is fired and the migration occurs as expected, you may need to both update the plugin version in your local copy of the code and also perhaps need to update the plugin version stored in your options database to something lesser than this value to ensure that the migration is triggered and to effectively mimic an actual plugin update. You can probably add a breakpoint inside Alternatively, you can probably also add a snippet to your local site to manually trigger the @gpressutto5, let me know if these steps make sense and you are able to follow them. If you are still unable to experience the destined deprecation, also let me know and I can scratch my head a little more and sync up with you to try to figure this out again. 😅 |
@@ -69,12 +69,10 @@ | |||
use WCPay\Payment_Methods\Becs_Payment_Method; | |||
use WCPay\Payment_Methods\CC_Payment_Method; | |||
use WCPay\Payment_Methods\Eps_Payment_Method; | |||
use WCPay\Payment_Methods\Giropay_Payment_Method; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Giropay has been deprecated before, so just taking the liberty of removing redundant imports and tests for Giropay as well, wherever I encountered them.
@FangedParakeet I can't test it anymore as I had to reonboard and New businesses can’t accept SOFORT payments. I'm spinning the roulette again. |
Changes proposed in this Pull Request
In line with Sofort's permanent deprecation, this PR removes Sofort as an available payment method from settings and checkout. Mirrors related changes in #9055. Please see paJDYF-aMc-p2#comment-27057 for more information.
Testing instructions
develop
and ensure you have some completed orders using Sofort as a payment method. (Sofort has been soft-deprecated for all users already, so you may need to alter the response from the server to make the Sofort capability available.)8.8.0
).Note that Sofort is no longer present in our critical testing flows since our soft deprecation, so this will not need to be updated.
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge