Payment method won’t save automatically

[ad_1]

Hey there, @acasoftware! Thanks for contacting us. I’m happy to help you.

Which plugin are you using to have the subscriptions?

Can you please share what you have already tried so we know where to go from here?

Just to confirm, if you go to WooCommerce > Settings > Payments > Stripe > Settings the Enable payments via saved cards option is checked, right?

Do you have simple products on your website? Are you able to use saved cards on them?

Furthermore, I’d like to understand your site properly. Please share with us the necessary information below for us to investigate the issue further:

System Status Report which you can find via WooCommerce > Status > Get system report > Copy for support.
Fatal error logs (if any) under WooCommerce > Status > Logs. Then you can use the selector to search for Fatal Errors.
You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.

Looking forward to your reply.

Have a wonderful day!

I’m using: Subscriptions For WooCommerce Pro 2.2.7

I’ve added these two code snippets to the functions.php page:

add_action( ‘wp_footer’, function () { ?>

<?php } );
add_filter( 'wc_stripe_force_save_source', '__return_true' );

Yes, “Enable payments via saved cards” is checked

I only have 1 subscription product on my site. I’ve tried test purchases and real purchases, but the payment method isn’t saving after the initial purchase automatically.

` WordPress Environment

WordPress address (URL): https://acutabovesoftware.com
Site address (URL): https://acutabovesoftware.com
WC Version: 8.5.2
REST API Version: ✔ 8.5.2
WC Blocks Version: ✔ 11.8.0-dev
Action Scheduler Version: ✔ 3.7.1
Log Directory Writable: ✔
WP Version: 6.4.3
WP Multisite: –
WP Memory Limit: 16 GB
WP Debug Mode: ✔
WP Cron: ✔
Language: en_US
External object cache: ✔ Server Environment

Server Info: Apache/2.4.58 (Debian)
PHP Version: 7.4.33
PHP Post Max Size: 500 MB
PHP Time Limit: 300
PHP Max Input Vars: 2500
cURL Version: 7.64.0
OpenSSL/1.1.1n

SUHOSIN Installed: –
MySQL Version: 5.5.5-10.4.20-MariaDB-1:10.4.20+maria~buster-log
Max Upload Size: 500 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔ Database

WC Database Version: 8.5.2
WC Database Prefix: wp_
Total Database Size: 8.87MB
Database Data Size: 6.32MB
Database Index Size: 2.55MB
wp_woocommerce_sessions: Data: 0.34MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_order_itemmeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_actions: Data: 0.17MB + Index: 0.19MB + Engine InnoDB
wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_logs: Data: 0.13MB + Index: 0.13MB + Engine InnoDB
wp_bv_fw_requests: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_bv_ip_store: Data: 0.33MB + Index: 0.27MB + Engine InnoDB
wp_bv_lp_requests: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_comments: Data: 0.06MB + Index: 0.09MB + Engine InnoDB
wp_jetpack_sync_queue: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_lic_key_tbl: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_lic_reg_domain_tbl: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_lmfwc_activations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_lmfwc_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_lmfwc_application: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_lmfwc_application_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_lmfwc_application_release: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_lmfwc_application_release_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_lmfwc_generators: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_lmfwc_licenses: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_lmfwc_licenses_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_lmfwc_products_installed_on: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_options: Data: 0.38MB + Index: 0.06MB + Engine InnoDB
wp_postmeta: Data: 0.22MB + Index: 0.06MB + Engine InnoDB
wp_posts: Data: 3.05MB + Index: 0.06MB + Engine InnoDB
wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_usermeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wc_admin_notes: Data: 0.06MB + Index: 0.00MB + Engine InnoDB
wp_wc_admin_note_actions: Data: 0.05MB + Index: 0.02MB + Engine InnoDB
wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_orders: Data: 0.02MB + Index: 0.11MB + Engine InnoDB
wp_wc_orders_meta: Data: 0.11MB + Index: 0.22MB + Engine InnoDB
wp_wc_order_addresses: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_operational_data: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wpfm_backup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wpmailsmtp_debug_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wpmailsmtp_emails_log: Data: 0.03MB + Index: 0.03MB + Engine InnoDB
wp_wpmailsmtp_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wpml_mails: Data: 0.20MB + Index: 0.02MB + Engine InnoDB Post Type Counts

attachment: 31
custom_css: 1
nav_menu_item: 7
page: 14
post: 3
product: 2
revision: 18
shop_order_placehold: 31
wp_global_styles: 1 Security

Secure connection (HTTPS): ✔
Hide errors from visitors: ❌Error messages should not be shown to visitors. Active Plugins (12)

Akismet Anti-spam: Spam Protection: by Automattic - Anti-spam Team – 5.3.1
Breeze: by Cloudways – 2.1.3
License Manager for WooCommerce (Premium): by WP Experts – 1.1
MalCare WordPress Security Plugin - Malware Scanner, Cleaner, Security Firewall: by MalCare Security – 5.47
Subscriptions For WooCommerce: by WP Swings – 1.6.0
Preview E-mails for WooCommerce: by Digamber Pradhan – 2.2.1
WooPayments: by Automattic – 7.1.0
Subscriptions For WooCommerce Pro: by WP Swings – 2.2.7
WooCommerce: by Automattic – 8.5.2
WP Mail Logging: by WP Mail Logging Team – 1.12.0
WP Mail SMTP Pro: by WP Mail SMTP – 3.11.1
Zoho SalesIQ: by Zoho SalesIQ Team – 2.0.2 Inactive Plugins (2)

License Manager for WooCommerce: by LicenseManager – 3.0.5
WP Mail SMTP: by WP Mail SMTP – 3.11.1 Dropin Plugins (2)

advanced-cache.php: advanced-cache.php
object-cache.php: Object Cache Pro (Drop-in) Must Use Plugins (1)

Object Cache Pro (MU): by Rhubarb Group – 1.20.2 Settings

API Enabled: –
Force SSL: –
Currency: USD ($)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)

Connected to Woo.com: –
Enforce Approved Product Download Directories: ✔
HPOS feature screen enabled: ✔
HPOS feature enabled: ✔
Order datastore: Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore
HPOS data sync enabled: – WC Pages

Shop base: #342 - /shop/
Cart: #343 - /cart/
Checkout: #344 - /checkout/
My account: #345 - /my-account/
Terms and conditions: ❌ Page not set Theme

Name: Divi
Version: 4.24.0
Author URL: http://www.elegantthemes.com
Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
WooCommerce Support: ✔ Templates

Overrides: – WooPayments

Version: 7.1.0
Connected to WPCOM: Yes
WPCOM Blog ID: 228051256
Account ID: acct_1OYc1wFx90At1SQH
Payment Gateway: Enabled
Test Mode: Disabled
Enabled APMs: card
WooPay: Disabled
WooPay Incompatible Extensions: No
Apple Pay / Google Pay: Enabled (product,cart,checkout)
Fraud Protection Level: basic
Multi-currency: Disabled
Public Key Encryption: Enabled
Auth and Capture: Enabled
Documents: Disabled
Logging: Enabled Admin

Enabled Features: activity-panels
analytics
product-block-editor
coupons
core-profiler
customer-effort-score-tracks
import-products-task
experimental-fashion-sample-products
shipping-smart-defaults
shipping-setting-tour
homescreen
marketing
mobile-app-banner
navigation
onboarding
onboarding-tasks
product-variation-management
product-virtual-downloadable
product-external-affiliate
product-grouped
remote-inbox-notifications
remote-free-extensions
payment-gateway-suggestions
shipping-label-banner
subscriptions
store-alerts
transient-notices
woo-mobile-welcome
wc-pay-promotion
wc-pay-welcome-page

Disabled Features: customize-store
minified-js
new-product-management-experience
product-linked
settings
async-product-editor-category-field

Daily Cron: ✔ Next scheduled: 2024-02-13 22:12:05 +00:00
Options: ✔
Notes: 65
Onboarding: completed Action Scheduler

Canceled: 24
Oldest: 2024-01-31 12:12:04 +0000
Newest: 2024-02-13 16:19:08 +0000

Complete: 413
Oldest: 2024-01-14 22:13:10 +0000
Newest: 2024-02-13 16:55:06 +0000

Failed: 4
Oldest: 2024-01-14 22:16:30 +0000
Newest: 2024-02-13 16:53:31 +0000

Pending: 12
Oldest: 2024-02-13 17:05:06 +0000
Newest: 2024-02-20 03:48:59 +0000 Status report information

Generated at: 2024-02-13 17:00:56 +00:00
`

  • This reply was modified 3 hours, 11 minutes ago by acasoftware.

Sorry, that first code at the top of my message didn’t come through properly:

add_action( ‘wp_footer’, function () { ?>

    <script>

        /* Making new payment save checkbox checked by default */

        jQuery(‘#wc-stripe-new-payment-method’).prop(‘checked’, true);

    </script>

    <?php };

add_filter( ‘wc_stripe_force_save_source’, ‘__return_true’ );

  • This reply was modified 3 hours, 11 minutes ago by acasoftware.

Hey, @acasoftware!

Thank you for the information.

Would you be able to create a simple product to test if you are able to use saved cards with it?

This way we can check if the issue is with the Stripe plugin or Subscriptions For WooCommerce Pro: by WP Swings.

Looking forward to your reply.

Have a wonderful day!

Yes, if I manually add a card to my account in the portal it will be available for use at the checkout form. I don’t think this has anything to do with the Woocommerce Checkout Form not automatically saving the card on file during checkout, but unsure.

Hey, @acasoftware!

Thank you for the video, it did clarify the issue.

Now I understand that what is not working is the custom code you added to make the save payment method required, right?

While we can’t provide support for code customization as per our support policy, we do our best to offer advice and direct you to appropriate resources.

You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there too.

Having said that, please note that saving of sensitive details such as credit card information, require a mandatory and explicit approval from the user. They need to be fully aware, and approve that their card details are stored, as a part of the payment gateway process. So we recommend checking with a lawyer, or an expert in this to make sure everything is set up correctly.

I’m going to leave it open for a bit to see if anyone is able to chime in and help you out further.

Please let us know if there’s anything else we can assist you with.

Have a wonderful day!

Thanks for your help. I think the simple solution would be for you guys to update your checkout form process to allow for that checkbox to be required before placing the order. That’s a very simple solution that will not have any legal ramifications.
You could easily add this as an option in the Woocommerce Settings.

I will try and find help elsewhere.

Hello @acasoftware,

I understand your concern about having a required checkbox in the checkout form. As of now, this feature is not available within WooCommerce.

We appreciate your suggestions and are always looking for ways to improve our products and services, and input from users like you is invaluable.

If you have a few minutes, we’d love if you could leave us a review: https://projectdmc.org/support/plugin/woocommerce/reviews/

Cheers!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer