Skip to content

Commit

Permalink
Add "No 3DS" option
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexP11223 committed Aug 23, 2021
1 parent 0553ea6 commit b988e08
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,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;
hostedFields.submit({
contingencies: [this.defaultConfig.hosted_fields.contingency],
const contingency = this.defaultConfig.hosted_fields.contingency;
const hostedFieldsData = {
vault: vault
}).then((payload) => {
};
if (contingency !== 'NO_3D_SECURE') {
hostedFieldsData.contingencies = [contingency];
}
hostedFields.submit(hostedFieldsData).then((payload) => {
payload.orderID = payload.orderId;
this.spinner.unblock();
return contextConfig.onApprove(payload);
Expand Down
5 changes: 3 additions & 2 deletions modules/ppcp-wc-gateway/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -1840,8 +1840,9 @@ static function ( $container ): AuthorizeOrderActionNotice {
'default' => 'SCA_WHEN_REQUIRED',
'desc_tip' => false,
'options' => array(
'SCA_WHEN_REQUIRED' => __( 'When required', 'woocommerce-paypal-payments' ),
'3D_SECURE' => __( 'Always', 'woocommerce-paypal-payments' ),
'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,
Expand Down

0 comments on commit b988e08

Please sign in to comment.