godaddy-wordpress / godaddy-wordpress/wc-plugin-framework

Change payment notification listener hook name

Open
#323 0 comments 0 reactions 0 assignees View on GitHub
Bug Payment Gateway
Dominant language
PHP
Stars
146
Forks
43
Avg merge
21m
Merged PRs (30d)
3

Description

`SV_WC_Payment_Gateway_Hosted` automatically registers an action to listen for hosted transaction responses based on the value of `get_class()` -- [see it here](https://github.com/skyverge/wc-plugin-framework/blob/303895149120fb90f93093e4ff2a8e619914452b/woocommerce/payment-gateway/class-sv-wc-payment-gateway-hosted.php#L65-L68).

This has been fine in the past, but as we begin to move towards using namespaces in more plugins, this will become a problem as `get_class()` will result in the fully-qualified class name, including backslashes, therefore creating an action like `woocommerce_api_skyverge\woocommerce\plugin_name\gateway` which is pretty nasty-looking and won't work.

Instead, perhaps we should use the Gateway ID in the action rather than the class name.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.