Skip to content

Commit

Permalink
Simplified settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed May 31, 2019
1 parent 5b958ef commit 93bfb6c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 125 deletions.
15 changes: 3 additions & 12 deletions src/Connect/Gateway.php
Expand Up @@ -54,25 +54,16 @@ public function __construct( Config $config ) {
$this->set_slug( self::SLUG );

// Supported features.
$this->supports = self::get_supported_features();
$this->supports = array(
'payment_status_request',
);

// Client.
$this->client = new Client();

$this->client->api_url = $config->api_url;
}

/**
* Get supported features.
*
* @return array
*/
public static function get_supported_features() {
return array(
'payment_status_request',
);
}

/**
* Get iDEAL issuers
*
Expand Down
64 changes: 53 additions & 11 deletions src/Connect/Integration.php
Expand Up @@ -36,18 +36,60 @@ public function get_config_factory_class() {
return __NAMESPACE__ . '\ConfigFactory';
}

/**
* Get required settings for this integration.
*
* @see https://github.com/wp-premium/gravityforms/blob/1.9.16/includes/fields/class-gf-field-multiselect.php#L21-L42
* @since 1.0.4
* @return array
*/
public function get_settings() {
$settings = parent::get_settings();
public function get_settings_fields() {
$fields = array();

// Account ID
$fields[] = array(
'section' => 'general',
'filter' => FILTER_SANITIZE_STRING,
'meta_key' => '_pronamic_gateway_multisafepay_account_id',
'title' => __( 'Account ID', 'pronamic_ideal' ),
'type' => 'text',
'classes' => array( 'code' ),
'methods' => array( 'multisafepay_connect' ),
'tooltip' => sprintf(
'%s %s.',
__( 'Account ID', 'pronamic_ideal' ),
/* translators: %s: MultiSafepay */
sprintf( __( 'as mentioned in the %s dashboard', 'pronamic_ideal' ), __( 'MultiSafepay', 'pronamic_ideal' ) )
),
);

// Site ID
$fields[] = array(
'section' => 'general',
'filter' => FILTER_SANITIZE_STRING,
'meta_key' => '_pronamic_gateway_multisafepay_site_id',
'title' => __( 'Site ID', 'pronamic_ideal' ),
'type' => 'text',
'classes' => array( 'code' ),
'methods' => array( 'multisafepay_connect' ),
'tooltip' => sprintf(
'%s %s.',
__( 'Site ID', 'pronamic_ideal' ),
/* translators: %s: MultiSafepay */
sprintf( __( 'as mentioned in the %s dashboard', 'pronamic_ideal' ), __( 'MultiSafepay', 'pronamic_ideal' ) )
),
);

$settings[] = 'multisafepay_connect';
// Site Security Code
$fields[] = array(
'section' => 'general',
'filter' => FILTER_SANITIZE_STRING,
'meta_key' => '_pronamic_gateway_multisafepay_site_code',
'title' => __( 'Site Security Code', 'pronamic_ideal' ),
'type' => 'text',
'classes' => array( 'code' ),
'methods' => array( 'multisafepay_connect' ),
'tooltip' => sprintf(
'%s %s.',
__( 'Site Security Code', 'pronamic_ideal' ),
/* translators: %s: MultiSafepay */
sprintf( __( 'as mentioned in the %s dashboard', 'pronamic_ideal' ), __( 'MultiSafepay', 'pronamic_ideal' ) )
),
);

return $settings;
return $fields;
}
}
102 changes: 0 additions & 102 deletions src/Settings.php

This file was deleted.

0 comments on commit 93bfb6c

Please sign in to comment.