Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble getting any checkout to load #2

Closed
timothyjoh opened this issue Mar 21, 2018 · 10 comments
Closed

Trouble getting any checkout to load #2

timothyjoh opened this issue Mar 21, 2018 · 10 comments

Comments

@timothyjoh
Copy link

Hey man, I found this fastspring plugin, and it looks so much better written than the one on the wordpress.org repo. I set it up, with a brand new fastspring account, and I am not getting any success.

Here, I will at least detail my steps:
I have everything filled out, including Access Credentials, Webhooks and API username and password

I am trying to use the popup modal, so my URL for that is
dlicoursesonline.onfastspring.com/popup-dlicoursesonline

I have test mode turned on, and error logging.

When I try to checkout (the modal seems to flicker the screen dark, but then it quickly goes away) I get these JS errors :

dlicoursesonline.test.onfastspring.com/popup-dlicoursesonline/builder:1 Failed to load resource: the server responded with a status of 400 ()
fastspring-builder.min.js?ver=4.9.4:2 [FastSpring API] (!) Error: Error received:  400 payload-invalid
c @ fastspring-builder.min.js?ver=4.9.4:2
dlicoursesonline.test.onfastspring.com/popup-dlicoursesonline/builder/finalize:1 Failed to load resource: the server responded with a status of 400 ()
fastspring-builder.min.js?ver=4.9.4:2 [FastSpring API] (!) Error: Error received:  400 empty-session
c @ fastspring-builder.min.js?ver=4.9.4:2

So the plugin doesnt work by itself for me. Also when I pair it with Stripe (which is what my client wants, is the 2 possible options), then Stripe checkout breaks as well. When I disable this plugin, then I can checkout with Stripe again.

Here is my website for testing:
https://fastspring-dli.pantheonsite.io/
just go to the course catalog and then try to checkout to see what I mean.

I would really appreciate if you have any time to look into this, ping me if you want to chat about it.

@cyberwombat
Copy link
Owner

I've just pushed some minor changes but perhaps see if that works. I am in the process of finalizing the plugin but it would be a couple of weeks - then it will be on the WP plugin directory.

@timothyjoh
Copy link
Author

I downloaded it, still the same general problems.

Here is what I have traced down in the past few hours. The JS ajax making the call back to WP is working, returning a result with a session, containing the payload and key.

When the JS executes, calling

  fastspring.builder.secure(session.payload, session.key)
  fastspring.builder.checkout()

That is when I get the above errors. I am guessing that the hashing going on on my php side is not working with FS, and the FS library is throwing those errors.

I'm gonna try generating new certs and uploading to FS, I'll let you know.

@timothyjoh
Copy link
Author

Yea, so I tried generating the certs again, and pretty much get the same behavior as before.

I've also tried in debug mode, where it doesn't encrypt the JSON, but I get the same error from FS. I'm also trying to work it out with FS tech support.

This is the JSON I am sending as the payload unencrypted

{"tags":{"store_order_id":7031},"contact":{"email":"tjohnson@scitent.com","firstName":"Timo","lastName":"Jojo","company":"Scitensia","addressLine1":"400 preston","addressLine2":"","region":"VA","city":"Charl","postalCode":"22911","country":"US","phoneNumber":"4343423235"},"items":[{"product":"fibers-fabrics","quantity":1,"pricing":{"quantityBehavior":"lock","trial":0,"interval":"","intervalLength":1,"intervalCount":null,"price":{"USD":99}},"display":{"en":"Fibers & Fabrics"},"description":{"summary":{"en":""},"full":{"en":""}},"image":"//fastspring-dli.pantheonsite.io/wp-content/uploads/2018/03/fibers-fabrics-course-cmpr.jpg","removable":false,"sku":"DLI-001"}]}

I'm just learning the FS API, and you have written so much good code here. I am assuming it works for you on a production site? I really appreciate your code and organization of the library.

@cyberwombat
Copy link
Owner

I am able to get a 400 as well. Try this commit - that one is used in prod
https://github.com/cyberwombat/woocommerce-fastspring-payment-gateway/tree/02d0db1bfca225c3932fdd791f7494e17995622d
The stuff after is cleanups and setup for subscriptions and is a work in progress. I am intending to address this in the next couple of weeks but in the meantime see if the one above works. Its prob a small error I accidentally introduced which is causing the current 400.

@cyberwombat
Copy link
Owner

I see now that the issue is with the current in progress work on subscriptions. I have disabled them and pushed so try the latest please. As fas as Stripe not working.. there was a conflict with the checkout form handling in a previous commit but I think that has been fixed. Let me know how things work.

@timothyjoh
Copy link
Author

thanks for that, ill take a look at the latest

@timothyjoh
Copy link
Author

woohoo man, that update undid my problems and now its at least showing me the modal.

Thanks so much for giving me the time on this. I will let you know as I go forward.

@timothyjoh
Copy link
Author

Just wanted to further thank you. Tested it all out today, transactions are working in test mode, working with Stripe gateway too.

@ps-PKrueger
Copy link

ps-PKrueger commented Mar 29, 2018 via email

@cyberwombat
Copy link
Owner

cyberwombat commented Apr 14, 2018

@ps-PKrueger and @jhnsntmthy - I've added docs in the wiki

@ps-PKrueger I've uploaded a subscriptions beta - Please open a new issue if needed.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants