Skip to content

Commit

Permalink
Fix 3DS authentication for legacy cards
Browse files Browse the repository at this point in the history
  • Loading branch information
Timur Karimov committed Apr 18, 2023
1 parent 1996305 commit acf9e3b
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions includes/class-wc-payment-gateway-wcpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -1108,20 +1108,24 @@ public function process_payment_for_order( $cart, $payment_information, $schedul
$request->set_off_session( $payment_information->is_merchant_initiated() );
$request->set_payment_methods( $payment_methods );
$request->set_cvc_confirmation( $payment_information->get_cvc_confirmation() );
$request->set_return_url(
wp_sanitize_redirect(
esc_url_raw(
add_query_arg(
[
'order_id' => $order_id,
'wc_payment_method' => self::GATEWAY_ID,
'_wpnonce' => wp_create_nonce( 'wcpay_process_redirect_order_nonce' ),
],
$this->get_return_url( $order )

if ( 1 === count( $payment_methods ) && 'card' !== $payment_methods[0] ) {
$request->set_return_url(
wp_sanitize_redirect(
esc_url_raw(
add_query_arg(
[
'order_id' => $order_id,
'wc_payment_method' => self::GATEWAY_ID,
'_wpnonce' => wp_create_nonce( 'wcpay_process_redirect_order_nonce' ),
],
$this->get_return_url( $order )
)
)
)
)
);
);
}

// Make sure that setting fingerprint is performed after setting metadata because metadata will override any values you set before for metadata param.
$request->set_fingerprint( $payment_information->get_fingerprint() );
if ( $save_payment_method_to_store ) {
Expand Down

0 comments on commit acf9e3b

Please sign in to comment.