'payment', ); } /** * Returns the list of additional fields specific to this type. * * @since 2.0.0 * @return array */ public function get_fields() { return array(); } /** * Returns the field/element actual field array to be used on the checkout form. * * @since 2.0.0 * * @param array $attributes Attributes saved on the editor form. * @return array An array of fields, not the field itself. */ public function to_fields_array($attributes) { $fields = array( 'payment_template' => array( 'type' => 'text', 'id' => 'payment_template', 'name' => '', 'classes' => 'wu-hidden', ), 'payment' => array( 'type' => 'payment-methods', 'id' => 'payment', 'name' => $attributes['name'], 'wrapper_classes' => wu_get_isset($attributes, 'wrapper_element_classes', ''), 'classes' => wu_get_isset($attributes, 'element_classes', ''), 'wrapper_html_attr' => array( 'style' => $this->calculate_style_attr(), ), ), ); /* * Checks if we need to add the * auto renew field. */ if ( ! wu_get_setting('force_auto_renew', 1)) { $auto_renewable_gateways = Gateway_Manager::get_instance()->get_auto_renewable_gateways(); $fields['auto_renew'] = array( 'type' => 'toggle', 'id' => 'auto_renew', 'name' => __('Auto-renew', 'wp-ultimo'), 'tooltip' => '', 'value' => '1', 'html_attr' => array( 'v-model' => 'auto_renew', 'true-value' => '1', 'false-value' => '0', ), 'wrapper_html_attr' => array( 'v-cloak' => 1, 'v-show' => sprintf('%s.includes(gateway) && order.should_collect_payment && order.has_recurring', json_encode($auto_renewable_gateways)), ), ); } return $fields; } }