mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Fix merge conflicts
This commit is contained in:
commit
31260b61f9
4 changed files with 77 additions and 44 deletions
|
@ -149,10 +149,14 @@ class CreditCardRenderer {
|
|||
const save_card = this.defaultConfig.save_card ? true : false;
|
||||
const vault = document.getElementById('ppcp-credit-card-vault') ?
|
||||
document.getElementById('ppcp-credit-card-vault').checked : save_card;
|
||||
this.currentHostedFieldsInstance.submit({
|
||||
contingencies: ['SCA_WHEN_REQUIRED'],
|
||||
const contingency = this.defaultConfig.hosted_fields.contingency;
|
||||
const hostedFieldsData = {
|
||||
vault: vault
|
||||
}).then((payload) => {
|
||||
};
|
||||
if (contingency !== 'NO_3D_SECURE') {
|
||||
hostedFieldsData.contingencies = [contingency];
|
||||
}
|
||||
this.currentHostedFieldsInstance.submit(hostedFieldsData).then((payload) => {
|
||||
payload.orderID = payload.orderId;
|
||||
this.spinner.unblock();
|
||||
return contextConfig.onApprove(payload);
|
||||
|
|
|
@ -601,6 +601,19 @@ class SmartButton implements SmartButtonInterface {
|
|||
return $this->subscription_helper->cart_contains_subscription();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the 3D Secure contingency settings.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function get_3ds_contingency(): string {
|
||||
if ( $this->settings->has( '3d_secure_contingency' ) ) {
|
||||
return $this->settings->get( '3d_secure_contingency' );
|
||||
}
|
||||
|
||||
return 'SCA_WHEN_REQUIRED';
|
||||
}
|
||||
|
||||
/**
|
||||
* The localized data for the smart button.
|
||||
*
|
||||
|
@ -677,6 +690,7 @@ class SmartButton implements SmartButtonInterface {
|
|||
),
|
||||
),
|
||||
'valid_cards' => $this->dcc_applies->valid_cards(),
|
||||
'contingency' => $this->get_3ds_contingency(),
|
||||
),
|
||||
'messages' => $this->message_values(),
|
||||
'labels' => array(
|
||||
|
|
|
@ -1804,6 +1804,62 @@ return array(
|
|||
),
|
||||
'gateway' => 'dcc',
|
||||
),
|
||||
'3d_secure_heading' => array(
|
||||
'heading' => __( '3D Secure', 'woocommerce-paypal-payments' ),
|
||||
'type' => 'ppcp-heading',
|
||||
'description' => wp_kses_post(
|
||||
sprintf(
|
||||
// translators: %1$s and %2$s is a link tag.
|
||||
__(
|
||||
'3D Secure benefits cardholders and merchants by providing
|
||||
an additional layer of verification using Verified by Visa,
|
||||
MasterCard SecureCode and American Express SafeKey.
|
||||
%1$sLearn more about 3D Secure.%2$s',
|
||||
'woocommerce-paypal-payments'
|
||||
),
|
||||
'<a
|
||||
rel="noreferrer noopener"
|
||||
href="https://woocommerce.com/posts/introducing-strong-customer-authentication-sca/"
|
||||
>',
|
||||
'</a>'
|
||||
)
|
||||
),
|
||||
'screens' => array(
|
||||
State::STATE_ONBOARDED,
|
||||
),
|
||||
'requirements' => array(
|
||||
'dcc',
|
||||
),
|
||||
'gateway' => 'dcc',
|
||||
),
|
||||
'3d_secure_contingency' => array(
|
||||
'title' => __( 'Contingency for 3D Secure', 'woocommerce-paypal-payments' ),
|
||||
'type' => 'select',
|
||||
'description' => sprintf(
|
||||
// translators: %1$s and %2$s opening and closing ul tag, %3$s and %4$s opening and closing li tag.
|
||||
__( '%1$s%3$sNo 3D Secure will cause transactions to be denied if 3D Secure is required by the bank of the cardholder.%4$s%3$sSCA_WHEN_REQUIRED returns a 3D Secure contingency when it is a mandate in the region where you operate.%4$s%3$sSCA_ALWAYS triggers 3D Secure for every transaction, regardless of SCA requirements.%4$s%2$s', 'woocommerce-paypal-payments' ),
|
||||
'<ul>',
|
||||
'</ul>',
|
||||
'<li>',
|
||||
'</li>'
|
||||
),
|
||||
'class' => array(),
|
||||
'input_class' => array( 'wc-enhanced-select' ),
|
||||
'default' => 'SCA_WHEN_REQUIRED',
|
||||
'desc_tip' => true,
|
||||
'options' => array(
|
||||
'NO_3D_SECURE' => __( 'No 3D Secure (transaction will be denied if 3D Secure is required)', 'woocommerce-paypal-payments' ),
|
||||
'SCA_WHEN_REQUIRED' => __( '3D Secure when required', 'woocommerce-paypal-payments' ),
|
||||
'3D_SECURE' => __( 'Always trigger 3D Secure', 'woocommerce-paypal-payments' ),
|
||||
),
|
||||
'screens' => array(
|
||||
State::STATE_ONBOARDED,
|
||||
),
|
||||
'requirements' => array(
|
||||
'dcc',
|
||||
),
|
||||
'gateway' => 'dcc',
|
||||
),
|
||||
);
|
||||
if ( ! defined( 'PPCP_FLAG_SUBSCRIPTION' ) || ! PPCP_FLAG_SUBSCRIPTION ) {
|
||||
unset( $fields['vault_enabled'] );
|
||||
|
|
|
@ -399,8 +399,6 @@ class SettingsRenderer {
|
|||
if ( $this->dcc_applies->for_country_currency() ) {
|
||||
if ( State::STATE_ONBOARDED > $this->state->current_state() ) {
|
||||
$this->render_dcc_onboarding_info();
|
||||
} elseif ( State::STATE_ONBOARDED === $this->state->current_state() && $this->dcc_product_status->dcc_is_active() ) {
|
||||
$this->render_3d_secure_info();
|
||||
} elseif ( ! $this->dcc_product_status->dcc_is_active() ) {
|
||||
$this->render_dcc_not_active_yet();
|
||||
}
|
||||
|
@ -450,45 +448,6 @@ class SettingsRenderer {
|
|||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the 3d secure info text.
|
||||
*/
|
||||
private function render_3d_secure_info() {
|
||||
?>
|
||||
<tr>
|
||||
<th><?php esc_html_e( '3D Secure', 'woocommerce-paypal-payments' ); ?></th>
|
||||
<td>
|
||||
<p>
|
||||
<?php
|
||||
/**
|
||||
* We still need to provide a docs link.
|
||||
*
|
||||
* @todo: Provide link to documentation.
|
||||
*/
|
||||
echo wp_kses_post(
|
||||
sprintf(
|
||||
// translators: %1$s and %2$s is a link tag.
|
||||
__(
|
||||
'3D Secure benefits cardholders and merchants by providing
|
||||
an additional layer of verification using Verified by Visa,
|
||||
MasterCard SecureCode and American Express SafeKey.
|
||||
%1$sLearn more about 3D Secure.%2$s',
|
||||
'woocommerce-paypal-payments'
|
||||
),
|
||||
'<a
|
||||
rel="noreferrer noopener"
|
||||
href="https://woocommerce.com/posts/introducing-strong-customer-authentication-sca/"
|
||||
>',
|
||||
'</a>'
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the DCC onboarding info.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue