@@ -109,28 +109,28 @@ public function register_routes() {
109109 'payment_request_button_type ' => [
110110 'description ' => __ ( 'Express checkout button types. ' , 'woocommerce-gateway-stripe ' ),
111111 'type ' => 'string ' ,
112- 'enum ' => array_keys ( $ form_fields ['payment_request_button_type ' ]['options ' ] ),
112+ 'enum ' => array_keys ( $ form_fields ['express_checkout_button_type ' ]['options ' ] ),
113113 'validate_callback ' => 'rest_validate_request_arg ' ,
114114 ],
115115 'payment_request_button_theme ' => [
116116 'description ' => __ ( 'Express checkout button themes. ' , 'woocommerce-gateway-stripe ' ),
117117 'type ' => 'string ' ,
118- 'enum ' => array_keys ( $ form_fields ['payment_request_button_theme ' ]['options ' ] ),
118+ 'enum ' => array_keys ( $ form_fields ['express_checkout_button_theme ' ]['options ' ] ),
119119 'validate_callback ' => 'rest_validate_request_arg ' ,
120120 ],
121121 'payment_request_button_size ' => [
122122 'description ' => __ ( 'Express checkout button sizes. ' , 'woocommerce-gateway-stripe ' ),
123123 'type ' => 'string ' ,
124- // it can happen that `$form_fields['payment_request_button_size ']` is empty (in tests) - fixing temporarily.
125- 'enum ' => array_keys ( isset ( $ form_fields ['payment_request_button_size ' ]['options ' ] ) ? $ form_fields ['payment_request_button_size ' ]['options ' ] : [] ),
124+ // it can happen that `$form_fields['express_checkout_button_size ']` is empty (in tests) - fixing temporarily.
125+ 'enum ' => array_keys ( isset ( $ form_fields ['express_checkout_button_size ' ]['options ' ] ) ? $ form_fields ['express_checkout_button_size ' ]['options ' ] : [] ),
126126 'validate_callback ' => 'rest_validate_request_arg ' ,
127127 ],
128128 'payment_request_button_locations ' => [
129129 'description ' => __ ( 'Express checkout locations that should be enabled. ' , 'woocommerce-gateway-stripe ' ),
130130 'type ' => 'array ' ,
131131 'items ' => [
132132 'type ' => 'string ' ,
133- 'enum ' => array_keys ( $ form_fields ['payment_request_button_locations ' ]['options ' ] ),
133+ 'enum ' => array_keys ( $ form_fields ['express_checkout_button_locations ' ]['options ' ] ),
134134 ],
135135 'validate_callback ' => 'rest_validate_request_arg ' ,
136136 ],
@@ -237,10 +237,10 @@ public function get_settings() {
237237 'amazon_pay_button_size ' => $ this ->gateway ->get_validated_option ( 'amazon_pay_button_size ' ),
238238 'amazon_pay_button_locations ' => $ this ->gateway ->get_validated_option ( 'amazon_pay_button_locations ' ),
239239 'is_payment_request_enabled ' => $ this ->gateway ->is_payment_request_enabled (),
240- 'payment_request_button_type ' => $ this ->gateway ->get_validated_option ( 'payment_request_button_type ' ),
241- 'payment_request_button_theme ' => $ this ->gateway ->get_validated_option ( 'payment_request_button_theme ' ),
242- 'payment_request_button_size ' => $ this ->gateway ->get_validated_option ( 'payment_request_button_size ' ),
243- 'payment_request_button_locations ' => $ this ->gateway ->get_validated_option ( 'payment_request_button_locations ' ),
240+ 'payment_request_button_type ' => $ this ->gateway ->get_validated_option ( 'express_checkout_button_type ' ),
241+ 'payment_request_button_theme ' => $ this ->gateway ->get_validated_option ( 'express_checkout_button_theme ' ),
242+ 'payment_request_button_size ' => $ this ->gateway ->get_validated_option ( 'express_checkout_button_size ' ),
243+ 'payment_request_button_locations ' => $ this ->gateway ->get_validated_option ( 'express_checkout_button_locations ' ),
244244
245245 /* Settings > Payments & transactions */
246246 'is_manual_capture_enabled ' => ! $ this ->gateway ->is_automatic_capture_enabled (),
@@ -540,10 +540,10 @@ private function update_amazon_pay_settings( WP_REST_Request $request ) {
540540 */
541541 private function update_payment_request_settings ( WP_REST_Request $ request ) {
542542 $ attributes = [
543- 'payment_request_button_type ' => 'payment_request_button_type ' ,
544- 'payment_request_button_size ' => 'payment_request_button_size ' ,
545- 'payment_request_button_theme ' => 'payment_request_button_theme ' ,
546- 'payment_request_button_locations ' => 'payment_request_button_locations ' ,
543+ 'payment_request_button_type ' => 'express_checkout_button_type ' ,
544+ 'payment_request_button_size ' => 'express_checkout_button_size ' ,
545+ 'payment_request_button_theme ' => 'express_checkout_button_theme ' ,
546+ 'payment_request_button_locations ' => 'express_checkout_button_locations ' ,
547547 ];
548548
549549 foreach ( $ attributes as $ request_key => $ attribute ) {
0 commit comments