Change marketplace install API request to POST instead of GET (#43033)

* Change marketplace install API to using POST instead of GET
* Fix linting error
* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Kyle Nel 2023-12-22 10:03:11 +02:00 committed by GitHub
parent a8b0f88bad
commit 92e1b932c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Comment: Changed an install-url request to POST instead of GET due to changes on Woo.com

View File

@ -1184,11 +1184,16 @@ class WC_Helper {
* @return string
*/
public static function get_subscription_install_url( $product_key ) {
$install_url_response = WC_Helper_API::get(
$install_url_response = WC_Helper_API::post(
'install-url',
array(
'authenticated' => true,
'query_string' => esc_url( '?product_key=' . $product_key . '&wc_version=' . WC()->version ),
'body' => wp_json_encode(
array(
'product_key' => $product_key,
'wc_version' => WC()->version,
)
),
)
);