if ( isset( $data['payment_details'] ) && is_array( $data['payment_details'] ) ) {

                // method ID & title are required
                if ( empty( $data['payment_details']['method_id'] ) || empty( $data['payment_details']['method_title'] ) ) {
                    throw new WC_API_Exception( 'woocommerce_invalid_payment_details', __( 'Payment method ID and title are required', 'woocommerce' ), 400 );