Merge branch 'master' into issue-19-dcc-logos

This commit is contained in:
David Remer 2020-09-24 10:49:37 +03:00 committed by GitHub
commit bc2f12e343
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 8 deletions

View file

@ -21,8 +21,8 @@ export const payerData = () => {
country_code : (document.querySelector('#billing_country')) ? document.querySelector('#billing_country').value : payer.address.country_code,
address_line_1 : (document.querySelector('#billing_address_1')) ? document.querySelector('#billing_address_1').value : payer.address.address_line_1,
address_line_2 : (document.querySelector('#billing_address_2')) ? document.querySelector('#billing_address_2').value : payer.address.address_line_2,
admin_area_1 : (document.querySelector('#billing_city')) ? document.querySelector('#billing_city').value : payer.address.admin_area_1,
admin_area_2 : (document.querySelector('#billing_state')) ? document.querySelector('#billing_state').value : payer.address.admin_area_2,
admin_area_1 : (document.querySelector('#billing_state')) ? document.querySelector('#billing_state').value : payer.address.admin_area_1,
admin_area_2 : (document.querySelector('#billing_city')) ? document.querySelector('#billing_city').value : payer.address.admin_area_2,
postal_code : (document.querySelector('#billing_postcode')) ? document.querySelector('#billing_postcode').value : payer.address.postal_code
}
};

View file

@ -31,6 +31,16 @@ class CreditCardRenderer {
document.querySelector('#ppcp-hide-dcc').parentNode.removeChild(document.querySelector('#ppcp-hide-dcc'));
const cardNumberField = document.querySelector('#ppcp-credit-card-gateway-card-number');
const stylesRaw = window.getComputedStyle(cardNumberField);
let styles = {};
Object.values(stylesRaw).forEach( (prop) => {
if (! stylesRaw[prop]) {
return;
}
styles[prop] = '' + stylesRaw[prop];
});
const cardNumber = dccInputFactory(cardNumberField);
cardNumberField.parentNode.replaceChild(cardNumber, cardNumberField);
@ -54,6 +64,9 @@ class CreditCardRenderer {
}
paypal.HostedFields.render({
createOrder: contextConfig.createOrder,
styles: {
'input': styles
},
fields: {
number: {
selector: '#ppcp-credit-card-gateway-card-number',

View file

@ -4,9 +4,22 @@
#field-client_secret,
#field-client_id,
#field-merchant_id {
#field-merchant_id{
display: none;
}
#field-client_secret.show,
#field-client_id.show,
#field-merchant_id.show {
display: table-row;
}
#field-toggle_manual_input span.hide,
#field-toggle_manual_input.show span.show{
display: none;
}
#field-toggle_manual_input.show span.hide {
display: unset;
}
#field-toggle_manual_input button {
color: #0073aa;

View file

@ -236,7 +236,7 @@ return array(
'toggle_manual_input' => array(
'type' => 'ppcp-text',
'title' => __( 'Manual mode', 'paypal-payments-for-woocommerce' ),
'text' => '<button id="ppcp[toggle_manual_input]">' . __( 'Toggle to manual credential input', 'paypal-payments-for-woocommerce' ) . '</button>',
'text' => '<button id="ppcp[toggle_manual_input]"><span class="show">' . __( 'Show manual credential input', 'paypal-payments-for-woocommerce' ) . '</span><span class="hide">' . __( 'Hide manual credential input', 'paypal-payments-for-woocommerce' ) . '</span></button>',
'screens' => array(
State::STATE_START,
State::STATE_PROGRESSIVE,
@ -287,6 +287,17 @@ return array(
'requirements' => array(),
'gateway' => 'paypal',
),
'checkout_settings_heading' => array(
'heading' => __( 'PayPal Checkout Plugin Settings', 'paypal-payments-for-woocommerce' ),
'type' => 'ppcp-heading',
'screens' => array(
State::STATE_PROGRESSIVE,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
),
'title' => array(
'title' => __( 'Title', 'paypal-payments-for-woocommerce' ),
'type' => 'text',
@ -503,7 +514,7 @@ return array(
'gateway' => 'paypal',
),
'prefix' => array(
'title' => __( 'Installation prefix', 'paypal-payments-for-woocommerce' ),
'title' => __( 'Invoice prefix', 'paypal-payments-for-woocommerce' ),
'type' => 'text',
'desc_tip' => true,
'description' => __( 'If you use your PayPal account with more than one installation, please use a distinct prefix to seperate those installations. Please do not use numbers in your prefix.', 'paypal-payments-for-woocommerce' ),
@ -789,7 +800,7 @@ return array(
'default' => '1x1',
'desc_tip' => true,
'description' => __(
'The color of the text. Only applicable, when the layout style Flex is used.',
'The width/height ratio of the banner. Only applicable, when the layout style Flex is used.',
'paypal-payments-for-woocommerce'
),
'options' => array(
@ -1079,7 +1090,7 @@ return array(
'default' => '1x1',
'desc_tip' => true,
'description' => __(
'The color of the text. Only applicable, when the layout style Flex is used.',
'The width/height ratio of the banner. Only applicable, when the layout style Flex is used.',
'paypal-payments-for-woocommerce'
),
'options' => array(
@ -1498,7 +1509,7 @@ return array(
'default' => '1x1',
'desc_tip' => true,
'description' => __(
'The color of the text. Only applicable, when the layout style Flex is used.',
'The width/height ratio of the banner. Only applicable, when the layout style Flex is used.',
'paypal-payments-for-woocommerce'
),
'options' => array(