• Resolved miike

    (@miike)


    Hi Guys,

    The plugin is great and allows enforcing of 3D Secure using the optional filter.

    However, is there a way to only allow 3D Secure payments via Stripe.

    Basically, I do not want to accept any cards that is not able to be processed and enforced to use Stripe.

    This would allow to enforce 100% liability shift to the purchaser.

    Thanks,
    Mike

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor royho

    (@royho)

    Hello,

    There is however requires some custom coding which we cannot help with here. But to point you into right direction look into this action hook wc_gateway_stripe_process_payment and you get find the reference to that in the docs here https://docs.woocommerce.com/document/stripe/

    • This reply was modified 6 years, 7 months ago by royho.
    Luminus Alabi

    (@luminus)

    Automattic Happiness Engineer

    @miike,

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

    Hello @miike,

    wc_gateway_stripe_process_payment action hook called after payment is processed, so we need to handle this differently.

    First, we can capture payment false if payment isn’t 3D secure, then we can failed this order.

    add_action( 'wc_gateway_stripe_process_response', 'prefix_wc_gateway_stripe_process_response', 20, 2 );
    function prefix_wc_gateway_stripe_process_response( $response, $order ){
    	if($response->source->type == 'three_d_secure'){
    		$order->update_status('completed', 'order_note'); ####
    	}elseif($response->source->type == 'card'){
    		$order->update_status('failed', 'order_note'); ####
    	}
    }
    add_filter('wc_stripe_generate_payment_request', 'prefix_wc_stripe_generate_payment_request', 20, 3);
    function prefix_wc_stripe_generate_payment_request($post_data, $order, $prepared_source){
    	if($response->source_object->type != 'three_d_secure'){ 
    		$post_data['capture'] = 'false';
    	}
    	return $post_data; 
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Accepting only 3D Secure payments’ is closed to new replies.