mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Add setting option to enable/disable name on card field
This commit is contained in:
parent
c76872d9d1
commit
c80f58abcf
3 changed files with 20 additions and 3 deletions
|
@ -152,6 +152,19 @@ return array(
|
|||
'gateway' => array( 'dcc', 'axo' ),
|
||||
'requirements' => array( 'axo' ),
|
||||
),
|
||||
'axo_name_on_card' => array(
|
||||
'title' => __( 'Display "Name on Card" field', 'woocommerce-paypal-payments' ),
|
||||
'type' => 'checkbox',
|
||||
'default' => 'yes',
|
||||
'classes' => array( 'ppcp-field-indent' ),
|
||||
'class' => array(),
|
||||
'label' => __( 'Enable "Name on Card" field', 'woocommerce-paypal-payments' ),
|
||||
'desc_tip' => true,
|
||||
'description' => __( 'Enable to display the "Name on Card" field for new Fastlane buyers.', 'woocommerce-paypal-payments' ),
|
||||
'screens' => array( State::STATE_ONBOARDED ),
|
||||
'gateway' => array( 'dcc', 'axo' ),
|
||||
'requirements' => array( 'axo' ),
|
||||
),
|
||||
'axo_style_heading' => array(
|
||||
'heading' => __( 'Advanced Style Settings (optional)', 'woocommerce-paypal-payments' ),
|
||||
'heading_html' => sprintf(
|
||||
|
|
|
@ -639,10 +639,13 @@ class AxoManager {
|
|||
}
|
||||
|
||||
cardComponentData() {
|
||||
let fields = {};
|
||||
if(this.axoConfig.name_on_card === '1') {
|
||||
fields.cardholderName = {};
|
||||
}
|
||||
|
||||
return {
|
||||
fields: {
|
||||
cardholderName: {} // optionally pass this to show the card holder name
|
||||
},
|
||||
fields: fields,
|
||||
styles: this.remove_keys_with_empty_string(this.axoConfig.style_options)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -190,6 +190,7 @@ class AxoManager {
|
|||
'focusBorderColor' => $this->settings->has( 'axo_style_input_focus_border_color' ) ? $this->settings->get( 'axo_style_input_focus_border_color' ) : '',
|
||||
),
|
||||
),
|
||||
'name_on_card' => $this->settings->has( 'axo_name_on_card' ) ? $this->settings->get( 'axo_name_on_card' ) : '',
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue