• Resolved Marc

    (@marcleipoldgmailcom)


    Hello,

    Is there a way to disallow prepaid cards at checkout?

    I am offering a free trial on our website, and too many people are using prepaid debit cards to signup. Then when their trial period ends, their card (obviously) doesn’t have sufficient funds.

    I know that there is a rule in the Stripe.com dashboard (Block if: card_funding: = ‘prepaid’), but it only applies to charges ($0.01+), and not authorizations (free trials).

    Thanks in advance for your help!

    Best,

    Marc

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

    (@royho)

    Use the following code snippet in your custom theme’s functions.php file.

    add_filter( 'wc_stripe_allow_prepaid_card', '__return_false' );

    Thread Starter Marc

    (@marcleipoldgmailcom)

    Hi Roy,

    Thanks for the prompt response.

    I added that code snippet to my child theme’s functions.php file, but now my entire checkout page is blank cannot seem to access my cart either.

    Am I missing anything here? Is this a PHP formatting issue or should I include more code?

    P.S. I am PHP illiterate, so I appreciate the hand holding on this.

    Plugin Contributor royho

    (@royho)

    Make sure you add it after the opening PHP tag <?php

    Thread Starter Marc

    (@marcleipoldgmailcom)

    Ok, I found the problem, I had an extra space after the closing php “?>” tag on my functions.php file.

    The site is fixed, and I the prepaid card issue should be fixed.

    Thanks for your help Roy!

    • This reply was modified 7 years, 6 months ago by Marc.
    Thread Starter Marc

    (@marcleipoldgmailcom)

    Hi Roy,

    After a few days after implementing your solution, I noticed that I am still accepting prepaid debit cards through Stripe.

    Why do you think this is still happening and what do I need to do to fix this?

    Thanks again for all of your help.

    Best,

    Marc

    Plugin Contributor royho

    (@royho)

    Hard to say without seeing your code and how you have everything setup.

    Thread Starter Marc

    (@marcleipoldgmailcom)

    I’m happy to send you all of the necessary files or credentials to help get this fixed.

    What do you need from me?

    Thanks,
    Marc

    Plugin Contributor royho

    (@royho)

    You can start by showing a screenshot of the code you pasted.

    Thread Starter Marc

    (@marcleipoldgmailcom)

    Plugin Contributor royho

    (@royho)

    This is what I get on my test site https://cld.wthms.co/79Afns

    As a test, put your Stripe settings into test mode by adding in your test API keys in setting and checkout with the credit card number you see in the screenshot and see what you get.

    Thread Starter Marc

    (@marcleipoldgmailcom)

    In test mode using the prepaid Mastercard it allowed me to complete my order:

    https://screenshotlink.ru/ee527c94b0b0f16554ef94f719f25e81.png

    Plugin Contributor royho

    (@royho)

    Can you verify that snippet of code is running?

    • This reply was modified 7 years, 6 months ago by royho.
    Thread Starter Marc

    (@marcleipoldgmailcom)

    How can I verify that the snippet is running?

    Plugin Contributor royho

    (@royho)

    You can change it to:

    add_filter( 'wc_stripe_allow_prepaid_card', 'marc_allow_prepaid' ); function marc_allow_prepaid( $status ) { error_log( 'prepaid_filtering' ); return false; }

    And go through your checkout a couple times in test mode and the prepaid card number, then check your PHP error logs to see if you see the string ‘prepaid_filtering’.

    Also what version of Stripe are you using?

    Thread Starter Marc

    (@marcleipoldgmailcom)

    So I replaced the code above and tried to checkout with the prepaid MC in test mode a couple of times.

    Both times the payment went through, so I went to the error_log file and found this:

    [29-Aug-2017 15:09:20 UTC] prepaid_filtering
    [29-Aug-2017 15:09:20 UTC] PHP Warning: Module ‘redis’ already loaded in Unknown on line 0
    [29-Aug-2017 15:09:21 UTC] PHP Warning: Module ‘redis’ already loaded in Unknown on line 0
    [29-Aug-2017 15:09:22 UTC] PHP Warning: Module ‘redis’ already loaded in Unknown on line 0
    [29-Aug-2017 15:09:24 UTC] prepaid_filtering
    [29-Aug-2017 15:09:25 UTC] PHP Warning: Module ‘redis’ already loaded in Unknown on line 0
    [29-Aug-2017 15:09:35 UTC] status was called incorrectly. Order properties should not be accessed directly. Backtrace: require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), do_action(‘template_redirect’), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WC_AJAX::do_wc_ajax, do_action(‘wc_ajax_checkout’), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WC_AJAX::checkout, WC_Checkout->process_checkout, WC_Checkout->process_order_payment, WC_Gateway_Stripe_Addons->process_payment, WC_Gateway_Stripe->process_payment, WC_Order->payment_complete, WC_Order->save, WC_Order->status_transition, do_action(‘woocommerce_order_status_changed’), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WC_Subscriptions_Order::maybe_record_subscription_payment, apply_filters(‘woocommerce_payment_complete_order_status’), WP_Hook->apply_filters, call_user_func_array, sp_autocomplete_paid_virtual_orders, WC_Abstract_Legacy_Order->__get, wc_doing_it_wrong. This message was added in version 3.0.

    I am using WooCommerce Stripe Gateway (Version 3.2.3) and I’m using API version 2017-08-15 in my Stripe Dashboard.

    • This reply was modified 7 years, 6 months ago by Marc.
Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Disallow Prepaid Cards’ is closed to new replies.