diff --git a/modules/ppcp-wc-gateway/src/Processor/ThreeDSecureHandlingTrait.php b/modules/ppcp-wc-gateway/src/Processor/ThreeDSecureHandlingTrait.php new file mode 100644 index 000000000..a7ed71792 --- /dev/null +++ b/modules/ppcp-wc-gateway/src/Processor/ThreeDSecureHandlingTrait.php @@ -0,0 +1,76 @@ +payment_source(); + if ( ! $payment_source ) { + return; + } + + $authentication_result = $payment_source->properties()->authentication_result ?? null; + + if ( $authentication_result ) { + $card_authentication_result_factory = new CardAuthenticationResultFactory(); + $result = $card_authentication_result_factory->from_paypal_response( $authentication_result ); + + $three_d_response_order_note_title = __( '3DS authentication result', 'woocommerce-paypal-payments' ); + /* translators: %1$s is 3DS order note title, %2$s is 3DS order note result markup */ + $three_d_response_order_note_format = __( '%1$s %2$s', 'woocommerce-paypal-payments' ); + $three_d_response_order_note_result_format = '