• Resolved deepsea

    (@deepsea)


    Hi Stephen,

    First of all, thanks for this great work.

    I have been trying to get this to work on my website. However, I am facing some problems. Specifically, when a user is logged in, I get the following error

    Error: Invalid string: {“amount”=>”2348”, “currency”=>”usd”, “token”=>”tok_111111111111111111”, “description”=>”Charge for %sxxxxxxxxx@yahoo.com”, “chosen_card”=>”0”, “card”=>{“name”=>”aaa aaa”, “billing_email”=>”xxxxxxxxx@yahoo.com”, “address_line1″=>”100 Main Street”, “address_line2″=>”Apt 1111”, “address_zip”=>”93025”, “address_state”=>”CA”, “address_country”=>”US”}, “errors”=>””}
    Transaction Error: Could not complete your payment.

    The payment attempt gets hit in the backend under order in woocommerce. However, the status is pending. Also, the following order note with empty message is added to the order page in the backend

    S4WC Credit Card Payment Failed with message: “”

    Finally, no payment shows up at the dashboard of stripe.

    Note that the above phenomenon only happens if a user is logged in.

    It would be great if you could look into this.

    Thanks.

    Simon

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

Viewing 15 replies - 1 through 15 (of 23 total)
  • Plugin Author Stephen Zuniga

    (@stephenzuniga001)

    Hi Simon,

    Sorry about that, should be fixed in v1.22 which I just pushed so you will either get an update notification on your site (hopefully) or you can download it from WordPress again and install it manually.

    Let me know if it doesn’t work, but it should be good to go.

    Thanks,
    Stephen

    Thread Starter deepsea

    (@deepsea)

    Thanks Stephen. 1.22 solved the original problem. But I found another bug.

    Initially a user is only a visiter. At check out, he/she checks the ‘create account’ box. An invalid test card was used for payment. after clicking the submit button, the form reset/refresh and NO warning/error shown at the top. An order was created and shown as PENDING. the user got created at the backend of wordpress. NO payment shown up in stripe and NO customer was created in stripe.

    This refresh with no warning only happens if an invalid card was used. If a valid test card was used, the payment will go through successfully with Thank you note and summary at the top of the page.

    It would be great if you could look into this related issue as well. Thanks.

    Simon

    Plugin Author Stephen Zuniga

    (@stephenzuniga001)

    Okay, I’ll look into that. That’s a weird one.

    Thread Starter deepsea

    (@deepsea)

    I shouldn’t say the page refresh. The form actually does the spinning dots thing as usual. But after awhile, the form clears, with no warning/error shown at the top.

    Plugin Author Stephen Zuniga

    (@stephenzuniga001)

    So I was able to replicate the problem and it’s a fault of how I handle errors. Every other plugin just tends to handle errors on the client side and stop the submit. I let the entire form submit to the server so when you get errors, you get all of them.

    The way WooCommerce handles account creation throws a wrench into the whole process. I’ll probably end up posting a bug on their GitHub repo and see what they say about it. I’ll think about it some more before I do that though to see if I can rework my validation to fit the original model better.

    Plugin Author Stephen Zuniga

    (@stephenzuniga001)

    This bug should be fixed now with 1.23

    Thread Starter deepsea

    (@deepsea)

    Thanks. Will test it next week and report back if any problem is encountered.

    Thread Starter deepsea

    (@deepsea)

    It looks like the bug is still there in 1.23.

    Basically the same thing, when an invalid test card was used for the checkout AND the ‘create an account’ box is checked, the following will happen

    1) NO error is displayed on top of the page
    2) account will be created successfully
    3) order will be shown as pending in the backend.
    4) order note with entry ‘S4WC_Gateway Credit Card Payment Failed with message: “Your card has expired.”‘
    5) no transaction record in stripe.

    Bullets 2-5 are valid behavior, the bug lies in bullet 1 because currently no error is displayed.

    Plugin Author Stephen Zuniga

    (@stephenzuniga001)

    Could you try erasing your cache? I think the javascript is cached and that seems like the problem.

    Thread Starter deepsea

    (@deepsea)

    i erased the cache in the browser and also turned off w3 total cache. still the same behavior as described above.

    Plugin Author Stephen Zuniga

    (@stephenzuniga001)

    I’ve already sent this to everyone else hoping for some response but I haven’t gotten anything yet. Could you download the plugin from github here:

    https://github.com/stezu/stripe-for-woocommerce/archive/master.zip

    Install it manually, and let me know if it works. If it does I’ll push it out as 1.24

    Thread Starter deepsea

    (@deepsea)

    Stephen, I tried installing the master version downloaded from github. I got the same behavior.

    Plugin Author Stephen Zuniga

    (@stephenzuniga001)

    This is really strange, there’s really no reason for that to be happening now. It should at the worst be giving you an empty string in card error, not what you’re describing. Could you verify that your api keys are correct and that there aren’t any unnecessary plugins active? Also do you have a link to the site?

    Thanks,
    Stephen

    Thread Starter deepsea

    (@deepsea)

    What’s your email, Stephen? I will email you the link privately.

    Thanks.

    Simon

    Thread Starter deepsea

    (@deepsea)

    I did more testing. Still no error code at the top.

    But when I click My account (after the first failed purchase attempt while creating an account, the user is automatically logged in eventhough there is no error at the top) and try to pay for it using the invalid card, it will show the error.

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘Error: Invalid string: {…} when user is logged in’ is closed to new replies.