Support » Plugin: WooCommerce Stripe Payment Gateway » Saved Cards versus Payment Methods? Saved cards have disappeared!

  • Colin

    (@colinsafranek)


    After updating to the latest WC 2.6, and the latest Stripe 3.0.2, the old “Saved Cards” section on the my account page has been replaced by the “Payment Methods” endpoint section, but unfortunately I do not see the saved cards anymore.

    I should mention that I am testing the newest WC version on my staging site, so I am wondering if the Stripe Gateway extension somehow disables the saved cards if it detects that it is operating on a staging domain (??). If that is the case, then it would explain the disappearance of the saved cards, but I don’t recall this being the case in the past when I’ve testing plugin updates on my staging site. I remember seeing the saved cards where they were supposed to be…

    Even when I revert back to my old customized my-account template, the saved cards section (which before had a saved card) is now empty. I’m hoping this does not happen if/when I decide to update to WC 2.6 on my live website.

    Any ideas about what might be going on here?

    thanks in advance!

    https://wordpress.org/plugins/woocommerce-gateway-stripe/

Viewing 15 replies - 1 through 15 (of 19 total)
  • Colin

    (@colinsafranek)

    UPDATE:

    I have confirmed that this is related to the new “Payment Methods” endpoint (i.e. the output of woocommerce_account_payment_methods();).

    1. I created a new staging site with WC 2.5.5 (the version prior to 2.6 release), and Stripe 3.0.2. This is what the My Account page looked like (you’ll notice 2 instances of the “Saved Cards” section, one is the default which the Stripe plugin hooks into the woocommerce_after_my_account hook, and the other is my own custom integration, in which I hooked WC_Gateway_Stripe_Saved_Cards::output into a custom action hook): [screencap]
    2. Then I updated to WC 2.6 and where the default Stripe “Saved Cards” output was previously hooked (i.e. woocommerce_after_my_account) became empty.
      Additionally, the Saved Cards output function I was hooking into my tab container (i.e. WC_Gateway_Stripe_Saved_Cards::output) began throwing an error: [screencap]
    3. So I removed my custom hook, and replaced it with the new WC 2.6 “Payment Methods” output function woocommerce_account_payment_methods();, and this is what I saw: [screencap]
    4. Finally, I temporarily renamed my theme’s customized woocommerce/myaccount/myaccount.php template override, and allowed the default WC 2.6 core myaccount.php template file to be used instead. This is what I saw: [screencap]

    As you can see, where there was once a saved credit card, there is now just a message saying “no saved methods found”. All the other my-account endpoints rendered their respective content properly (i.e. “Dashboard”, “Orders”, “Subscriptions”, “Addresses”, “Account Details”, etc.), but no saved cards were displayed in the “Payment Methods” endopint.

    Has anyone else come across this?

    It should also be noted that no WC or WP settings were changed during the above test. Here is a screen capture of my staging site’s WooCommerce > Settings > Checkout > Stripe: [screencap]

    If need be I can provide Admin and FTP access to my staging site. You can feel free to contact me at colinsafranek (AT) gmail for access credentials.

    Thanks in advance!

    Colin

    (@colinsafranek)

    P.S.

    I’m sorry to do this, but until I hear a response from either, I am posting this issue to both the WooThemes support system AND this support thread, because I’m unsure of which one is recommended. Let me know for future reference.

    Cheers!

    Thanks for posting. I haven’t updated to WC 2.6 yet, and I’m glad I came across this post.

    Ok so from my testing, it looks like this is isn’t going to be a simple fix. I tested on my cloned site on localhost, and pretty much came up with the results that Colin did. I did some testing beyond that, and here’s what I’ve determined:

    When I upgraded to WC 2.6 the saved card on my user account no longer appeared, however I was able to add a new card to the account, and when I did, the new card appeared just fine. I checked the customer ID in my stripe dashboard, and sure enough, that new card was added to the account along with the old card. So the old card was still in my stripe account, but like I said it was no longer appearing on my website under the new “Payment Methods” tab.

    So I decided to dig into the database and see what I could find. Prior to WC 2.6, the stripe customer ID which is stored in the wp_usermeta table under the _stripe_customer_id Meta Key. From what I understand (and I could be wrong) but it doesn’t look like your stripe card_id numbers are stored on your server anywhere. When you visit the My Account page, the website looks for your stripe customer ID, and then communicates with the stripe servers to find out which cards are on file. I confirmed this by manually adding a new card to my stripe customer ID through the stripe dashboard, and then that card appeared on my website’s My Account page (again, this is prior to WC 2.6)

    So then I upgraded to WC 2.6 and I discovered that there are no two new database tables that are exclusively for managing card information:

    wp_woocommerce_payment_tokens
    wp_woocommerce_payment_tokenmeta

    The wp_woocommerce_payment_tokens table stores the card_ID and associated it with the wordpress user account ID.

    The wp_woocommerce_payment_tokenmeta tables contains additional information about each card: Card Type, Last 4 digits, Expiration Month, and Expiration Year. Using phpMyAdmin, I was able to manually add all the details of the old card to the new woocommerce payment token tables, and once I did, the old card appeared where it should right next to the new card.

    So in conclusion, it looks like the only way to get the saved cards to appear in WC 2.6 moving forward… The developers are going to have to make some sort of script so that the details of each card can be retrieved from Stripe’s server and then stored on the new payment tokens table. I don’t know how much work will be involved in this, or whether or not there are any plans of this happening.

    Colin, please keep us posted when the people in the WooThemes support system get back with you. Thanks!

    Colin

    (@colinsafranek)

    @mrfrent37 thank you. This is extremely helpful. I’ve alerted the woothemes support crew of your tests and I’ll let you know what they say.

    Cheers!

    Plugin Support Praveen

    (@spraveenitpro)

    Automattic Happiness Engineer

    Hi Colin and MrFent37

    I am currently checking this and will post my results here soon,

    Cheers!

    Plugin Support Praveen

    (@spraveenitpro)

    Automattic Happiness Engineer

    Hi Colin

    The developers are currently on this and it will be resolved in the next coming update,

    Praveen

    Colin

    (@colinsafranek)

    @spraveenitpro Thanks so much!

    Yes, thank you!

    @colin I just discovered that if you log into an account that is affected by this issue. (the user’s previously saved card doesn’t show up) if you visit the checkout page first, then go back to the Payment Methods, the card will appear.

    Colin

    (@colinsafranek)

    @spraveenitpro Any updates on this issue?

    ETA on the next version release?

    Much appreciated.

    Plugin Support Praveen

    (@spraveenitpro)

    Automattic Happiness Engineer

    Hi Colin

    As said earlier this would be resolved in the upcoming release which is still under active development, it is expected in the 3.0.3 which is upcoming,

    Have a nice day

    Hi Praveen,

    Any idea when 3.0.3 will be released?

    Running into the same problem.

    Thanks

    Colin

    (@colinsafranek)

    @spraveenitpro Hi Praveen,

    I see that version 3.0.3 has already been released, but when I test this new version with the latest WooCommerce the saved card info disappears still.

    If I use the workaround that @mrfrent37 mentioned above, I can restore a user’s saved card info (log in as a registered customer, and then initiate a checkout process, then go back to the saved cards section, and the info is there). But this is not a practical solution because I can’t feasibly do this for all my registered customers one-by-one. So unless there is a way to do this sort of reset for all my users at once… will you have a fix for this any time soon? Was the fix supposed to be shipped in 3.0.3?

    Please help.

    Thanks.

    Here is the developer thread on github:

    https://github.com/woocommerce/woocommerce-gateway-stripe/issues/19

    Looks like the fix for this has been pushed back to 3.1? Although I haven’t seen any new comments on this issue for a while. Until then, yes the only workaround I’ve found is to log into each person’s account, go to the checkout page (something needs to be in their cart) and then if you go back to the my account page, the saved payment methods will be restored.

    Like you said though, not practical because you have to do it one account at a time.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Saved Cards versus Payment Methods? Saved cards have disappeared!’ is closed to new replies.