Send form data as json object to fix decoding

was decoded twice, in RequestData and by parse_str
This commit is contained in:
Alex P 2022-06-08 15:53:30 +03:00
parent 77230fefa8
commit fdbbe6afb3
3 changed files with 9 additions and 13 deletions

View file

@ -403,9 +403,9 @@ class CreateOrderEndpoint implements EndpointInterface {
}
if ( ! $payer && isset( $data['form'] ) ) {
parse_str( $data['form'], $form_fields );
$form_fields = $data['form'];
if ( isset( $form_fields['billing_email'] ) && '' !== $form_fields['billing_email'] ) {
if ( is_array( $form_fields ) && isset( $form_fields['billing_email'] ) && '' !== $form_fields['billing_email'] ) {
return $this->payer_factory->from_checkout_form( $form_fields );
}
}