Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templates styles javascript #14

Merged
merged 53 commits into from
Apr 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
b6363bb
rename class,use autoloader to load payment methods
Apr 19, 2017
d7373fd
add icons for payment methods
Apr 21, 2017
fb610fa
add ccard moto payment type
Apr 24, 2017
52bd2bf
allow multiselect for moto roles
Apr 24, 2017
132b36c
rename group to role as wp uses this term
Apr 24, 2017
4bf257e
add maestro as payment type
Apr 24, 2017
d98b197
add check for risk
Apr 24, 2017
3917c07
allow arrays as payment icons
Apr 24, 2017
13a0234
add comments, headers and adjust templates
Apr 24, 2017
a13a695
add sofort payment type
Apr 24, 2017
a8a4573
update to the coding standard of wordpress
Apr 24, 2017
dfd6c7c
don't show payment fields if none available
Apr 24, 2017
09ce48b
add the sepa direct debit payment type
Apr 24, 2017
8e7fd5b
add sepa options tab to settings
Apr 24, 2017
802dc13
add sepa option to settings
Apr 24, 2017
33e3d70
remove required from bic input field
Apr 24, 2017
1992c83
Call validation on each payment class having fields
Apr 25, 2017
e0d4139
remove min age from invoice and installment
Apr 25, 2017
ad057e7
add validation for creditcard, moto and maestro
Apr 25, 2017
68a5763
exclude cvc check for ccard-moto
Apr 25, 2017
12e8f19
add invoice payment method
Apr 25, 2017
6609d49
parse response errors and use translated ones
Apr 25, 2017
bb0f950
sort dob days, months and years descending
Apr 25, 2017
7798f98
create installment payment method
Apr 25, 2017
8a49e51
update namespace to an existing one
Apr 25, 2017
38a6b02
enable risk management for installment
Apr 25, 2017
1623a61
change can not be to must not be
Apr 25, 2017
d7df33c
add invoice b2b as payment method
Apr 25, 2017
6b31b02
add voucher as payment method
Apr 25, 2017
e1a121b
update branch from master
Apr 25, 2017
06ca0f5
add trustly as payment method
Apr 25, 2017
89878ad
add tatrapay as payment method
Apr 25, 2017
1d2a898
add skrilldirect as payment method
Apr 25, 2017
0d4e9ac
add przelewy24 as payment method
Apr 25, 2017
cf89988
add poli as payment method
Apr 25, 2017
e920f1b
add bancontact mistercash as payment method
Apr 25, 2017
89d35fa
add ekonto as payment method
Apr 25, 2017
902a5e9
add giropay as payment method
Apr 25, 2017
158d9e4
add eps as payment method
Apr 25, 2017
9af6ee9
add ideal as payment method
Apr 26, 2017
7f72c3e
add get_backend_password method for config class
Apr 26, 2017
f0f5fdf
add trustpay as payment method
Apr 26, 2017
7de495f
Merge remote-tracking branch 'refs/remotes/origin/master' into templa…
Apr 26, 2017
2e08a0a
use correct label
Apr 26, 2017
4cc8481
remove quick from payment methods
Apr 26, 2017
63aad6c
add epay.bg as payment method
Apr 26, 2017
e3f6821
add moneta.ru as payment method
Apr 26, 2017
0046eaa
add paysafecard as payment method
Apr 26, 2017
fb03d57
add skrill digital wallet as payment method
Apr 26, 2017
3b1b49a
remove mpass payment method
Apr 26, 2017
6f58add
add paybox payment method
Apr 26, 2017
460725a
Merge branch 'master' into templatesStylesJavascript
Apr 28, 2017
807449a
Update class-wirecard-datastorage.php
rinnhofer Apr 28, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions woocommerce-wirecard-checkout-seamless/assets/styles/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
-ms-transition: .2s;
-o-transition: .2s;
transition: .2s;
border-radius:4px;
}

.wcs-chkbx-switch > .wcs-chkbx-switch-slider:before {
Expand All @@ -68,6 +69,7 @@
-ms-transition: .2s;
-o-transition: .2s;
transition: .2s;
border-radius: 50%;
}

