Skip to content

Commit

Permalink
Add 3d secure contingency settings
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexP11223 committed Aug 20, 2021
1 parent e8a44f9 commit 31bd954
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 41 deletions.
47 changes: 47 additions & 0 deletions modules/ppcp-wc-gateway/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -1804,6 +1804,53 @@ static function ( $container ): AuthorizeOrderActionNotice {
),
'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',
'class' => array(),
'input_class' => array( 'wc-enhanced-select' ),
'default' => 'SCA_WHEN_REQUIRED',
'desc_tip' => false,
'options' => array(
'SCA_WHEN_REQUIRED' => __( 'When required', 'woocommerce-paypal-payments' ),
'3D_SECURE' => __( 'Always', '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'] );
Expand Down
41 changes: 0 additions & 41 deletions modules/ppcp-wc-gateway/src/Settings/class-settingsrenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,6 @@ class="woocommerce-help-tip"
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();
}
Expand Down Expand Up @@ -450,45 +448,6 @@ private function render_dcc_not_active_yet() {
<?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.
*/
Expand Down

0 comments on commit 31bd954

Please sign in to comment.