Why am I getting these errors with the Stripe Payment Gateway?

[21-Aug-2015 20:21:07 UTC] Stripe Notice: Undefined property of Stripe_Customer instance: cards
[21-Aug-2015 20:21:26 UTC] Stripe Notice: Undefined property of Stripe_Customer instance: cards
[21-Aug-2015 20:21:56 UTC] Stripe Notice: Undefined property of Stripe_Customer instance: cards
[21-Aug-2015 20:23:15 UTC] Stripe Notice: Undefined property of Stripe_Customer instance: cards
[21-Aug-2015 20:23:31 UTC] Stripe Notice: Undefined property of Stripe_Customer instance: cards
[21-Aug-2015 23:02:49 UTC] WordPress database error Duplicate entry '0' for key 'PRIMARY' for query
INSERT INTO vs_pro_sites (blog_ID, expire, level, gateway, term, amount, is_recurring)
VALUES (0, '1442881969', 1, 'stripe', '1', '9.99', 1) made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/kleo/page.php'), get_template_part, locate_template, load_template, require('/themes/kleo/content-page.php'), the_content, apply_filters('the_content'), call_user_func_array, ProSites->checkout_output, apply_filters('psts_primary_checkout_table'), call_user_func_array, ProSites_View_Front_Checkout::render_checkout_page, ProSites_View_Front_Gateway::render_checkout, call_user_func, ProSites_Gateway_Stripe::process_checkout_form, ProSites->extend
[21-Aug-2015 23:03:14 UTC] Stripe Notice: Undefined property of Stripe_Customer instance: cards

    • Ken

      Hi Anang,

      Sorry if my last reply was a little harsh, I am not a fan of forum support. I still have had no luck making any progress, and am left with only one option, and that is to allow payment via an upgrade (after they setup a free account). I am convinced it must be related to the API version I have with Stripe. Another clue to the puzzle is that when trying to upgrade an account it presents you with the "Existing Card" screen (see attached). You will notice that the last 4 digits are not displayed as they should be.

      I also reviewed my server security settings and basically removed anything that could even remotely affect the transaction, no change.

      I have extended site access due to the weekend. Stripe is in test mode if you want to setup accounts, run payments, etc.

      Let me know if you guys have any ideas.

      Thanks,
      Ken

  • Ken

    Hello Anang,

    PLEASE READ MY RESPONSE BEFORE ASSUMING I AM AN AMATEUR AND GIVE ME THE CANNED RESPONSE!

    I will try to be as concise as possible. I am using a clean install WP 4.3 Multi-Site. The only plugins installed are WPMUDEV Dashboard and WPMUDEV ProSites. The only gateway I have activated is the Stripe Gateway. The theme is Twenty Fifteen.

    These error types:
    [21-Aug-2015 20:21:07 UTC] Stripe Notice: Undefined property of Stripe_Customer instance: cards
    [21-Aug-2015 20:21:26 UTC] Stripe Notice: Undefined property of Stripe_Customer instance: cards
    [21-Aug-2015 20:21:56 UTC] Stripe Notice: Undefined property of Stripe_Customer instance: cards

    Occur after making the initial payment. It is a string of three.

    The WP Database error occurs when attempt to pay for a second site on the same account:

    [21-Aug-2015 20:23:31 UTC] Stripe Notice: Undefined property of Stripe_Customer instance: cards
    [21-Aug-2015 23:02:49 UTC] WordPress database error Duplicate entry '0' for key 'PRIMARY' for query
    INSERT INTO vs_pro_sites (blog_ID, expire, level, gateway, term, amount, is_recurring)
    VALUES (0, '1442881969', 1, 'stripe', '1', '9.99', 1) made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/kleo/page.php'), get_template_part, locate_template, load_template, require('/themes/kleo/content-page.php'), the_content, apply_filters('the_content'), call_user_func_array, ProSites->checkout_output, apply_filters('psts_primary_checkout_table'), call_user_func_array, ProSites_View_Front_Checkout::render_checkout_page, ProSites_View_Front_Gateway::render_checkout, call_user_func, ProSites_Gateway_Stripe::process_checkout_form, ProSites->extend
    [21-Aug-2015 23:03:14 UTC] Stripe Notice: Undefined property of Stripe_Customer instance: cards

    The user experience when paying for a second account is FAIL, the screen flashes and says the account expires that day. However, when checking the account history, the payments were accepted and the account was updated appropriately. The customer goes away bewildered wondering if we just charged him and didn't give him anything.

    The same behavior as above occurs if trying to pay for a new account on sign-up. Screen flash, expiry same day, nothing else. Customer dazed and runs away. And, again looking in the logs, payments posted, dates extended, etc. Customer experiences failure.

    I have spent most of this morning reviewing the change logs for both ProSites and the Stripe API. Running tests etc. Here is what I found and the reason I believe the the Stripe API in ProSites is broken:

    Full changelog here:
    https://stripe.com/docs/upgrades

    2015-02-18
    The status attribute on Charges now takes the value succeeded if the charge succeeded (previously it took the value paid in that situation).

    MAJOR
    The 'card' attribute is no longer returned on Charges. You should now use the 'source' attribute instead. If you only have card charges then you can use source exactly as you used card. Otherwise, you should check the object attribute of the source to determine what type of payment source it is. If the source has object='card' then it is a card object, and is identical to the card subhash returned on Charges in older API versions. Older API versions return both the card attribute and the source attribute.

    MAJOR
    The 'cards' and 'default_card' attributes are no longer returned on Customers. You should now use 'sources' and 'default_source' respectively. The customer.card.* and customer.bank_account.* webhooks are now named customer.source.*. If you only have cards attached to customers (as opposed to payment sources of other types) then you can use the new attributes exactly as you would the old ones. If you have payment sources of multiple types, then the sources list contains heterogeneous objects and you can check the object attribute of each source to determine its format. Older API versions return both the new and the old attributes.

    When these values are not returned the ProSites script, while posting the response does not know what to do with the value 'source' since it is expecting 'card'. This also breaks the ability for the customer to use his saved card info (at least the last 4 digits aren't returned, I did not test if the token is there or not).

    I would appreciate it if you would have the developer prepare a patch for this ASAP and work it into the next update. February is too long to wait. The earliest I can roll my Stripe API back is July 28. So any new Stripe users will have the same problems as I.

    On another note, looks like big issues with the PayPal gateway issue as well. Bad dates, etc. I will open another ticket for that.

    I have granted support access, you will be able to check my system (you will see it is very up-to-date).

    My project is pretty much dead if there are recurring problems with keeping the ProSites script viable. Payment gateway failures, bugs = not viable.

    Ken

  • Anang

    Hi Ken

    No worries :slight_smile: I know how frustrated to face a bug and it's on weekend :slight_smile:

    I have tried on my installation with WP_DEBUG on, but I can't find the errors, also I tried with your site, it's also not prompt me with errors. Could you confirm this is the right page ?http://bit.ly/1JwBsXc

    I attached screenshots when I tried on your site. Any chance you have fixed it ? If not, could you give me more detail steps to reproduced the error ? Also could you revoke and re-grant access again ?

    Looking forward for your response :slight_smile:

    Best Regards

  • Ken

    Hi Anang,

    Thank you for looking into this. Weekend? What is that? I work 14hrs day/7 days week :slight_smile:!

    I have revoked and re-granted access. Yes, that is the correct site. I did manage to get the system to behave better by totally eliminating the use of the default WP sign up form, and have started to build out the site. There are still some issues tough.

    1. Every time a "paid" account page is visited it kicks off this error in my error log file.

    [25-Aug-2015 11:50:24 UTC] Stripe Notice: Undefined property of Stripe_Customer instance: cards
    (my log file is full of lines and lines of this same notice. I know it is just a notice, but this notice tells us something is wrong, probably relates to API versions and the last 4 digits of CC).

    2. When a customer pays for a 2nd account. I get the message "There are pending changes to your account. This message will disappear once these pending changes are completed." It won't go away. (I no longer get the WP database error, since I switched to ProSites checkout page and abandoned the WP signup form.)

    I have been prototyping this model for over a year now, failures continue to make it better and stronger. When I saw the recent upgrades to ProSites I got re-energized. Maybe there is light at the end of the tunnel :slight_smile:

    Feel free to test some more, especially multiple sites on same account with payment. <!-- that seems to be the biggest issue. I will be testing as well. Not sure I am even going to implement PayPal at this time, the Stripe gateway is really nice when it is behaving.

    Best Regards,
    Ken

  • Anang

    Hi Ken

    1. Every time a "paid" account page is visited it kicks off this error in my error log file.

    [25-Aug-2015 11:50:24 UTC] Stripe Notice: Undefined property of Stripe_Customer instance: cards
    (my log file is full of lines and lines of this same notice. I know it is just a notice, but this notice tells us something is wrong, probably relates to API versions and the last 4 digits of CC).

    I will flag the Developer prior this API changes, and will inform you if there's updates from Developer.

    2. When a customer pays for a 2nd account. I get the message "There are pending changes to your account. This message will disappear once these pending changes are completed." It won't go away.

    This error message usually because Stripe transaction is still pending or Stripe can't access your webhook to tell Pro Sites if the payment is already completed. I have checked that your webhook is accessible , could you check that you enter correct Webhook URL on your Stripe account ? You can find Stripe webhook on Stripe gateway settings.

    Hope you have a great day :slight_smile:

    Best Regards

  • Anang

    Hi Ken

    Thanks for the access :slight_smile: Nothing wrong with the logs, all transactions is executed with no problem. I also tested this on my installation and got same notification. I check on the code level it seems the reset status code is there, but somehow not executed (resetting payment status). And then I found this thread :
    https://premium.wpmudev.org/forums/topic/there-are-pending-changes-to-your-account#post-899538

    Have you tested it with Stripe Live Mode ? I you still get the issues on Live Mode, I will flag Developer for this issues.

    Let me know the result of testing with Stripe Live Mode :slight_smile: and have a great day :slight_smile:

    Best Regards

  • Ken

    Hi Anang,

    OK, yes, in live mode this message does not appear when making payment on the second account. However, there are not problems along the way. Here is what is happening now.

    Sign up for free account - Result - Perfect
    Upgrade free account - Result - Perfect

    The problem starts when you setup a second account.

    Once the second account is setup, the "Your Account" link in the 1st account displays properly in the dashboard (pix), but when you click it to check the status of the account or to upgrade the account the prosites page says the account is still a free account test827a (pix). The account is still flagged as pro-plus but the page says otherwise. test827b is still a free account. I left these two test accounts as they are so you can see. Also, when trying to pay for the second account the last 4 digits and WP password boxes are not displayed. It is displayed if you pay for a single account (pix) then try and upgrade that account.

    Now if you go ahead and make a payment on the second account the world is a beautiful place and all the accounts appear to have proper status etc. Example of this is test21 and test22.

    I think we need to focus in on what is happening when the second account is created under the same user. This appears to be the weak link, mulitple accounts on same user is critical to my business model so we need to figure this out.

    I am going to leave these accounts alone until you can take a look:

    test21 - test22
    test827a - test827b

    I hope this makes since and sheds more light on the situation. The account is still in live mode. You can switch to whatever you need, you have the credentials still. I will extend support access as well. Also still kicking off "Stripe Notice: Undefined property of Stripe_Customer instance: cards" in error log file

    Thanks,
    Ken

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.