Skip to content

Commit 18f5c38

Browse files
committed
Merge release/9.2.1 into trunk
2 parents a77e357 + 47027e2 commit 18f5c38

File tree

8 files changed

+25
-22
lines changed

8 files changed

+25
-22
lines changed

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
*** WooPayments Changelog ***
22

3+
= 9.2.1 - 2025-04-23 =
4+
* Update - Update account session creation route definition to use POST rather than GET.
5+
36
= 9.2.0 - 2025-04-09 =
47
* Add - Add back button for tertiary+ level pages in WooPayments settings.
58
* Fix - fix: cancel GooglePay/ApplePay dialog on product page if add-to-cart product validation fails

client/embedded-components/hooks.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ export const createKycAccountSession = async (
3333
isPoEligible: boolean
3434
): Promise< AccountSession > => {
3535
const urlParams = new URLSearchParams( window.location.search );
36+
3637
return await apiFetch< AccountSession >( {
37-
path: addQueryArgs( `${ NAMESPACE }/onboarding/kyc/session`, {
38+
path: `${ NAMESPACE }/onboarding/kyc/session`,
39+
method: 'POST',
40+
data: {
3841
self_assessment: fromDotNotation( data ),
3942
capabilities: urlParams.get( 'capabilities' ) || '',
4043
progressive: isPoEligible,
41-
} ),
42-
method: 'GET',
44+
},
4345
} );
4446
};

includes/admin/class-wc-rest-payments-onboarding-controller.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public function register_routes() {
5252
$this->namespace,
5353
'/' . $this->rest_base . '/kyc/session',
5454
[
55-
'methods' => WP_REST_Server::READABLE,
56-
'callback' => [ $this, 'get_embedded_kyc_session' ],
55+
'methods' => WP_REST_Server::CREATABLE,
56+
'callback' => [ $this, 'create_embedded_kyc_session' ],
5757
'permission_callback' => [ $this, 'check_permission' ],
5858
'args' => [
5959
'progressive' => [
@@ -71,32 +71,26 @@ public function register_routes() {
7171
'country' => [
7272
'type' => 'string',
7373
'description' => 'The country code where the company is legally registered.',
74-
'required' => true,
7574
],
7675
'business_type' => [
7776
'type' => 'string',
7877
'description' => 'The company incorporation type.',
79-
'required' => true,
8078
],
8179
'mcc' => [
8280
'type' => 'string',
8381
'description' => 'The merchant category code. This can either be a true MCC or an MCCs tree item id from the onboarding form.',
84-
'required' => true,
8582
],
8683
'annual_revenue' => [
8784
'type' => 'string',
8885
'description' => 'The estimated annual revenue bucket id.',
89-
'required' => true,
9086
],
9187
'go_live_timeframe' => [
9288
'type' => 'string',
9389
'description' => 'The timeframe bucket for the estimated first live transaction.',
94-
'required' => true,
9590
],
9691
'site' => [
9792
'type' => 'string',
9893
'description' => 'The URL of the site.',
99-
'required' => true,
10094
],
10195
],
10296
],
@@ -226,9 +220,9 @@ public function register_routes() {
226220
*
227221
* @param WP_REST_Request $request Request object.
228222
*
229-
* @return WP_Error|WP_REST_Response
223+
* @return WP_Error|WP_REST_Response Response object containing the account session, or an error if session creation failed.
230224
*/
231-
public function get_embedded_kyc_session( WP_REST_Request $request ) {
225+
public function create_embedded_kyc_session( WP_REST_Request $request ) {
232226
$self_assessment_data = ! empty( $request->get_param( 'self_assessment' ) ) ? wc_clean( wp_unslash( $request->get_param( 'self_assessment' ) ) ) : [];
233227
$progressive = ! empty( $request->get_param( 'progressive' ) ) && filter_var( $request->get_param( 'progressive' ), FILTER_VALIDATE_BOOLEAN );
234228

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "woocommerce-payments",
3-
"version": "9.2.0",
3+
"version": "9.2.1",
44
"main": "webpack.config.js",
55
"author": "Automattic",
66
"license": "GPL-3.0-or-later",

readme.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: woocommerce payments, apple pay, credit card, google pay, payment, payment
44
Requires at least: 6.0
55
Tested up to: 6.7
66
Requires PHP: 7.3
7-
Stable tag: 9.2.0
7+
Stable tag: 9.2.1
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -87,6 +87,10 @@ You can read our Terms of Service and other policies [here](https://woocommerce.
8787

8888
== Changelog ==
8989

90+
= 9.2.1 - 2025-04-23 =
91+
* Update - Update account session creation route definition to use POST rather than GET.
92+
93+
9094
= 9.2.0 - 2025-04-09 =
9195
* Add - Add back button for tertiary+ level pages in WooPayments settings.
9296
* Fix - fix: cancel GooglePay/ApplePay dialog on product page if add-to-cart product validation fails

tests/unit/admin/test-class-wc-rest-payments-onboarding-controller.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function test_get_progressive_onboarding_not_eligible() {
141141
);
142142
}
143143

144-
public function test_get_embedded_kyc_session() {
144+
public function test_create_embedded_kyc_session() {
145145
$kyc_session = [
146146
'clientSecret' => 'accs_secret__XXX',
147147
'expiresAt' => time() + 120,
@@ -158,15 +158,15 @@ public function test_get_embedded_kyc_session() {
158158
$kyc_session
159159
);
160160

161-
$request = new WP_REST_Request( 'GET' );
162-
$request->set_query_params(
161+
$request = new WP_REST_Request( 'POST' );
162+
$request->set_body_params(
163163
[
164164
'progressive' => true,
165165
'create_live_account' => true,
166166
]
167167
);
168168

169-
$response = $this->controller->get_embedded_kyc_session( $request );
169+
$response = $this->controller->create_embedded_kyc_session( $request );
170170
$this->assertSame( 200, $response->status );
171171
$this->assertSame(
172172
array_merge(

woocommerce-payments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* WC tested up to: 9.7.1
1212
* Requires at least: 6.0
1313
* Requires PHP: 7.3
14-
* Version: 9.2.0
14+
* Version: 9.2.1
1515
* Requires Plugins: woocommerce
1616
*
1717
* @package WooCommerce\Payments

0 commit comments

Comments
 (0)