.wcs-chkbx-switch > input + .wcs-chkbx-switch-slider {
Expand Down Expand Up @@ -128,12 +130,12 @@
text-align: right;
}

.tab-content.panel th{

.tab-content.panel th, .tab-content.panel td{
padding: 5px;
}


.tab-content.panel td{
padding: 5px;
border-bottom: 1px solid #fafafa;
#transaction-table tr:hover td {
background-color: rgba(250,250,250,0.7);
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,84 +38,103 @@ class WC_Gateway_Wirecard_Checkout_Seamless_Admin {
/**
* Handles form output for admin panel
*
* @param $gateway
* @param $gateway WC_Gateway_Wirecard_Checkout_Seamless
*
* @since 1.0.0
*/

function print_admin_form_fields( $gateway ){
?>
<div class="woo-wcs-settings-header-wrapper">
<div class="woo-wcs-backend-links">
<a class="button-primary woocommerce-save-button"
<a class="button-primary"
href="?page=wc-settings&tab=checkout&section=woocommerce_wcs&transaction_start=1">
<?= __( 'Transaction Overview', 'woocommerce-wirecard-checkout-seamless' ) ?>
</a>

<a class="button-primary woocommerce-save-button" href="javascript:void(0);">
<a class="button-primary" href="javascript:void(0);">
<?= __( 'Contact support', 'woocommerce_wirecard_checkout_seamless' ) ?>
</a>
</div>
</div>
<nav class="nav-tab-wrapper woo-nav-tab-wrapper wcs-tabs">
<a href="javascript:void(0);" data-target="#basicdata" class="nav-tab nav-tab-active"><?= __( 'Access data',
'woocommerce-wirecard-checkout-seamless' ) ?></a>
'woocommerce-wirecard-checkout-seamless' ) ?></a>
<a href="javascript:void(0);" data-target="#options" class="nav-tab "><?= __( 'General settings',
'woocommerce-wirecard-checkout-seamless' ) ?></a>
'woocommerce-wirecard-checkout-seamless' ) ?></a>
<a href="javascript:void(0);" data-target="#creditcardoptions" class="nav-tab "><?= __( 'Credit card',
'woocommerce-wirecard-checkout-seamless' ) ?></a>
'woocommerce-wirecard-checkout-seamless' ) ?></a>
<a href="javascript:void(0);" data-target="#sepaoptions" class="nav-tab "><?= __( 'Sepa',
'woocommerce-wirecard-checkout-seamless' ) ?></a>
<a href="javascript:void(0);" data-target="#invoiceoptions" class="nav-tab "><?= __( 'Invoice',
'woocommerce-wirecard-checkout-seamless' ) ?></a>
'woocommerce-wirecard-checkout-seamless' ) ?></a>
<a href="javascript:void(0);" data-target="#installmentoptions" class="nav-tab "><?= __( 'Installment',
'woocommerce-wirecard-checkout-seamless' ) ?></a>
'woocommerce-wirecard-checkout-seamless' ) ?></a>
<a href="javascript:void(0);" data-target="#standardpayments" class="nav-tab "><?= __( 'Standard payments',
'woocommerce-wirecard-checkout-seamless' ) ?></a>
'woocommerce-wirecard-checkout-seamless' ) ?></a>
<a href="javascript:void(0);" data-target="#bankingpayments" class="nav-tab "><?= __( 'Banking payments',
'woocommerce-wirecard-checkout-seamless' ) ?></a>
'woocommerce-wirecard-checkout-seamless' ) ?></a>
<a href="javascript:void(0);" data-target="#alternativepayments"
class="nav-tab "><?= __( 'Alternative payments', 'woocommerce-wirecard-checkout-seamless' ) ?></a>
<a href="javascript:void(0);" data-target="#mobilepayments" class="nav-tab "><?= __( 'Mobile payments',
'woocommerce-wirecard-checkout-seamless' ) ?></a>
'woocommerce-wirecard-checkout-seamless' ) ?></a>
<a href="javascript:void(0);" data-target="#voucherpayments" class="nav-tab "><?= __( 'Voucher payments',
'woocommerce-wirecard-checkout-seamless' ) ?></a>
'woocommerce-wirecard-checkout-seamless' ) ?></a>
</nav>
<div class="tab-content panel">
<div class="tab-pane active" id="basicdata">
<table><?= $gateway->generate_settings_html( $this->get_settings_fields( 'basicdata' ), false ); ?></table>
<table
class="form-table"><?= $gateway->generate_settings_html( $this->get_settings_fields( 'basicdata' ),
false ); ?></table>
</div>
<div class="tab-pane" id="options">
<table><?= $gateway->generate_settings_html( $this->get_settings_fields( 'options' ), false ); ?></table>
<table class="form-table"><?= $gateway->generate_settings_html( $this->get_settings_fields( 'options' ),
false ); ?></table>
</div>
<div class="tab-pane" id="creditcardoptions">
<table><?= $gateway->generate_settings_html( $this->get_settings_fields( 'creditcardoptions' ),
false ); ?></table>
<table
class="form-table"><?= $gateway->generate_settings_html( $this->get_settings_fields( 'creditcardoptions' ),
false ); ?></table>
</div>
<div class="tab-pane" id="sepaoptions">
<table
class="form-table"><?= $gateway->generate_settings_html( $this->get_settings_fields( 'sepaoptions' ),
false ); ?></table>
</div>
<div class="tab-pane" id="invoiceoptions">
<table><?= $gateway->generate_settings_html( $this->get_settings_fields( 'invoiceoptions' ),
false ); ?></table>
<table
class="form-table"><?= $gateway->generate_settings_html( $this->get_settings_fields( 'invoiceoptions' ),
false ); ?></table>
</div>
<div class="tab-pane" id="installmentoptions">
<table><?= $gateway->generate_settings_html( $this->get_settings_fields( 'installmentoptions' ),
false ); ?></table>
<table
class="form-table"><?= $gateway->generate_settings_html( $this->get_settings_fields( 'installmentoptions' ),
false ); ?></table>
</div>
<div class="tab-pane" id="standardpayments">
<table><?= $gateway->generate_settings_html( $this->get_settings_fields( 'standardpayments' ),
false ); ?></table>
<table
class="form-table"><?= $gateway->generate_settings_html( $this->get_settings_fields( 'standardpayments' ),
false ); ?></table>
</div>
<div class="tab-pane" id="bankingpayments">
<table><?= $gateway->generate_settings_html( $this->get_settings_fields( 'bankingpayments' ),
false ); ?></table>
<table
class="form-table"><?= $gateway->generate_settings_html( $this->get_settings_fields( 'bankingpayments' ),
false ); ?></table>
</div>
<div class="tab-pane" id="alternativepayments">
<table><?= $gateway->generate_settings_html( $this->get_settings_fields( 'alternativepayments' ),
false ); ?></table>
<table
class="form-table"><?= $gateway->generate_settings_html( $this->get_settings_fields( 'alternativepayments' ),
false ); ?></table>
</div>
<div class="tab-pane" id="mobilepayments">
<table><?= $gateway->generate_settings_html( $this->get_settings_fields( 'mobilepayments' ),
false ); ?></table>
<table
class="form-table"><?= $gateway->generate_settings_html( $this->get_settings_fields( 'mobilepayments' ),
false ); ?></table>
</div>
<div class="tab-pane" id="voucherpayments">
<table><?= $gateway->generate_settings_html( $this->get_settings_fields( 'voucherpayments' ),
false ); ?></table>
<table
class="form-table"><?= $gateway->generate_settings_html( $this->get_settings_fields( 'voucherpayments' ),
false ); ?></table>
</div>
</div>
<?php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
*/
class WC_Gateway_Wirecard_Checkout_Seamless_Config {

protected $_settings;
/**
* Test/Demo configurations
*
Expand Down Expand Up @@ -66,15 +67,24 @@ class WC_Gateway_Wirecard_Checkout_Seamless_Config {
);

/**
* Handles configuration modi and returns config array for FrontendClient
* constructor
*
* @param $gateway
* @param $settings
*/
public function __construct( $settings ) {
$this->_settings = $settings;
}

/**
* Handles configuration modes and returns config array for FrontendClient
*
* @param $gateway WC_Gateway_Wirecard_Checkout_Seamless
*
* @since 1.0.0
* @return array
*/
function get_client_config( $gateway ) {
$config_mode = $gateway->get_option( 'woo_wcs_configuration' );
function get_client_config() {
$config_mode = $this->_settings['woo_wcs_configuration'];

if ( array_key_exists( $config_mode, $this->_presets ) ) {
return Array(
Expand All @@ -85,14 +95,27 @@ function get_client_config( $gateway ) {
);
} else {
return Array(
'CUSTOMER_ID' => trim( $gateway->get_option( 'woo_wcs_customerid' ) ),
'SHOP_ID' => trim( $gateway->get_option( 'woo_wcs_shopid' ) ),
'SECRET' => trim( $gateway->get_option( 'woo_wcs_secret' ) ),
'CUSTOMER_ID' => trim( $this->_settings['woo_wcs_customerid'] ),
'SHOP_ID' => trim( $this->_settings['woo_wcs_shopid'] ),
'SECRET' => trim( $this->_settings['woo_wcs_secret'] ),
'LANGUAGE' => $this->get_language_code(),
);
}
}

/**
* Extract language code from locale settings
*
* @since 1.0.0
* @return mixed
*/
function get_language_code() {
$locale = get_locale();
$parts = explode( '_', $locale );

return $parts[0];
}

/**
* Get client secret from config or optionvalue
*
Expand All @@ -112,16 +135,19 @@ function get_client_secret( $gateway ) {
}

/**
* Extract language code from locale settings
* Get client backend password from config or optionvalue
*
* @since 1.0.0
* @return mixed
*/
function get_language_code() {
$locale = get_locale();
$parts = explode( '_', $locale );

return $parts[0];
function get_backend_password() {
$config_mode = $this->_settings['woo_wcs_configuration'];

if ( array_key_exists( $config_mode, $this->_presets ) ) {
return $this->_presets[ $config_mode ]['backendpw'];
} else {
return $this->_settings['woo_wcs_backendpassword'];
}
}

/**
Expand All @@ -134,7 +160,7 @@ function get_language_code() {
*/
function get_order_description( $order ) {
return sprintf( '%s %s %s', $order->get_billing_email(), $order->get_billing_first_name(),
$order->get_billing_last_name() );
$order->get_billing_last_name() );
}

/**
Expand All @@ -161,7 +187,7 @@ function get_plugin_version() {
* @return string
*/
function get_order_reference( $order ) {
return sprintf( '%010s', substr($order->get_id(), -10) );
return sprintf( '%010s', substr( $order->get_id(), - 10 ) );
}

/**
Expand Down Expand Up @@ -287,7 +313,7 @@ function get_shopping_basket() {
$item_unit_net_amount = $item_net_amount / $item_quantity;
$item_unit_tax_amount = $item_tax_amount / $item_quantity;
$item_unit_gross_amount = wc_format_decimal( $item_unit_net_amount + $item_unit_tax_amount,
wc_get_price_decimals() );
wc_get_price_decimals() );

$item->setUnitGrossAmount( $item_unit_gross_amount )
->setUnitNetAmount( wc_format_decimal( $item_unit_net_amount, wc_get_price_decimals() ) )
Expand All @@ -301,10 +327,10 @@ function get_shopping_basket() {
}

// Add shipping to the basket
if ( isset( $cart->shipping_total ) && $cart->shipping_total > 0) {
if ( isset( $cart->shipping_total ) && $cart->shipping_total > 0 ) {
$item = new WirecardCEE_Stdlib_Basket_Item( 'shipping' );
$item->setUnitGrossAmount( wc_format_decimal( $cart->shipping_total + $cart->shipping_tax_total,
wc_get_price_decimals() ) )
wc_get_price_decimals() ) )
->setUnitNetAmount( wc_format_decimal( $cart->shipping_total, wc_get_price_decimals() ) )
->setUnitTaxAmount( wc_format_decimal( $cart->shipping_tax_total, wc_get_price_decimals() ) )
->setUnitTaxRate( number_format( ( $cart->shipping_tax_total / $cart->shipping_total ), 2, '.', '' ) )
Expand Down
Loading